21 #define DEBUG_TYPE "arm-bb-utils" 59 BBI.Unalign = isThumb ? 1 : 2;
66 if (!MBB->empty() && MBB->back().getOpcode() == ARM::tBR_JTr) {
67 BBI.PostAlign =
Align(4);
68 MBB->getParent()->ensureAlignment(
Align(4));
85 assert(
I != MBB->
end() &&
"Didn't find MI in its own basic block?");
95 unsigned MaxDisp)
const {
96 unsigned PCAdj = isThumb ? 4 : 8;
98 unsigned DestOffset = BBInfo[DestBB->
getNumber()].Offset;
102 <<
" max delta=" << MaxDisp <<
" from " <<
getOffsetOf(MI)
103 <<
" to " << DestOffset <<
" offset " 104 << int(DestOffset - BrOffset) <<
"\t" << *
MI);
106 if (BrOffset <= DestOffset) {
108 if (DestOffset-BrOffset <= MaxDisp)
111 if (BrOffset-DestOffset <= MaxDisp)
119 "Basic block is not a child of the current function.\n");
123 <<
" - name: " << BB->
getName() <<
"\n" 124 <<
" - number: " << BB->
getNumber() <<
"\n" 125 <<
" - function: " << MF.
getName() <<
"\n" 132 const unsigned Offset = BBInfo[i - 1].postOffset(Align);
133 const unsigned KnownBits = BBInfo[i - 1].postKnownBits(Align);
139 BBInfo[i].Offset == Offset &&
140 BBInfo[i].KnownBits == KnownBits)
143 BBInfo[i].Offset =
Offset;
144 BBInfo[i].KnownBits = KnownBits;
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
This class represents lattice values for constants.
unsigned getNumBlockIDs() const
getNumBlockIDs - Return the number of MBB ID's allocated.
void adjustBBOffsetsAfter(MachineBasicBlock *MBB)
BasicBlockInfo - Information about the offset and size of a single basic block.
Printable printMBBReference(const MachineBasicBlock &MBB)
Prints a machine basic block reference.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
Align getAlignment() const
Return alignment of the basic block.
int getNumber() const
MachineBasicBlocks are uniquely numbered at the function level, unless they're not in a MachineFuncti...
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
MachineBasicBlock * getBlockNumbered(unsigned N) const
getBlockNumbered - MachineBasicBlocks are automatically numbered when they are inserted into the mach...
* if(!EatIfPresent(lltok::kw_thread_local)) return false
ParseOptionalThreadLocal := /*empty.
StringRef getName() const
Return the name of the corresponding LLVM basic block, or an empty string.
static bool mayOptimizeThumb2Instruction(const MachineInstr *MI)
unsigned getOffsetOf(MachineInstr *MI) const
getOffsetOf - Return the current offset of the specified machine instruction from the start of the fu...
unsigned getInstSizeInBytes(const MachineInstr &MI) const override
GetInstSize - Returns the size of the specified MachineInstr.
static constexpr const Align None()
Returns a default constructed Align which corresponds to no alignment.
This struct is a compact representation of a valid (non-zero power of two) alignment.
bool isBBInRange(MachineInstr *MI, MachineBasicBlock *DestBB, unsigned MaxDisp) const
isBBInRange - Returns true if the distance between specific MI and specific BB can fit in MI's displa...
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
void computeBlockSize(MachineBasicBlock *MBB)
const MachineBasicBlock * getParent() const
Representation of each machine instruction.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())