79 cl::desc(
"Leave out unnecessary information when printing MIR"));
84 struct FrameIndexOperand {
90 : Name(Name.str()), ID(ID), IsFixed(IsFixed) {}
94 return FrameIndexOperand(Name, ID,
false);
98 static FrameIndexOperand createFixed(
unsigned ID) {
99 return FrameIndexOperand(
"", ID,
true);
153 : OS(OS), MST(MST), RegisterMaskIds(RegisterMaskIds),
154 StackObjectOperandMapping(StackObjectOperandMapping) {}
166 unsigned I,
bool ShouldPrintRegisterTies,
167 LLT TypeToPrint,
bool IsDef =
false);
183 Mod.
print(OS,
nullptr);
202 else if (Reg < TRI->getNumRegs())
215 initRegisterMaskIds(MF);
239 bool IsNewlineNeeded =
false;
240 for (
const auto &MBB : MF) {
243 MIPrinter(StrOS, MST, RegisterMaskIds, StackObjectOperandMapping)
245 IsNewlineNeeded =
true;
256 assert(RegMask &&
"Can't print an empty register mask");
259 bool IsRegInRegMaskFound =
false;
262 if (RegMask[
I / 32] & (1u << (
I % 32))) {
263 if (IsRegInRegMaskFound)
266 IsRegInRegMaskFound =
true;
289 VReg.
Class = std::string(
"_");
291 "Generic registers must have a valid type");
311 std::vector<yaml::FlowStringValue> CalleeSavedRegisters;
315 CalleeSavedRegisters.push_back(Reg);
340 MIPrinter(StrOS, MST, RegisterMaskIds, StackObjectOperandMapping)
345 MIPrinter(StrOS, MST, RegisterMaskIds, StackObjectOperandMapping)
372 StackObjectOperandMapping.
insert(
373 std::make_pair(
I, FrameIndexOperand::createFixed(ID++)));
386 Alloca->hasName() ? Alloca->getName() :
"<unnamed alloca>";
397 StackObjectOperandMapping.
insert(std::make_pair(
398 I, FrameIndexOperand::create(YamlObject.
Name.
Value, ID++)));
404 auto StackObjectInfo = StackObjectOperandMapping.
find(CSInfo.getFrameIdx());
405 assert(StackObjectInfo != StackObjectOperandMapping.
end() &&
406 "Invalid stack object index");
407 const FrameIndexOperand &StackObject = StackObjectInfo->second;
408 if (StackObject.IsFixed)
415 auto StackObjectInfo = StackObjectOperandMapping.
find(LocalObject.first);
416 assert(StackObjectInfo != StackObjectOperandMapping.
end() &&
417 "Invalid stack object index");
418 const FrameIndexOperand &StackObject = StackObjectInfo->second;
419 assert(!StackObject.IsFixed &&
"Expected a locally mapped stack object");
420 YMF.
StackObjects[StackObject.ID].LocalOffset = LocalObject.second;
427 MIPrinter(StrOS, MST, RegisterMaskIds, StackObjectOperandMapping)
434 auto StackObjectInfo = StackObjectOperandMapping.
find(DebugVar.Slot);
435 assert(StackObjectInfo != StackObjectOperandMapping.
end() &&
436 "Invalid stack object index");
437 const FrameIndexOperand &StackObject = StackObjectInfo->second;
438 assert(!StackObject.IsFixed &&
"Expected a non-fixed stack object");
442 DebugVar.Var->printAsOperand(StrOS, MST);
446 DebugVar.Expr->printAsOperand(StrOS, MST);
450 DebugVar.Loc->printAsOperand(StrOS, MST);
460 if (
Constant.isMachineConstantPoolEntry())
467 YamlConstant.
ID = ID++;
483 for (
const auto *MBB : Table.MBBs) {
485 MIPrinter(StrOS, MST, RegisterMaskIds, StackObjectOperandMapping)
490 YamlJTI.
Entries.push_back(Entry);
498 RegisterMaskIds.
insert(std::make_pair(
Mask, I++));
503 bool &IsFallthrough) {
519 IsFallthrough = I == MBB.end() || !I->isBarrier();
536 return std::equal(Normalized.begin(), Normalized.end(),
Equal.begin());
541 bool GuessedFallthrough;
543 if (GuessedFallthrough) {
546 if (NextI != MF.
end()) {
560 bool HasAttributes =
false;
563 OS <<
"." << BB->getName();
565 HasAttributes =
true;
569 OS <<
"<ir-block badref>";
571 OS << (
Twine(
"%ir-block.") +
Twine(Slot)).str();
575 OS << (HasAttributes ?
", " :
" (");
576 OS <<
"address-taken";
577 HasAttributes =
true;
580 OS << (HasAttributes ?
", " :
" (");
582 HasAttributes =
true;
585 OS << (HasAttributes ?
", " :
" (");
587 HasAttributes =
true;
593 bool HasLineAttributes =
false;
595 bool canPredictProbs = canPredictBranchProbabilities(MBB);
597 !canPredictSuccessors(MBB))) {
598 OS.
indent(2) <<
"successors: ";
609 HasLineAttributes =
true;
616 OS.
indent(2) <<
"liveins: ";
618 for (
const auto &LI : MBB.
liveins()) {
623 if (!LI.LaneMask.all())
627 HasLineAttributes =
true;
630 if (HasLineAttributes)
632 bool IsInBundle =
false;
639 OS.
indent(IsInBundle ? 4 : 2);
657 if (!Operand.isReg() || Operand.isDef())
662 if (ExpectedTiedIdx != TiedIdx)
679 if (!OpInfo.isGenericType())
682 if (PrintedTypes[OpInfo.getGenericTypeIndex()])
685 PrintedTypes.
set(OpInfo.getGenericTypeIndex());
693 const auto *TRI =
SubTarget.getRegisterInfo();
694 assert(TRI &&
"Expected target register info");
696 assert(
TII &&
"Expected target instruction info");
716 OS <<
"frame-setup ";
721 bool NeedComma =
false;
733 OS <<
" debug-location ";
740 bool NeedComma =
false;
754 OS <<
'.' << BB->getName();
779 Slot = CustomMST.getLocalSlot(&BB);
785 if (isa<GlobalValue>(V)) {
789 if (isa<Constant>(V)) {
805 auto ObjectInfo = StackObjectOperandMapping.
find(FrameIndex);
806 assert(ObjectInfo != StackObjectOperandMapping.
end() &&
807 "Invalid frame index");
808 const FrameIndexOperand &Operand = ObjectInfo->second;
809 if (Operand.IsFixed) {
810 OS <<
"%fixed-stack." << Operand.ID;
813 OS <<
"%stack." << Operand.ID;
814 if (!Operand.Name.empty())
815 OS <<
'.' << Operand.Name;
830 for (
const auto &I :
Flags) {
843 assert(
TII &&
"expected instruction info");
845 OS <<
"target-flags(";
846 const bool HasDirectFlags =
Flags.first;
847 const bool HasBitmaskFlags =
Flags.second;
848 if (!HasDirectFlags && !HasBitmaskFlags) {
852 if (HasDirectFlags) {
856 OS <<
"<unknown target flag>";
858 if (!HasBitmaskFlags) {
862 bool IsCommaNeeded = HasDirectFlags;
863 unsigned BitMask =
Flags.second;
865 for (
const auto &
Mask : BitMasks) {
867 if ((BitMask &
Mask.first) ==
Mask.first) {
870 IsCommaNeeded =
true;
873 BitMask &= ~(
Mask.first);
881 OS <<
"<unknown bitmask target flag>";
888 assert(
TII &&
"expected instruction info");
889 auto Indices =
TII->getSerializableTargetIndices();
890 for (
const auto &I : Indices) {
891 if (I.first == Index) {
899 unsigned I,
bool ShouldPrintRegisterTies,
LLT TypeToPrint,
905 OS << (Op.
isDef() ?
"implicit-def " :
"implicit ");
906 else if (!IsDef && Op.
isDef())
918 OS <<
"early-clobber ";
925 if (ShouldPrintRegisterTies && Op.
isTied() && !Op.
isDef())
928 OS <<
'(' << TypeToPrint <<
')';
950 OS <<
"target-index(";
960 OS <<
"%jump-table." << Op.
getIndex();
978 OS <<
"blockaddress(";
988 if (RegMaskInfo != RegisterMaskIds.
end())
997 bool IsCommaNeeded =
false;
999 if (RegMask[
Reg / 32] & (1U << (
Reg % 32))) {
1003 IsCommaNeeded =
true;
1027 OS <<
"intrinsic(@" << TII->
getName(ID) <<
')';
1041 unsigned TMMOFlag) {
1043 for (
const auto &I :
Flags) {
1044 if (I.first == TMMOFlag) {
1057 OS <<
"non-temporal ";
1059 OS <<
"dereferenceable ";
1074 assert(Op.
isStore() &&
"Non load machine operand must be a store");
1087 OS << (Op.
isLoad() ?
" from " :
" into ");
1090 OS << (Op.
isLoad() ?
" from " :
" into ");
1091 assert(PVal &&
"Expected a pseudo source value");
1092 switch (PVal->kind()) {
1103 OS <<
"constant-pool";
1107 cast<FixedStackPseudoSourceValue>(PVal)->getFrameIndex());
1110 OS <<
"call-entry ";
1111 cast<GlobalValuePseudoSourceValue>(PVal)->getValue()->printAsOperand(
1115 OS <<
"call-entry $";
1117 OS, cast<ExternalSymbolPseudoSourceValue>(PVal)->
getSymbol());
1130 AAInfo.TBAA->printAsOperand(OS, MST);
1133 OS <<
", !alias.scope ";
1134 AAInfo.Scope->printAsOperand(OS, MST);
1136 if (AAInfo.NoAlias) {
1137 OS <<
", !noalias ";
1138 AAInfo.NoAlias->printAsOperand(OS, MST);
1156 OS <<
"syncscope(\"";
1178 OS <<
"same_value ";
1180 OS <<
"<mcsymbol> ";
1186 OS <<
"<mcsymbol> ";
1191 OS <<
"def_cfa_register ";
1193 OS <<
"<mcsymbol> ";
1197 OS <<
"def_cfa_offset ";
1199 OS <<
"<mcsymbol> ";
1205 OS <<
"<mcsymbol> ";
1211 OS <<
"<unserializable cfi operation>";
1218 Out << const_cast<Module &>(M);
bool isInsideBundle() const
Return true if MI is in a bundle (but not the first MI in a bundle).
unsigned succ_size() const
void guessSuccessors(const MachineBasicBlock &MBB, SmallVectorImpl< MachineBasicBlock * > &Successors, bool &IsFallthrough)
Determine a possible list of successors of a basic block based on the basic block machine operand bei...
void push_back(const T &Elt)
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
bool isEHPad() const
Returns true if the block is a landing pad.
The MachineConstantPool class keeps track of constants referenced by a function which must be spilled...
unsigned getAlignment() const
getAlignment - Return the alignment (log2, not bytes) of the function.
StringValue VirtualRegister
A common definition of LaneBitmask for use in TableGen and CodeGen.
MachineInstr * getParent()
getParent - Return the instruction that this operand belongs to.
const GlobalValue * getGlobal() const
instr_iterator instr_begin()
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function. ...
Flags getFlags() const
Return the raw flags of the source value,.
iterator_range< livein_iterator > liveins() const
LLT getType(unsigned VReg) const
Get the low-level type of VReg or LLT{} if VReg is not a generic (target independent) virtual registe...
static StringRef input(StringRef Str, void *Ctxt, Module &Mod)
instr_iterator instr_end()
Atomic ordering constants.
This is a 'bitvector' (really, a variable-sized bit array), optimized for the case when the array is ...
static unsigned virtReg2Index(unsigned Reg)
Convert a virtual register number to a 0-based index.
static const char * getTargetMMOFlagName(const TargetInstrInfo &TII, unsigned TMMOFlag)
livein_iterator livein_end() const
bool hasProperty(Property P) const
const ConstantFP * getFPImm() const
MachineBasicBlock * getMBB() const
static unsigned index2VirtReg(unsigned Index)
Convert a 0-based index to a virtual register number.
int getNumber() const
MachineBasicBlocks are uniquely numbered at the function level, unless they're not in a MachineFuncti...
A Module instance is used to store all the information related to an LLVM module. ...
void PrintEscapedString(StringRef Name, raw_ostream &Out)
PrintEscapedString - Print each character of the specified string, escaping it if it is not printable...
unsigned getSimpleHint(unsigned VReg) const
getSimpleHint - Return the preferred register allocation hint, or 0 if a standard simple hint (Type =...
static void printIRSlotNumber(raw_ostream &OS, int Slot)
static const char * getTargetFlagName(const TargetInstrInfo *TII, unsigned TF)
This class prints out the machine functions using the MIR serialization format.
MachineBasicBlock * getRestorePoint() const
Optional< std::vector< FlowStringValue > > CalleeSavedRegisters
Describe properties that are true of each instruction in the target description file.
static bool isVirtualRegister(unsigned Reg)
Return true if the specified register number is in the virtual register namespace.
Address of indexed Jump Table for switch.
raw_ostream & indent(unsigned NumSpaces)
indent - Insert 'NumSpaces' spaces.
int getLocalSlot(const Value *V)
Return the slot number of the specified local value.
bool adjustsStack() const
Return true if this function adjusts the stack – e.g., when calling another function.
uint32_t getNumerator() const
ArrayRef< std::pair< unsigned, const char * > > getSerializableBitmaskMachineOperandTargetFlags() const override
Return an array that contains the bitmask target flag values and their names.
static LLT getTypeToPrint(const MachineInstr &MI, unsigned OpIdx, SmallBitVector &PrintedTypes, const MachineRegisterInfo &MRI)
bool isReturnAddressTaken() const
This method may be called any time after instruction selection is complete to determine if there is a...
const MCInstrDesc & getDesc() const
Returns the target instruction descriptor of this MachineInstr.
MachineBasicBlock reference.
const Function * getParent() const
Return the enclosing method, or null if none.
const char * getSymbolName() const
bool isCFIInstruction() const
const Function * getFunction() const
getFunction - Return the LLVM function that this machine code represents
Manage lifetime of a slot tracker for printing IR.
iterator_range< mmo_iterator > memoperands()
const MDNode * getMetadata() const
Mask of live-out registers.
print alias Alias Set Printer
bool hasStackProtectorIndex() const
VariableDbgInfoMapTy & getVariableDbgInfo()
unsigned getRegister() const
void printTargetFlags(const MachineOperand &Op)
StringRef getName() const
Return a constant reference to the value's name.
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.
Mask of preserved registers.
uint64_t getStackSize() const
Return the number of bytes that must be allocated to hold all of the fixed size frame objects...
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
const std::vector< MachineJumpTableEntry > & getJumpTables() const
AtomicOrdering getOrdering() const
Return the atomic ordering requirements for this memory operation.
unsigned getNumVirtRegs() const
getNumVirtRegs - Return the number of virtual registers created.
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.
StringRef getName(ID id)
Return the LLVM name for an intrinsic, such as "llvm.ppc.altivec.lvx".
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...
const HexagonInstrInfo * TII
unsigned getCFIIndex() const
const TargetRegisterInfo * getTargetRegisterInfo() const
Serializable representation of the fixed stack object from the MachineFrameInfo class.
void print(const MachineBasicBlock &MBB)
static const char * getTargetIndexName(const MachineFunction &MF, int Index)
Target-dependent index+offset operand.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
bool isReg() const
isReg - Tests if this is a MO_Register operand.
const TargetRegisterClass * getRegClass(unsigned Reg) const
Return the register class of the specified virtual register.
Name of external global symbol.
const MachineFunctionProperties & getProperties() const
Get the function properties.
static void printCFIRegister(unsigned DwarfReg, raw_ostream &OS, const TargetRegisterInfo *TRI)
Reg
All possible values of the reg field in the ModR/M byte.
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
bool isFrameAddressTaken() const
This method may be called any time after instruction selection is complete to determine if there is a...
unsigned getNumOperands() const
Access to explicit operands of the instruction.
bool isVariableSizedObjectIndex(int ObjectIdx) const
Returns true if the specified index corresponds to a variable sized object.
unsigned getNumRegs() const
Return the number of registers this target has (useful for sizing arrays holding per register informa...
int getObjectIndexBegin() const
Return the minimum frame object index.
std::vector< VirtualRegisterDefinition > VirtualRegisters
Immediate >64bit operand.
static void normalizeProbabilities(ProbabilityIter Begin, ProbabilityIter End)
int getOffsetAdjustment() const
Return the correction for frame offsets.
void printAsOperand(raw_ostream &O, bool PrintType=true, const Module *M=nullptr) const
Print the name of this Value out to the specified raw_ostream.
bool HasMustTailInVarArgFunc
bool livein_empty() const
const MachineJumpTableInfo * getJumpTableInfo() const
getJumpTableInfo - Return the jump table info object for the current function.
const char * getRegClassName(const TargetRegisterClass *Class) const
Returns the name of the register class.
This class is a data container for one entry in a MachineConstantPool.
bool isImmutableObjectIndex(int ObjectIdx) const
Returns true if the specified index corresponds to an immutable object.
Expected< const typename ELFT::Sym * > getSymbol(typename ELFT::SymRange Symbols, uint32_t Index)
const BasicBlock * getBasicBlock() const
Return the LLVM basic block that this instance corresponded to originally.
int64_t getLocalFrameObjectCount() const
Return the number of objects allocated into the local object block.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
bool isSpillSlotObjectIndex(int ObjectIdx) const
Returns true if the specified index corresponds to a spill slot.
const MachineBasicBlock * getParent() const
format_object< Ts...> format(const char *Fmt, const Ts &...Vals)
These are helper functions used to produce formatted output.
TargetInstrInfo - Interface to description of machine instruction set.
std::pair< int, int64_t > getLocalFrameObjectMap(int i) const
Get the local offset mapping for a for an object.
iterator find(const_arg_type_t< KeyT > Val)
bool isEarlyClobber() const
const RegisterBank * getRegBankOrNull(unsigned Reg) const
Return the register bank of Reg, or null if Reg has not been assigned a register bank or has been ass...
unsigned findTiedOperandIdx(unsigned OpIdx) const
Given the index of a tied register operand, find the operand it is tied to.
bool hasStackMap() const
This method may be called any time after instruction selection is complete to determine if there is a...
Address of a global value.
const MCPhysReg * getCalleeSavedRegs() const
Returns list of callee saved registers.
Intrinsic::ID getIntrinsicID() const
unsigned getTargetFlags() const
MIRPrinter(raw_ostream &OS)
std::vector< FlowStringValue > Blocks
unsigned const MachineRegisterInfo * MRI
Serializable representation of stack object from the MachineFrameInfo class.
LLVM Basic Block Representation.
This is an important class for using LLVM in a threaded context.
bool isAliasedObjectIndex(int ObjectIdx) const
Returns true if the specified index corresponds to an object that might be pointed to by an LLVM IR v...
AAMDNodes getAAInfo() const
Return the AA tags for the memory reference.
static cl::opt< bool > SimplifyMIR("simplify-mir", cl::desc("Leave out unnecessary information when printing MIR"))
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
This is an important base class in LLVM.
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
static StringRef getPredicateName(Predicate P)
This file contains the declarations for the subclasses of Constant, which represent the different fla...
const MachineOperand & getOperand(unsigned i) const
MachineJumpTable JumpTableInfo
Constant pool.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
bool hasVAStart() const
Returns true if the function calls the llvm.va_start intrinsic.
bool isIntPredicate() const
bool tracksLiveness() const
tracksLiveness - Returns true when tracking register liveness accurately.
unsigned getNumExplicitOperands() const
Returns the number of non-implicit operands.
Address of a basic block.
virtual ArrayRef< const char * > getRegMaskNames() const =0
bool isVariadic(QueryType Type=IgnoreBundle) const
Return true if this instruction can have a variable number of operands.
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
bool getFlag(MIFlag Flag) const
Return whether an MI flag is set.
void convertStackObjects(yaml::MachineFunction &YMF, const MachineFunction &MF, ModuleSlotTracker &MST)
virtual ArrayRef< std::pair< unsigned, const char * > > getSerializableDirectMachineOperandTargetFlags() const
Return an array that contains the direct target flag values and their names.
const std::vector< MCCFIInstruction > & getFrameInstructions() const
Returns a reference to a list of cfi instructions in the function's prologue.
unsigned MaxCallFrameSize
~0u means: not computed yet.
This class prints out the machine instructions using the MIR serialization format.
StringValue StackProtector
std::vector< MachineStackObject > StackObjects
int64_t getOffset() const
Return the offset from the symbol in this operand.
self_iterator getIterator()
const PseudoSourceValue * getPseudoValue() const
MachineConstantPool * getConstantPool()
getConstantPool - Return the constant pool object for the current function.
static void printCustomRegMask(const uint32_t *RegMask, raw_ostream &OS, const TargetRegisterInfo *TRI)
Serializable representation of MachineFrameInfo.
static void printReg(unsigned Reg, raw_ostream &OS, const TargetRegisterInfo *TRI)
void printMIR(raw_ostream &OS, const Module &M)
Print LLVM IR using the MIR serialization format to the given output stream.
succ_iterator succ_begin()
void incorporateFunction(const Function &F)
Incorporate the given function.
unsigned getSubReg() const
The Output class is used to generate a yaml document from in-memory structs and vectors.
SyncScope::ID getSyncScopeID() const
Returns the synchronization scope ID for this memory operation.
int getLLVMRegNum(unsigned RegNum, bool isEH) const
Map a dwarf register back to a target register.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
virtual ArrayRef< std::pair< MachineMemOperand::Flags, const char * > > getSerializableMachineMemOperandTargetFlags() const
Return an array that contains the MMO target flag values and their names.
std::string & str()
Flushes the stream contents to the target string and returns the string's reference.
int getOperandConstraint(unsigned OpNum, MCOI::OperandConstraint Constraint) const
Returns the value of the specific constraint if it is set.
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.
TargetIntrinsicInfo - Interface to description of machine instruction set.
const char * getName() const
Get a user friendly name of this register bank.
void setWriteDefaultValues(bool Write)
Set whether or not to output optional values which are equal to the default value.
bool hasCalls() const
Return true if the current function has any function calls.
OpType getOperation() const
bool memoperands_empty() const
Return true if we don't have any memory operands which described the the memory access done by this i...
Synchronized with respect to all concurrently executing threads.
Iterator for intrusive lists based on ilist_node.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
bool isMaxCallFrameSizeComputed() const
bool isDereferenceable() const
const uint32_t * getRegMask() const
getRegMask - Returns a bit mask of registers preserved by this RegMask operand.
std::pair< unsigned, unsigned > decomposeMachineOperandsTargetFlags(unsigned TF) const override
Decompose the machine operand's target flags into two values - the direct target flag value and any o...
StringValue PreferredRegister
Generic predicate for ISel.
MachineOperand class - Representation of each machine instruction operand.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
unsigned getObjectAlignment(int ObjectIdx) const
Return the alignment of the specified stack object.
Module.h This file contains the declarations for the Module class.
MachineFrameInfo FrameInfo
void printIRBlockReference(const BasicBlock &BB)
unsigned getMaxCallFrameSize() const
Return the maximum size of a call frame that must be allocated for an outgoing function call...
void printLLVMNameWithoutPrefix(raw_ostream &OS, StringRef Name)
Print out a name of an LLVM value without any prefixes.
BasicBlock * getBasicBlock() const
livein_iterator livein_begin() const
unsigned getPredicate() const
void printSyncScope(const LLVMContext &Context, SyncScope::ID SSID)
virtual std::string getName(unsigned IID, Type **Tys=nullptr, unsigned numTys=0) const =0
Return the name of a target intrinsic, e.g.
MCSymbol reference (for debug/eh info)
bool HasOpaqueSPAdjustment
const ConstantInt * getCImm() const
static const char * toIRString(AtomicOrdering ao)
String used by LLVM IR to represent atomic ordering.
const Value * getValue() const
Return the base address of the memory access.
Special value supplied for machine level alias analysis.
const char * getSubRegIndexName(unsigned SubIdx) const
Return the human-readable symbolic target-specific name for the specified SubRegIndex.
A wrapper around std::string which contains a source range that's being set during parsing...
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
int getStackProtectorIndex() const
Return the index for the stack protector object.
llvm_unreachable("Unknown RegBank!")
bool isNonTemporal() const
void print(raw_ostream &OS, AssemblyAnnotationWriter *AAW, bool ShouldPreserveUseListOrder=false, bool IsForDebug=false) const
Print the module to an output stream with an optional AssemblyAnnotationWriter.
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
MachineBasicBlock * getSavePoint() const
static std::vector< std::string > Flags
bool hasSuccessorProbabilities() const
Return true if any of the successors have probabilities attached to them.
Representation of each machine instruction.
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
std::vector< MachineFunctionLiveIn > LiveIns
bool hasAddressTaken() const
Test whether this block is potentially the target of an indirect branch.
bool hasPatchPoint() const
This method may be called any time after instruction selection is complete to determine if there is a...
static void output(const Module &Mod, void *Ctxt, raw_ostream &OS)
const uint32_t * getRegLiveOut() const
getRegLiveOut - Returns a bit mask of live-out registers.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
This class should be specialized by type that requires custom conversion to/from a YAML literal block...
bool exposesReturnsTwice() const
exposesReturnsTwice - Returns true if the function calls setjmp or any other similar functions with a...
virtual const TargetIntrinsicInfo * getIntrinsicInfo() const
If intrinsic information is available, return it. If not, return null.
static bool hasComplexRegisterTies(const MachineInstr &MI)
Return true when an instruction has tied register that can't be determined by the instruction's descr...
std::vector< Entry > Entries
bool IsReturnAddressTaken
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
MCSymbol * getMCSymbol() const
std::vector< MachineConstantPoolValue > Constants
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
Abstract Stack Frame Index.
void printMBBReference(const MachineBasicBlock &MBB)
JTEntryKind getEntryKind() const
void convert(yaml::MachineFunction &MF, const MachineRegisterInfo &RegInfo, const TargetRegisterInfo *TRI)
This file defines passes to print out IR in various granularities.
unsigned getReg() const
getReg - Returns the register number.
void printOffset(int64_t Offset)
const TargetRegisterClass * getRegClassOrNull(unsigned Reg) const
Return the register class of Reg, or null if Reg has not been assigned a register class yet...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Function * getFunction() const
std::vector< FixedMachineStackObject > FixedStackObjects
A raw_ostream that writes to an std::string.
const MDNode * getRanges() const
Return the range tag for the memory reference.
virtual const TargetInstrInfo * getInstrInfo() const
Module * getParent()
Get the module that this global value is contained inside of...
LLVM Value Representation.
int64_t getOffset() const
For normal values, this is a byte offset added to the base address.
Floating-point immediate operand.
static LLVM_ATTRIBUTE_UNUSED Printable PrintLaneMask(LaneBitmask LaneMask)
Create Printable object to print LaneBitmasks on a raw_ostream.
void printIRValueReference(const Value &V)
const MCOperandInfo * OpInfo
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
void printStackObjectReference(int FrameIndex)
bool def_empty(unsigned RegNo) const
def_empty - Return true if there are no instructions defining the specified register (it may be live-...
uint64_t getSize() const
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...
bool hasOpaqueSPAdjustment() const
Returns true if the function contains opaque dynamic stack adjustments.
const char * getName(unsigned RegNo) const
Return the human-readable symbolic target-specific name for the specified physical register...
const std::vector< MachineConstantPoolEntry > & getConstants() const
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
StringRef - Represent a constant reference to a string, i.e.
const BlockAddress * getBlockAddress() const
Address of indexed Constant in Constant Pool.
int getObjectIndexEnd() const
Return one past the maximum frame object index.
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
AtomicOrdering getFailureOrdering() const
For cmpxchg atomic operations, return the atomic ordering requirements when store does not occur...
MachineJumpTableInfo::JTEntryKind Kind
void getSyncScopeNames(SmallVectorImpl< StringRef > &SSNs) const
getSyncScopeNames - Populates client supplied SmallVector with synchronization scope names registered...
MIPrinter(raw_ostream &OS, ModuleSlotTracker &MST, const DenseMap< const uint32_t *, unsigned > &RegisterMaskIds, const DenseMap< int, FrameIndexOperand > &StackObjectOperandMapping)
MCSymbol * getLabel() const
bool isUpdatedCSRsInitialized() const
Returns true if the updated CSR list was initialized and false otherwise.
const AllocaInst * getObjectAllocation(int ObjectIdx) const
Return the underlying Alloca of the specified stack object if it exists.
const Function * getCurrentFunction() const
void print(const MachineFunction &MF)
LLVM_NODISCARD std::string lower() const
int64_t getObjectSize(int ObjectIdx) const
Return the size of the specified object.
bool hasMustTailInVarArgFunc() const
Returns true if the function is variadic and contains a musttail call.
bool isInternalRead() const
Metadata reference (for debug info)
uint64_t getBaseAlignment() const
Return the minimum known alignment in bytes of the base address, without the offset.
unsigned getAlignment() const
Return alignment of the basic block.
bool is_contained(R &&Range, const E &Element)
Wrapper function around std::find to detect if an element exists in a container.