45 #define DEBUG_TYPE "codegen"
47 void MachineFunctionInitializer::anchor() {}
62 : Fn(F),
Target(TM), STI(TM.getSubtargetImpl(*F)), Ctx(mmi.getContext()),
70 FrameInfo =
new (Allocator)
83 Alignment = std::max(Alignment,
86 FunctionNumber = FunctionNum;
87 JumpTableInfo =
nullptr;
96 I->Insts.clearAndLeakNodesUnsafely();
98 InstructionRecycler.clear(Allocator);
99 OperandRecycler.
clear(Allocator);
100 BasicBlockRecycler.clear(Allocator);
102 RegInfo->~MachineRegisterInfo();
110 FrameInfo->~MachineFrameInfo();
117 JumpTableInfo->~MachineJumpTableInfo();
130 if (JumpTableInfo)
return JumpTableInfo;
132 JumpTableInfo =
new (Allocator)
134 return JumpTableInfo;
147 if (
empty()) { MBBNumbering.clear();
return; }
155 unsigned BlockNo = 0;
157 BlockNo = std::prev(MBBI)->getNumber() + 1;
159 for (; MBBI != E; ++MBBI, ++BlockNo) {
160 if (MBBI->getNumber() != (
int)BlockNo) {
162 if (MBBI->getNumber() != -1) {
163 assert(MBBNumbering[MBBI->getNumber()] == &*MBBI &&
164 "MBB number mismatch!");
165 MBBNumbering[MBBI->getNumber()] =
nullptr;
169 if (MBBNumbering[BlockNo])
170 MBBNumbering[BlockNo]->setNumber(-1);
172 MBBNumbering[BlockNo] = MBBI;
173 MBBI->setNumber(BlockNo);
179 assert(BlockNo <= MBBNumbering.size() &&
"Mismatch!");
180 MBBNumbering.resize(BlockNo);
187 return new (InstructionRecycler.Allocate<
MachineInstr>(Allocator))
195 return new (InstructionRecycler.Allocate<
MachineInstr>(Allocator))
212 InstructionRecycler.Deallocate(Allocator, MI);
226 assert(MBB->
getParent() ==
this &&
"MBB parent mismatch!");
227 MBB->~MachineBasicBlock();
228 BasicBlockRecycler.Deallocate(Allocator, MBB);
233 uint64_t s,
unsigned base_alignment,
242 int64_t Offset, uint64_t Size) {
244 return new (Allocator)
249 return new (Allocator)
261 std::pair<MachineInstr::mmo_iterator, MachineInstr::mmo_iterator>
274 if ((*I)->isLoad()) {
275 if (!(*I)->isStore())
283 (*I)->
getSize(), (*I)->getBaseAlignment(),
285 Result[Index] = JustLoad;
290 return std::make_pair(Result, Result + Num);
293 std::pair<MachineInstr::mmo_iterator, MachineInstr::mmo_iterator>
306 if ((*I)->isStore()) {
315 (*I)->
getSize(), (*I)->getBaseAlignment(),
317 Result[Index] = JustStore;
322 return std::make_pair(Result, Result + Num);
325 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
337 OS <<
"# Machine code for function " <<
getName() <<
": ";
339 OS << (RegInfo->
isSSA() ?
"SSA" :
"Post SSA");
341 OS <<
", not tracking liveness";
346 FrameInfo->
print(*
this, OS);
350 JumpTableInfo->
print(OS);
358 OS <<
"Function Live Ins: ";
363 OS <<
" in " << PrintReg(
I->second, TRI);
364 if (std::next(
I) != E)
372 for (
const auto &BB : *
this) {
374 BB.print(OS, MST, Indexes);
377 OS <<
"\n# End machine code for function " <<
getName() <<
".\n\n";
387 return (
"CFG for '" + F->
getName() +
"' function").str();
399 OSS <<
": " << BB->getName();
404 if (OutStr[0] ==
'\n') OutStr.erase(OutStr.begin());
407 for (
unsigned i = 0; i != OutStr.length(); ++i)
408 if (OutStr[i] ==
'\n') {
410 OutStr.insert(OutStr.begin()+i+1,
'l');
422 errs() <<
"MachineFunction::viewCFG is only available in debug builds on "
423 <<
"systems with Graphviz or gv!\n";
432 errs() <<
"MachineFunction::viewCFGOnly is only available in debug builds on "
433 <<
"systems with Graphviz or gv!\n";
451 assert((VRegRC == RC || (VRegRC->
contains(PReg) &&
453 "Register class mismatch!");
465 bool isLinkerPrivate)
const {
467 assert(JumpTableInfo &&
"No jump tables");
468 assert(JTI < JumpTableInfo->getJumpTables().
size() &&
"Invalid JTI!");
491 if (!StackRealignable || !RealignOption)
492 assert(Align <= StackAlignment &&
493 "For targets without stack realignment, Align is out of limit!");
494 if (MaxAlignment < Align) MaxAlignment =
Align;
499 unsigned StackAlign) {
500 if (!ShouldClamp || Align <= StackAlign)
502 DEBUG(
dbgs() <<
"Warning: requested alignment " << Align
503 <<
" exceeds the stack alignment " << StackAlign
504 <<
" when stack realignment is off" <<
'\n');
512 assert(Size != 0 &&
"Cannot allocate zero size stack objects!");
514 Alignment, StackAlignment);
515 Objects.push_back(StackObject(Size, Alignment, 0,
false, isSS, Alloca,
517 int Index = (
int)Objects.size() - NumFixedObjects - 1;
518 assert(Index >= 0 &&
"Bad frame index!");
526 unsigned Alignment) {
528 Alignment, StackAlignment);
530 int Index = (
int)Objects.size() - NumFixedObjects - 1;
540 HasVarSizedObjects =
true;
542 Alignment, StackAlignment);
543 Objects.push_back(StackObject(0, Alignment, 0,
false,
false, Alloca,
true));
545 return (
int)Objects.size()-NumFixedObjects-1;
553 bool Immutable,
bool isAliased) {
554 assert(Size != 0 &&
"Cannot allocate zero size fixed stack objects!");
562 Objects.insert(Objects.begin(), StackObject(Size, Align, SPOffset, Immutable,
564 nullptr, isAliased));
565 return -++NumFixedObjects;
575 Objects.insert(Objects.begin(), StackObject(Size, Align, SPOffset,
580 return -++NumFixedObjects;
597 for (std::vector<CalleeSavedInfo>::const_iterator
I = CSI.begin(),
598 E = CSI.end();
I != E; ++
I)
599 BV.reset(
I->getReg());
616 if (FixedOff > Offset) Offset = FixedOff;
624 Offset = (Offset+Align-1)/Align*Align;
626 MaxAlign = std::max(Align, MaxAlign);
646 StackAlign = std::max(StackAlign, MaxAlign);
647 unsigned AlignMask = StackAlign - 1;
648 Offset = (Offset + AlignMask) & ~uint64_t(AlignMask);
650 return (
unsigned)Offset;
654 if (Objects.empty())
return;
659 OS <<
"Frame Objects:\n";
661 for (
unsigned i = 0, e = Objects.size(); i != e; ++i) {
662 const StackObject &SO = Objects[i];
663 OS <<
" fi#" << (
int)(i-NumFixedObjects) <<
": ";
664 if (SO.Size == ~0ULL) {
669 OS <<
"variable sized";
671 OS <<
"size=" << SO.Size;
672 OS <<
", align=" << SO.Alignment;
674 if (i < NumFixedObjects)
676 if (i < NumFixedObjects || SO.SPOffset != -1) {
677 int64_t Off = SO.SPOffset - ValOffset;
678 OS <<
", at location [SP";
689 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
740 const std::vector<MachineBasicBlock*> &DestBBs) {
741 assert(!DestBBs.empty() &&
"Cannot create an empty jump table!");
743 return JumpTables.size()-1;
750 assert(Old != New &&
"Not making a change?");
751 bool MadeChange =
false;
752 for (
size_t i = 0, e = JumpTables.size(); i != e; ++i)
762 assert(Old != New &&
"Not making a change?");
763 bool MadeChange =
false;
765 for (
size_t j = 0, e = JTE.
MBBs.size(); j != e; ++j)
766 if (JTE.
MBBs[j] == Old) {
774 if (JumpTables.empty())
return;
776 OS <<
"Jump Tables:\n";
778 for (
unsigned i = 0, e = JumpTables.size(); i != e; ++i) {
779 OS <<
" jt#" << i <<
": ";
780 for (
unsigned j = 0, f = JumpTables[i].MBBs.size(); j != f; ++j)
781 OS <<
" BB#" << JumpTables[i].MBBs[j]->getNumber();
787 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
796 void MachineConstantPoolValue::anchor() { }
800 return Val.MachineCPVal->getType();
801 return Val.ConstVal->getType();
807 return Val.MachineCPVal->getRelocationInfo();
808 return Val.ConstVal->getRelocationInfo();
843 for (
unsigned i = 0, e =
Constants.size(); i != e; ++i)
844 if (
Constants[i].isMachineConstantPoolEntry())
847 MachineCPVsSharingEntries.begin(), E = MachineCPVsSharingEntries.end();
857 if (A == B)
return true;
864 if (isa<StructType>(A->
getType()) || isa<ArrayType>(A->
getType()) ||
879 if (isa<PointerType>(A->
getType()))
881 const_cast<Constant *>(A), DL);
882 else if (A->
getType() != IntTy)
884 const_cast<Constant *>(A), DL);
885 if (isa<PointerType>(B->
getType()))
887 const_cast<Constant *>(B), DL);
888 else if (B->
getType() != IntTy)
890 const_cast<Constant *>(B), DL);
898 unsigned Alignment) {
899 assert(Alignment &&
"Alignment must be specified!");
900 if (Alignment > PoolAlignment) PoolAlignment = Alignment;
905 for (
unsigned i = 0, e =
Constants.size(); i != e; ++i)
906 if (!
Constants[i].isMachineConstantPoolEntry() &&
908 if ((
unsigned)
Constants[i].getAlignment() < Alignment)
918 unsigned Alignment) {
919 assert(Alignment &&
"Alignment must be specified!");
920 if (Alignment > PoolAlignment) PoolAlignment = Alignment;
927 MachineCPVsSharingEntries.insert(V);
928 return (
unsigned)Idx;
938 OS <<
"Constant Pool:\n";
939 for (
unsigned i = 0, e =
Constants.size(); i != e; ++i) {
940 OS <<
" cp#" << i <<
": ";
941 if (
Constants[i].isMachineConstantPoolEntry())
942 Constants[i].Val.MachineCPVal->print(OS);
944 Constants[i].Val.ConstVal->printAsOperand(OS,
false);
945 OS <<
", align=" <<
Constants[i].getAlignment();
950 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
unsigned getStackAlignment() const
getStackAlignment - This method returns the number of bytes to which the stack pointer must be aligne...
static SectionKind getReadOnlyWithRelLocal()
const MachineFunction * getParent() const
getParent - Return the MachineFunction containing this basic block.
A parsed version of the target data layout string in and methods for querying it. ...
The MachineConstantPool class keeps track of constants referenced by a function which must be spilled...
SectionKind getSectionKind(const DataLayout *DL) const
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
MachineInstr * CreateMachineInstr(const MCInstrDesc &MCID, DebugLoc DL, bool NoImp=false)
CreateMachineInstr - Allocate a new MachineInstr.
Alignment of stack for function (3 bits) stored as log2 of alignment with +1 bias 0 means unaligned (...
BitVector getPristineRegs(const MachineFunction &MF) const
Return a set of physical registers that are pristine.
unsigned getPrefFunctionAlignment() const
Return the preferred function alignment.
void RenumberBlocks(MachineBasicBlock *MBBFrom=nullptr)
RenumberBlocks - This discards all of the MachineBasicBlock numbers and recomputes them...
livein_iterator livein_end() const
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
int getNumber() const
getNumber - MachineBasicBlocks are uniquely numbered at the function level, unless they're not in a M...
unsigned createVirtualRegister(const TargetRegisterClass *RegClass)
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
void addLiveIn(unsigned Reg, unsigned vreg=0)
addLiveIn - Add the specified register as a live-in.
bool hasSubClassEq(const TargetRegisterClass *RC) const
hasSubClassEq - Returns true if RC is a sub-class of or equal to this class.
unsigned addLiveIn(unsigned PReg, const TargetRegisterClass *RC)
addLiveIn - Add the specified physical register as a live-in value and create a corresponding virtual...
Describe properties that are true of each instruction in the target description file.
EK_Inline - Jump table entries are emitted inline at their point of use.
std::string getNodeLabel(const MachineBasicBlock *Node, const MachineFunction *Graph)
bool adjustsStack() const
Return true if this function adjusts the stack – e.g., when calling another function.
const char * getPrivateGlobalPrefix() const
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
static SectionKind getMergeableConst8()
static SectionKind getMergeableConst16()
A raw_ostream that writes to an SmallVector or SmallString.
const Function * getFunction() const
getFunction - Return the LLVM function that this machine code represents
Manage lifetime of a slot tracker for printing IR.
unsigned getFunctionNumber() const
getFunctionNumber - Return a unique ID for the current function.
void DeleteMachineBasicBlock(MachineBasicBlock *MBB)
DeleteMachineBasicBlock - Delete the given MachineBasicBlock.
MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, unsigned f, uint64_t s, unsigned base_alignment, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr)
getMachineMemOperand - Allocate a new MachineMemOperand.
static SectionKind getMergeableConst4()
bool ReplaceMBBInJumpTable(unsigned Idx, MachineBasicBlock *Old, MachineBasicBlock *New)
ReplaceMBBInJumpTable - If Old is a target of the jump tables, update the jump table to branch to New...
bool isStackRealignable() const
isStackRealignable - This method returns whether the stack can be realigned.
StringRef getName() const
Return a constant reference to the value's name.
MachineJumpTableInfo * getOrCreateJumpTableInfo(unsigned JTEntryKind)
getOrCreateJumpTableInfo - Get the JumpTableInfo for this function, if it does already exist...
unsigned getMaxAlignment() const
Return the alignment in bytes that this function must be aligned to, which is greater than the defaul...
const std::vector< CalleeSavedInfo > & getCalleeSavedInfo() const
Returns a reference to call saved info vector for the current function.
unsigned getRelocationInfo() const
getRelocationInfo - This method classifies the entry according to whether or not it may generate a re...
void viewCFG() const
viewCFG - This function is meant for use from the debugger.
JTEntryKind
JTEntryKind - This enum indicates how each entry of the jump table is represented and emitted...
DOTGraphTraits(bool isSimple=false)
MachineMemOperand - A description of a memory reference used in the backend.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
This file declares the MachineConstantPool class which is an abstract constant pool to keep track of ...
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
unsigned getPointerABIAlignment(unsigned AS=0) const
Layout pointer alignment FIXME: The defaults need to be removed once all of the backends/clients are ...
static unsigned clampStackAlignment(bool ShouldClamp, unsigned Align, unsigned StackAlign)
Clamp the alignment if requested and emit a warning.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
const TargetRegisterClass * getRegClass(unsigned Reg) const
getRegClass - Return the register class of the specified virtual register.
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
std::pair< MachineInstr::mmo_iterator, MachineInstr::mmo_iterator > extractLoadMemRefs(MachineInstr::mmo_iterator Begin, MachineInstr::mmo_iterator End)
extractLoadMemRefs - Allocate an array and populate it with just the load information from the given ...
Context object for machine code objects.
PrintReg - Helper class for printing registers on a raw_ostream.
unsigned getNumRegs() const
Return the number of registers this target has (useful for sizing arrays holding per register informa...
void print(const MachineFunction &MF, raw_ostream &OS) const
Used by the MachineFunction printer to print information about stack objects.
int getObjectIndexBegin() const
Return the minimum frame object index.
unsigned createJumpTableIndex(const std::vector< MachineBasicBlock * > &DestBBs)
createJumpTableIndex - Create a new jump table.
EK_LabelDifference32 - Each entry is the address of the block minus the address of the jump table...
virtual int getExistingMachineCPValue(MachineConstantPool *CP, unsigned Alignment)=0
static std::string getGraphName(const MachineFunction *F)
EK_BlockAddress - Each entry is a plain address of block, e.g.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
void print(raw_ostream &OS, SlotIndexes *=nullptr) const
print - Print out the MachineFunction in a format suitable for debugging to the specified stream...
This class is a data container for one entry in a MachineConstantPool.
const DataLayout & getDataLayout() const
Return the DataLayout attached to the Module associated to this MF.
virtual const MCPhysReg * getCalleeSavedRegs(const MachineFunction *MF) const =0
getCalleeSavedRegs - Return a null-terminated list of all of the callee saved registers on this targe...
MachineBasicBlock * CreateMachineBasicBlock(const BasicBlock *bb=nullptr)
CreateMachineBasicBlock - Allocate a new MachineBasicBlock.
unsigned getTransientStackAlignment() const
getTransientStackAlignment - This method returns the number of bytes to which the stack pointer must ...
const BasicBlock * getBasicBlock() const
getBasicBlock - Return the LLVM basic block that this instance corresponded to originally.
unsigned estimateStackSize(const MachineFunction &MF) const
Estimate and return the size of the stack frame.
bool isMachineConstantPoolEntry() const
isMachineConstantPoolEntry - Return true if the MachineConstantPoolEntry is indeed a target specific ...
static void deleteNode(NodeTy *V)
unsigned getEntrySize(const DataLayout &TD) const
getEntrySize - Return the size of each entry in the jump table.
unsigned getEntryAlignment(const DataLayout &TD) const
getEntryAlignment - Return the alignment of each entry in the jump table.
EK_GPRel64BlockAddress - Each entry is an address of block, encoded with a relocation as gp-relative...
unsigned getABIIntegerTypeAlignment(unsigned BitWidth) const
Returns the minimum ABI-required alignment for an integer type of the specified bitwidth.
unsigned int getFlags() const
getFlags - Return the raw flags of the source value,
EK_Custom32 - Each entry is a 32-bit value that is custom lowered by the TargetLowering::LowerCustomJ...
LLVM Basic Block Representation.
virtual bool needsStackRealignment(const MachineFunction &MF) const
needsStackRealignment - true if storage within the function requires the stack pointer to be aligned ...
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important base class in LLVM.
LLVM_ATTRIBUTE_RETURNS_NONNULL LLVM_ATTRIBUTE_RETURNS_NOALIAS void * Allocate(size_t Size, size_t Alignment)
Allocate space at the specified alignment.
static bool CanShareConstantPoolEntry(const Constant *A, const Constant *B, const DataLayout &DL)
Test whether the given two constants can be allocated the same constant pool entry.
unsigned getLiveInVirtReg(unsigned PReg) const
getLiveInVirtReg - If PReg is a live-in physical register, return the corresponding live-in physical ...
bool shouldSplitStack()
Should we be emitting segmented stack stuff for the function.
bool tracksLiveness() const
tracksLiveness - Returns true when tracking register liveness accurately.
void viewCFGOnly() const
viewCFGOnly - This function is meant for use from the debugger.
virtual ~MachineFunctionInfo()
for(unsigned i=0, e=MI->getNumOperands();i!=e;++i)
SectionKind - This is a simple POD value that classifies the properties of a section.
const PseudoSourceValue * getPseudoValue() const
void ViewGraph(const GraphType &G, const Twine &Name, bool ShortNames=false, const Twine &Title="", GraphProgram::Name Program=GraphProgram::DOT)
ViewGraph - Emit a dot graph, run 'dot', run gv on the postscript file, then cleanup.
int CreateFixedObject(uint64_t Size, int64_t SPOffset, bool Immutable, bool isAliased=false)
Create a new object at a fixed location on the stack.
bool isCalleeSavedInfoValid() const
Has the callee saved info been calculated yet?
std::vector< MachineBasicBlock * > MBBs
MBBs - The vector of basic blocks from which to create the jump table.
void incorporateFunction(const Function &F)
Incorporate the given function.
void DeleteMachineInstr(MachineInstr *MI)
DeleteMachineInstr - Delete the given MachineInstr.
int CreateSpillStackObject(uint64_t Size, unsigned Alignment)
Create a new statically sized stack object that represents a spill slot, returning a nonnegative iden...
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
LLVMContext & getContext() const
All values hold a context through their type.
Abstract base class for all machine specific constantpool value subclasses.
void Deallocate(const void *, size_t)
MachinePointerInfo - This class contains a discriminated union of information about pointers in memor...
iterator erase(iterator where)
virtual bool hasReservedCallFrame(const MachineFunction &MF) const
hasReservedCallFrame - Under normal circumstances, when a frame pointer is not required, we reserve argument space for call sites in the function immediately on entry to the current function.
int64_t getObjectOffset(int ObjectIdx) const
Return the assigned stack offset of the specified object from the incoming stack pointer.
bool isDeadObjectIndex(int ObjectIdx) const
Returns true if the specified index corresponds to a dead object.
void print(raw_ostream &OS) const
print - Used by the MachineFunction printer to print information about constant pool objects...
DOTGraphTraits - Template class that can be specialized to customize how graphs are converted to 'dot...
virtual const TargetFrameLowering * getFrameLowering() const
static IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
void print(raw_ostream &OS) const
print - Used by the MachineFunction printer to print information about jump tables.
MCSymbol * getPICBaseSymbol() const
getPICBaseSymbol - Return a function-local symbol to represent the PIC base.
uint64_t getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
void dump() const
dump - Call print(cerr) to be called from the debugger.
MachineInstr * CloneMachineInstr(const MachineInstr *Orig)
CloneMachineInstr - Create a new MachineInstr which is a copy of the 'Orig' instruction, identical in all ways except the instruction has no parent, prev, or next.
bool ReplaceMBBInJumpTables(MachineBasicBlock *Old, MachineBasicBlock *New)
ReplaceMBBInJumpTables - If Old is the target of any jump tables, update the jump tables to branch to...
Constant * ConstantFoldInstOperands(unsigned Opcode, Type *DestTy, ArrayRef< Constant * > Ops, const DataLayout &DL, const TargetLibraryInfo *TLI=nullptr)
ConstantFoldInstOperands - Attempt to constant fold an instruction with the specified operands...
unsigned getObjectAlignment(int ObjectIdx) const
Return the alignment of the specified stack object.
Module.h This file contains the declarations for the Module class.
Type * getType() const
All values are typed, get the type of this value.
int getOffsetOfLocalArea() const
getOffsetOfLocalArea - This method returns the offset of the local area from the stack pointer on ent...
virtual const TargetLowering * getTargetLowering() const
const char * getLinkerPrivateGlobalPrefix() const
unsigned getMaxCallFrameSize() const
Return the maximum size of a call frame that must be allocated for an outgoing function call...
Information about stack frame layout on the target.
A collection of metadata nodes that might be associated with a memory access used by the alias-analys...
static SectionKind getReadOnlyWithRel()
livein_iterator livein_begin() const
void clear(AllocatorType &Allocator)
Release all the tracked allocations to the allocator.
static cl::opt< AlignMode > Align(cl::desc("Load/store alignment support"), cl::Hidden, cl::init(NoStrictAlign), cl::values(clEnumValN(StrictAlign,"aarch64-strict-align","Disallow all unaligned memory accesses"), clEnumValN(NoStrictAlign,"aarch64-no-strict-align","Allow unaligned memory accesses"), clEnumValEnd))
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
MCSymbol * getJTISymbol(unsigned JTI, MCContext &Ctx, bool isLinkerPrivate=false) const
getJTISymbol - Return the MCSymbol for the specified non-empty jump table.
Target - Wrapper for Target specific information.
const Value * getValue() const
getValue - Return the base address of the memory access.
void dump() const
dump - Print the current MachineFunction to cerr, useful for debugger use.
MachineJumpTableEntry - One jump table in the jump table info.
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
Representation of each machine instruction.
uint64_t MinAlign(uint64_t A, uint64_t B)
MinAlign - A and B are either alignments or offsets.
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
void ensureMaxAlignment(unsigned Align)
Make sure the function is at least Align bytes aligned.
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
unsigned getMinFunctionAlignment() const
Return the minimum function alignment.
int CreateFixedSpillStackObject(uint64_t Size, int64_t SPOffset)
Create a spill slot at a fixed location on the stack.
union llvm::MachineConstantPoolEntry::@30 Val
The constant itself.
uint64_t getTypeStoreSize(Type *Ty) const
Returns the maximum number of bytes that may be overwritten by storing the specified type...
bool hasVarSizedObjects() const
This method may be called any time after instruction selection is complete to determine if the stack ...
void dump() const
dump - Call to stderr.
int CreateStackObject(uint64_t Size, unsigned Alignment, bool isSS, const AllocaInst *Alloca=nullptr)
Create a new statically sized stack object, returning a nonnegative identifier to represent it...
JTEntryKind getEntryKind() const
std::vector< std::pair< unsigned, unsigned > >::const_iterator livein_iterator
std::pair< MachineInstr::mmo_iterator, MachineInstr::mmo_iterator > extractStoreMemRefs(MachineInstr::mmo_iterator Begin, MachineInstr::mmo_iterator End)
extractStoreMemRefs - Allocate an array and populate it with just the store information from the give...
const ARM::ArchExtKind Kind
A raw_ostream that writes to an std::string.
void dump(const MachineFunction &MF) const
dump - Print the function to stderr.
Module * getParent()
Get the module that this global value is contained inside of...
int64_t getOffset() const
getOffset - For normal values, this is a byte offset added to the base address.
void deallocateOperandArray(OperandCapacity Cap, MachineOperand *Array)
Dellocate an array of MachineOperands and recycle the memory.
bool livein_empty() const
static const Function * getParent(const Value *V)
BasicBlockListType::iterator iterator
uint64_t getSize() const
getSize - Return the size in bytes of the memory reference.
This class implements an extremely fast bulk output stream that can only output to a stream...
DefaultDOTGraphTraits - This class provides the default implementations of all of the DOTGraphTraits ...
Primary interface to the complete machine description for the target machine.
C - The default llvm calling convention, compatible with C.
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
StringRef - Represent a constant reference to a string, i.e.
EK_GPRel32BlockAddress - Each entry is an address of block, encoded with a relocation as gp-relative...
int getObjectIndexEnd() const
Return one past the maximum frame object index.
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
void print(raw_ostream &OS, SlotIndexes *=nullptr) const
unsigned getPointerSize(unsigned AS=0) const
Layout pointer size FIXME: The defaults need to be removed once all of the backends/clients are updat...
int CreateVariableSizedObject(unsigned Alignment, const AllocaInst *Alloca)
Notify the MachineFrameInfo object that a variable sized object has been created. ...
static SectionKind getReadOnly()
MachineInstr::mmo_iterator allocateMemRefsArray(unsigned long Num)
allocateMemRefsArray - Allocate an array to hold MachineMemOperand pointers.
unsigned getFnStackAlignment() const
Return the stack alignment for the function.
int64_t getObjectSize(int ObjectIdx) const
Return the size of the specified object.
unsigned getConstantPoolIndex(const Constant *C, unsigned Alignment)
getConstantPoolIndex - Create a new entry in the constant pool or return an existing one...
MachineModuleInfo - This class contains meta information specific to a module.
This file describes how to lower LLVM code to machine code.
AllocaInst - an instruction to allocate memory on the stack.
uint64_t getBaseAlignment() const
getBaseAlignment - Return the minimum known alignment in bytes of the base address, without the offset.
bool contains(unsigned Reg) const
contains - Return true if the specified register is included in this register class.