LLVM 20.0.0git
|
Representation of each machine instruction. More...
#include "llvm/CodeGen/MachineInstr.h"
Public Types | |
enum | CommentFlag { ReloadReuse = 0x1 , NoSchedComment = 0x2 , TAsmComments = 0x4 } |
Flags to specify different kinds of comments to output in assembly code. More... | |
enum | MIFlag { NoFlags = 0 , FrameSetup = 1 << 0 , FrameDestroy = 1 << 1 , BundledPred = 1 << 2 , BundledSucc = 1 << 3 , FmNoNans = 1 << 4 , FmNoInfs = 1 << 5 , FmNsz = 1 << 6 , FmArcp = 1 << 7 , FmContract = 1 << 8 , FmAfn = 1 << 9 , FmReassoc = 1 << 10 , NoUWrap = 1 << 11 , NoSWrap = 1 << 12 , IsExact = 1 << 13 , NoFPExcept = 1 << 14 , NoMerge = 1 << 15 , Unpredictable = 1 << 16 , NoConvergent = 1 << 17 , NonNeg = 1 << 18 , Disjoint = 1 << 19 , NoUSWrap = 1 << 20 , SameSign = 1 << 21 } |
enum | QueryType { IgnoreBundle , AnyInBundle , AllInBundle } |
API for querying MachineInstr properties. More... | |
enum | MICheckType { CheckDefs , CheckKillDead , IgnoreDefs , IgnoreVRegDefs } |
using | mmo_iterator = ArrayRef< MachineMemOperand * >::iterator |
using | mop_iterator = MachineOperand * |
iterator/begin/end - Iterate over all operands of a machine instruction. | |
using | const_mop_iterator = const MachineOperand * |
using | filtered_mop_iterator = filter_iterator< mop_iterator, bool(*)(const MachineOperand &)> |
using | filtered_const_mop_iterator = filter_iterator< const_mop_iterator, bool(*)(const MachineOperand &)> |
Public Member Functions | |
MachineInstr (const MachineInstr &)=delete | |
MachineInstr & | operator= (const MachineInstr &)=delete |
~MachineInstr ()=delete | |
const MachineBasicBlock * | getParent () const |
MachineBasicBlock * | getParent () |
void | moveBefore (MachineInstr *MovePos) |
Move the instruction before MovePos . | |
const MachineFunction * | getMF () const |
Return the function that contains the basic block that this instruction belongs to. | |
MachineFunction * | getMF () |
uint8_t | getAsmPrinterFlags () const |
Return the asm printer flags bitvector. | |
void | clearAsmPrinterFlags () |
Clear the AsmPrinter bitvector. | |
bool | getAsmPrinterFlag (CommentFlag Flag) const |
Return whether an AsmPrinter flag is set. | |
void | setAsmPrinterFlag (uint8_t Flag) |
Set a flag for the AsmPrinter. | |
void | clearAsmPrinterFlag (CommentFlag Flag) |
Clear specific AsmPrinter flags. | |
uint32_t | getFlags () const |
Return the MI flags bitvector. | |
bool | getFlag (MIFlag Flag) const |
Return whether an MI flag is set. | |
void | setFlag (MIFlag Flag) |
Set a MI flag. | |
void | setFlags (unsigned flags) |
void | clearFlag (MIFlag Flag) |
clearFlag - Clear a MI flag. | |
void | clearFlags (unsigned flags) |
bool | isInsideBundle () const |
Return true if MI is in a bundle (but not the first MI in a bundle). | |
bool | isBundled () const |
Return true if this instruction part of a bundle. | |
bool | isBundledWithPred () const |
Return true if this instruction is part of a bundle, and it is not the first instruction in the bundle. | |
bool | isBundledWithSucc () const |
Return true if this instruction is part of a bundle, and it is not the last instruction in the bundle. | |
void | bundleWithPred () |
Bundle this instruction with its predecessor. | |
void | bundleWithSucc () |
Bundle this instruction with its successor. | |
void | unbundleFromPred () |
Break bundle above this instruction. | |
void | unbundleFromSucc () |
Break bundle below this instruction. | |
const DebugLoc & | getDebugLoc () const |
Returns the debug location id of this MachineInstr. | |
const MachineOperand & | getDebugOffset () const |
Return the operand containing the offset to be used if this DBG_VALUE instruction is indirect; will be an invalid register if this value is not indirect, and an immediate with value 0 otherwise. | |
MachineOperand & | getDebugOffset () |
const MachineOperand & | getDebugVariableOp () const |
Return the operand for the debug variable referenced by this DBG_VALUE instruction. | |
MachineOperand & | getDebugVariableOp () |
const DILocalVariable * | getDebugVariable () const |
Return the debug variable referenced by this DBG_VALUE instruction. | |
const MachineOperand & | getDebugExpressionOp () const |
Return the operand for the complex address expression referenced by this DBG_VALUE instruction. | |
MachineOperand & | getDebugExpressionOp () |
const DIExpression * | getDebugExpression () const |
Return the complex address expression referenced by this DBG_VALUE instruction. | |
const DILabel * | getDebugLabel () const |
Return the debug label referenced by this DBG_LABEL instruction. | |
unsigned | getDebugInstrNum () |
Fetch the instruction number of this MachineInstr. | |
unsigned | getDebugInstrNum (MachineFunction &MF) |
Fetch instruction number of this MachineInstr – but before it's inserted into MF . | |
unsigned | peekDebugInstrNum () const |
Examine the instruction number of this MachineInstr. | |
void | setDebugInstrNum (unsigned Num) |
Set instruction number of this MachineInstr. | |
void | dropDebugNumber () |
Drop any variable location debugging information associated with this instruction. | |
const MDNode * | getLocCookieMD () const |
For inline asm, get the !srcloc metadata node if we have it, and decode the loc cookie from it. | |
void | emitInlineAsmError (const Twine &ErrMsg) const |
Emit an error referring to the source location of this instruction. | |
void | emitGenericError (const Twine &ErrMsg) const |
const MCInstrDesc & | getDesc () const |
Returns the target instruction descriptor of this MachineInstr. | |
unsigned | getOpcode () const |
Returns the opcode of this MachineInstr. | |
unsigned | getNumOperands () const |
Retuns the total number of operands. | |
unsigned | getNumDebugOperands () const |
Returns the total number of operands which are debug locations. | |
const MachineOperand & | getOperand (unsigned i) const |
MachineOperand & | getOperand (unsigned i) |
MachineOperand & | getDebugOperand (unsigned Index) |
const MachineOperand & | getDebugOperand (unsigned Index) const |
bool | hasDebugOperandForReg (Register Reg) const |
Returns whether this debug value has at least one debug operand with the register Reg . | |
iterator_range< filter_iterator< const MachineOperand *, std::function< bool(const MachineOperand &Op)> > > | getDebugOperandsForReg (Register Reg) const |
iterator_range< filter_iterator< MachineOperand *, std::function< bool(MachineOperand &Op)> > > | getDebugOperandsForReg (Register Reg) |
bool | isDebugOperand (const MachineOperand *Op) const |
unsigned | getDebugOperandIndex (const MachineOperand *Op) const |
unsigned | getNumDefs () const |
Returns the total number of definitions. | |
bool | hasImplicitDef () const |
Returns true if the instruction has implicit definition. | |
unsigned | getNumImplicitOperands () const |
Returns the implicit operands number. | |
bool | isOperandSubregIdx (unsigned OpIdx) const |
Return true if operand OpIdx is a subregister index. | |
unsigned | getNumExplicitOperands () const |
Returns the number of non-implicit operands. | |
unsigned | getNumExplicitDefs () const |
Returns the number of non-implicit definitions. | |
mop_iterator | operands_begin () |
mop_iterator | operands_end () |
const_mop_iterator | operands_begin () const |
const_mop_iterator | operands_end () const |
iterator_range< mop_iterator > | operands () |
iterator_range< const_mop_iterator > | operands () const |
iterator_range< mop_iterator > | explicit_operands () |
iterator_range< const_mop_iterator > | explicit_operands () const |
iterator_range< mop_iterator > | implicit_operands () |
iterator_range< const_mop_iterator > | implicit_operands () const |
iterator_range< mop_iterator > | debug_operands () |
Returns a range over all operands that are used to determine the variable location for this DBG_VALUE instruction. | |
iterator_range< const_mop_iterator > | debug_operands () const |
Returns a range over all operands that are used to determine the variable location for this DBG_VALUE instruction. | |
iterator_range< mop_iterator > | defs () |
Returns a range over all explicit operands that are register definitions. | |
iterator_range< const_mop_iterator > | defs () const |
Returns a range over all explicit operands that are register definitions. | |
iterator_range< mop_iterator > | uses () |
Returns a range that includes all operands which may be register uses. | |
iterator_range< const_mop_iterator > | uses () const |
Returns a range that includes all operands which may be register uses. | |
iterator_range< mop_iterator > | explicit_uses () |
iterator_range< const_mop_iterator > | explicit_uses () const |
iterator_range< filtered_mop_iterator > | all_defs () |
Returns an iterator range over all operands that are (explicit or implicit) register defs. | |
iterator_range< filtered_const_mop_iterator > | all_defs () const |
Returns an iterator range over all operands that are (explicit or implicit) register defs. | |
iterator_range< filtered_mop_iterator > | all_uses () |
Returns an iterator range over all operands that are (explicit or implicit) register uses. | |
iterator_range< filtered_const_mop_iterator > | all_uses () const |
Returns an iterator range over all operands that are (explicit or implicit) register uses. | |
unsigned | getOperandNo (const_mop_iterator I) const |
Returns the number of the operand iterator I points to. | |
ArrayRef< MachineMemOperand * > | memoperands () const |
Access to memory operands of the instruction. | |
mmo_iterator | memoperands_begin () const |
Access to memory operands of the instruction. | |
mmo_iterator | memoperands_end () const |
Access to memory operands of the instruction. | |
bool | memoperands_empty () const |
Return true if we don't have any memory operands which described the memory access done by this instruction. | |
bool | hasOneMemOperand () const |
Return true if this instruction has exactly one MachineMemOperand. | |
unsigned | getNumMemOperands () const |
Return the number of memory operands. | |
MCSymbol * | getPreInstrSymbol () const |
Helper to extract a pre-instruction symbol if one has been added. | |
MCSymbol * | getPostInstrSymbol () const |
Helper to extract a post-instruction symbol if one has been added. | |
MDNode * | getHeapAllocMarker () const |
Helper to extract a heap alloc marker if one has been added. | |
MDNode * | getPCSections () const |
Helper to extract PCSections metadata target sections. | |
MDNode * | getMMRAMetadata () const |
Helper to extract mmra.op metadata. | |
uint32_t | getCFIType () const |
Helper to extract a CFI type hash if one has been added. | |
bool | hasProperty (unsigned MCFlag, QueryType Type=AnyInBundle) const |
Return true if the instruction (or in the case of a bundle, the instructions inside the bundle) has the specified property. | |
bool | isPreISelOpcode (QueryType Type=IgnoreBundle) const |
Return true if this is an instruction that should go through the usual legalization steps. | |
bool | isVariadic (QueryType Type=IgnoreBundle) const |
Return true if this instruction can have a variable number of operands. | |
bool | hasOptionalDef (QueryType Type=IgnoreBundle) const |
Set if this instruction has an optional definition, e.g. | |
bool | isPseudo (QueryType Type=IgnoreBundle) const |
Return true if this is a pseudo instruction that doesn't correspond to a real machine instruction. | |
bool | isMetaInstruction (QueryType Type=IgnoreBundle) const |
Return true if this instruction doesn't produce any output in the form of executable instructions. | |
bool | isReturn (QueryType Type=AnyInBundle) const |
bool | isEHScopeReturn (QueryType Type=AnyInBundle) const |
Return true if this is an instruction that marks the end of an EH scope, i.e., a catchpad or a cleanuppad instruction. | |
bool | isCall (QueryType Type=AnyInBundle) const |
bool | isCandidateForCallSiteEntry (QueryType Type=IgnoreBundle) const |
Return true if this is a call instruction that may have an associated call site entry in the debug info. | |
bool | shouldUpdateCallSiteInfo () const |
Return true if copying, moving, or erasing this instruction requires updating Call Site Info (see copyCallSiteInfo, moveCallSiteInfo, eraseCallSiteInfo). | |
bool | isBarrier (QueryType Type=AnyInBundle) const |
Returns true if the specified instruction stops control flow from executing the instruction immediately following it. | |
bool | isTerminator (QueryType Type=AnyInBundle) const |
Returns true if this instruction part of the terminator for a basic block. | |
bool | isBranch (QueryType Type=AnyInBundle) const |
Returns true if this is a conditional, unconditional, or indirect branch. | |
bool | isIndirectBranch (QueryType Type=AnyInBundle) const |
Return true if this is an indirect branch, such as a branch through a register. | |
bool | isConditionalBranch (QueryType Type=AnyInBundle) const |
Return true if this is a branch which may fall through to the next instruction or may transfer control flow to some other block. | |
bool | isUnconditionalBranch (QueryType Type=AnyInBundle) const |
Return true if this is a branch which always transfers control flow to some other block. | |
bool | isPredicable (QueryType Type=AllInBundle) const |
Return true if this instruction has a predicate operand that controls execution. | |
bool | isCompare (QueryType Type=IgnoreBundle) const |
Return true if this instruction is a comparison. | |
bool | isMoveImmediate (QueryType Type=IgnoreBundle) const |
Return true if this instruction is a move immediate (including conditional moves) instruction. | |
bool | isMoveReg (QueryType Type=IgnoreBundle) const |
Return true if this instruction is a register move. | |
bool | isBitcast (QueryType Type=IgnoreBundle) const |
Return true if this instruction is a bitcast instruction. | |
bool | isSelect (QueryType Type=IgnoreBundle) const |
Return true if this instruction is a select instruction. | |
bool | isNotDuplicable (QueryType Type=AnyInBundle) const |
Return true if this instruction cannot be safely duplicated. | |
bool | isConvergent (QueryType Type=AnyInBundle) const |
Return true if this instruction is convergent. | |
bool | hasDelaySlot (QueryType Type=AnyInBundle) const |
Returns true if the specified instruction has a delay slot which must be filled by the code generator. | |
bool | canFoldAsLoad (QueryType Type=IgnoreBundle) const |
Return true for instructions that can be folded as memory operands in other instructions. | |
bool | isRegSequenceLike (QueryType Type=IgnoreBundle) const |
Return true if this instruction behaves the same way as the generic REG_SEQUENCE instructions. | |
bool | isExtractSubregLike (QueryType Type=IgnoreBundle) const |
Return true if this instruction behaves the same way as the generic EXTRACT_SUBREG instructions. | |
bool | isInsertSubregLike (QueryType Type=IgnoreBundle) const |
Return true if this instruction behaves the same way as the generic INSERT_SUBREG instructions. | |
bool | mayLoad (QueryType Type=AnyInBundle) const |
Return true if this instruction could possibly read memory. | |
bool | mayStore (QueryType Type=AnyInBundle) const |
Return true if this instruction could possibly modify memory. | |
bool | mayLoadOrStore (QueryType Type=AnyInBundle) const |
Return true if this instruction could possibly read or modify memory. | |
bool | mayRaiseFPException () const |
Return true if this instruction could possibly raise a floating-point exception. | |
bool | isCommutable (QueryType Type=IgnoreBundle) const |
Return true if this may be a 2- or 3-address instruction (of the form "X = op Y, Z, ..."), which produces the same result if Y and Z are exchanged. | |
bool | isConvertibleTo3Addr (QueryType Type=IgnoreBundle) const |
Return true if this is a 2-address instruction which can be changed into a 3-address instruction if needed. | |
bool | usesCustomInsertionHook (QueryType Type=IgnoreBundle) const |
Return true if this instruction requires custom insertion support when the DAG scheduler is inserting it into a machine basic block. | |
bool | hasPostISelHook (QueryType Type=IgnoreBundle) const |
Return true if this instruction requires adjustment after instruction selection by calling a target hook. | |
bool | isRematerializable (QueryType Type=AllInBundle) const |
Returns true if this instruction is a candidate for remat. | |
bool | isAsCheapAsAMove (QueryType Type=AllInBundle) const |
Returns true if this instruction has the same cost (or less) than a move instruction. | |
bool | hasExtraSrcRegAllocReq (QueryType Type=AnyInBundle) const |
Returns true if this instruction source operands have special register allocation requirements that are not captured by the operand register classes. | |
bool | hasExtraDefRegAllocReq (QueryType Type=AnyInBundle) const |
Returns true if this instruction def operands have special register allocation requirements that are not captured by the operand register classes. | |
bool | isIdenticalTo (const MachineInstr &Other, MICheckType Check=CheckDefs) const |
Return true if this instruction is identical to Other . | |
bool | isEquivalentDbgInstr (const MachineInstr &Other) const |
Returns true if this instruction is a debug instruction that represents an identical debug value to Other . | |
MachineInstr * | removeFromParent () |
Unlink 'this' from the containing basic block, and return it without deleting it. | |
MachineInstr * | removeFromBundle () |
Unlink this instruction from its basic block and return it without deleting it. | |
void | eraseFromParent () |
Unlink 'this' from the containing basic block and delete it. | |
void | eraseFromBundle () |
Unlink 'this' from its basic block and delete it. | |
bool | isEHLabel () const |
bool | isGCLabel () const |
bool | isAnnotationLabel () const |
bool | isLifetimeMarker () const |
bool | isLabel () const |
Returns true if the MachineInstr represents a label. | |
bool | isCFIInstruction () const |
bool | isPseudoProbe () const |
bool | isPosition () const |
bool | isNonListDebugValue () const |
bool | isDebugValueList () const |
bool | isDebugValue () const |
bool | isDebugLabel () const |
bool | isDebugRef () const |
bool | isDebugValueLike () const |
bool | isDebugPHI () const |
bool | isDebugInstr () const |
bool | isDebugOrPseudoInstr () const |
bool | isDebugOffsetImm () const |
bool | isIndirectDebugValue () const |
A DBG_VALUE is indirect iff the location operand is a register and the offset operand is an immediate. | |
bool | isDebugEntryValue () const |
A DBG_VALUE is an entry value iff its debug expression contains the DW_OP_LLVM_entry_value operation. | |
bool | isUndefDebugValue () const |
Return true if the instruction is a debug value which describes a part of a variable as unavailable. | |
bool | isJumpTableDebugInfo () const |
bool | isPHI () const |
bool | isKill () const |
bool | isImplicitDef () const |
bool | isInlineAsm () const |
bool | mayFoldInlineAsmRegOp (unsigned OpId) const |
Returns true if the register operand can be folded with a load or store into a frame index. | |
bool | isStackAligningInlineAsm () const |
InlineAsm::AsmDialect | getInlineAsmDialect () const |
bool | isInsertSubreg () const |
bool | isSubregToReg () const |
bool | isRegSequence () const |
bool | isBundle () const |
bool | isCopy () const |
bool | isFullCopy () const |
bool | isExtractSubreg () const |
bool | isFakeUse () const |
bool | isCopyLike () const |
Return true if the instruction behaves like a copy. | |
bool | isIdentityCopy () const |
Return true is the instruction is an identity copy. | |
bool | isTransient () const |
Return true if this is a transient instruction that is either very likely to be eliminated during register allocation (such as copy-like instructions), or if this instruction doesn't have an execution-time cost. | |
unsigned | getBundleSize () const |
Return the number of instructions inside the MI bundle, excluding the bundle header. | |
bool | readsRegister (Register Reg, const TargetRegisterInfo *TRI) const |
Return true if the MachineInstr reads the specified register. | |
bool | readsVirtualRegister (Register Reg) const |
Return true if the MachineInstr reads the specified virtual register. | |
std::pair< bool, bool > | readsWritesVirtualRegister (Register Reg, SmallVectorImpl< unsigned > *Ops=nullptr) const |
Return a pair of bools (reads, writes) indicating if this instruction reads or writes Reg. | |
bool | killsRegister (Register Reg, const TargetRegisterInfo *TRI) const |
Return true if the MachineInstr kills the specified register. | |
bool | definesRegister (Register Reg, const TargetRegisterInfo *TRI) const |
Return true if the MachineInstr fully defines the specified register. | |
bool | modifiesRegister (Register Reg, const TargetRegisterInfo *TRI) const |
Return true if the MachineInstr modifies (fully define or partially define) the specified register. | |
bool | registerDefIsDead (Register Reg, const TargetRegisterInfo *TRI) const |
Returns true if the register is dead in this machine instruction. | |
bool | hasRegisterImplicitUseOperand (Register Reg) const |
Returns true if the MachineInstr has an implicit-use operand of exactly the given register (not considering sub/super-registers). | |
int | findRegisterUseOperandIdx (Register Reg, const TargetRegisterInfo *TRI, bool isKill=false) const |
Returns the operand index that is a use of the specific register or -1 if it is not found. | |
MachineOperand * | findRegisterUseOperand (Register Reg, const TargetRegisterInfo *TRI, bool isKill=false) |
Wrapper for findRegisterUseOperandIdx, it returns a pointer to the MachineOperand rather than an index. | |
const MachineOperand * | findRegisterUseOperand (Register Reg, const TargetRegisterInfo *TRI, bool isKill=false) const |
int | findRegisterDefOperandIdx (Register Reg, const TargetRegisterInfo *TRI, bool isDead=false, bool Overlap=false) const |
Returns the operand index that is a def of the specified register or -1 if it is not found. | |
MachineOperand * | findRegisterDefOperand (Register Reg, const TargetRegisterInfo *TRI, bool isDead=false, bool Overlap=false) |
Wrapper for findRegisterDefOperandIdx, it returns a pointer to the MachineOperand rather than an index. | |
const MachineOperand * | findRegisterDefOperand (Register Reg, const TargetRegisterInfo *TRI, bool isDead=false, bool Overlap=false) const |
int | findFirstPredOperandIdx () const |
Find the index of the first operand in the operand list that is used to represent the predicate. | |
int | findInlineAsmFlagIdx (unsigned OpIdx, unsigned *GroupNo=nullptr) const |
Find the index of the flag word operand that corresponds to operand OpIdx on an inline asm instruction. | |
const TargetRegisterClass * | getRegClassConstraint (unsigned OpIdx, const TargetInstrInfo *TII, const TargetRegisterInfo *TRI) const |
Compute the static register class constraint for operand OpIdx. | |
const TargetRegisterClass * | getRegClassConstraintEffectForVReg (Register Reg, const TargetRegisterClass *CurRC, const TargetInstrInfo *TII, const TargetRegisterInfo *TRI, bool ExploreBundle=false) const |
Applies the constraints (def/use) implied by this MI on Reg to the given CurRC . | |
const TargetRegisterClass * | getRegClassConstraintEffect (unsigned OpIdx, const TargetRegisterClass *CurRC, const TargetInstrInfo *TII, const TargetRegisterInfo *TRI) const |
Applies the constraints (def/use) implied by the OpIdx operand to the given CurRC . | |
void | tieOperands (unsigned DefIdx, unsigned UseIdx) |
Add a tie between the register operands at DefIdx and UseIdx. | |
unsigned | findTiedOperandIdx (unsigned OpIdx) const |
Given the index of a tied register operand, find the operand it is tied to. | |
bool | isRegTiedToUseOperand (unsigned DefOpIdx, unsigned *UseOpIdx=nullptr) const |
Given the index of a register def operand, check if the register def is tied to a source operand, due to either two-address elimination or inline assembly constraints. | |
bool | isRegTiedToDefOperand (unsigned UseOpIdx, unsigned *DefOpIdx=nullptr) const |
Return true if the use operand of the specified index is tied to a def operand. | |
void | clearKillInfo () |
Clears kill flags on all operands. | |
void | substituteRegister (Register FromReg, Register ToReg, unsigned SubIdx, const TargetRegisterInfo &RegInfo) |
Replace all occurrences of FromReg with ToReg:SubIdx, properly composing subreg indices where necessary. | |
bool | addRegisterKilled (Register IncomingReg, const TargetRegisterInfo *RegInfo, bool AddIfNotFound=false) |
We have determined MI kills a register. | |
void | clearRegisterKills (Register Reg, const TargetRegisterInfo *RegInfo) |
Clear all kill flags affecting Reg. | |
bool | addRegisterDead (Register Reg, const TargetRegisterInfo *RegInfo, bool AddIfNotFound=false) |
We have determined MI defined a register without a use. | |
void | clearRegisterDeads (Register Reg) |
Clear all dead flags on operands defining register Reg . | |
void | setRegisterDefReadUndef (Register Reg, bool IsUndef=true) |
Mark all subregister defs of register Reg with the undef flag. | |
void | addRegisterDefined (Register Reg, const TargetRegisterInfo *RegInfo=nullptr) |
We have determined MI defines a register. | |
void | setPhysRegsDeadExcept (ArrayRef< Register > UsedRegs, const TargetRegisterInfo &TRI) |
Mark every physreg used by this instruction as dead except those in the UsedRegs list. | |
bool | isSafeToMove (bool &SawStore) const |
Return true if it is safe to move this instruction. | |
bool | wouldBeTriviallyDead () const |
Return true if this instruction would be trivially dead if all of its defined registers were dead. | |
bool | mayAlias (AAResults *AA, const MachineInstr &Other, bool UseTBAA) const |
Returns true if this instruction's memory access aliases the memory access of Other. | |
bool | hasOrderedMemoryRef () const |
Return true if this instruction may have an ordered or volatile memory reference, or if the information describing the memory reference is not available. | |
bool | isDereferenceableInvariantLoad () const |
Return true if this load instruction never traps and points to a memory location whose value doesn't change during the execution of this function. | |
Register | isConstantValuePHI () const |
If the specified instruction is a PHI that always merges together the same virtual register, return the register, otherwise return Register(). | |
bool | hasUnmodeledSideEffects () const |
Return true if this instruction has side effects that are not modeled by mayLoad / mayStore, etc. | |
bool | isLoadFoldBarrier () const |
Returns true if it is illegal to fold a load across this instruction. | |
bool | allDefsAreDead () const |
Return true if all the defs of this instruction are dead. | |
bool | allImplicitDefsAreDead () const |
Return true if all the implicit defs of this instruction are dead. | |
std::optional< LocationSize > | getSpillSize (const TargetInstrInfo *TII) const |
Return a valid size if the instruction is a spill instruction. | |
std::optional< LocationSize > | getFoldedSpillSize (const TargetInstrInfo *TII) const |
Return a valid size if the instruction is a folded spill instruction. | |
std::optional< LocationSize > | getRestoreSize (const TargetInstrInfo *TII) const |
Return a valid size if the instruction is a restore instruction. | |
std::optional< LocationSize > | getFoldedRestoreSize (const TargetInstrInfo *TII) const |
Return a valid size if the instruction is a folded restore instruction. | |
void | copyImplicitOps (MachineFunction &MF, const MachineInstr &MI) |
Copy implicit register operands from specified instruction to this instruction. | |
void | addOperand (MachineFunction &MF, const MachineOperand &Op) |
Add the specified operand to the instruction. | |
void | addOperand (const MachineOperand &Op) |
Add an operand without providing an MF reference. | |
void | insert (mop_iterator InsertBefore, ArrayRef< MachineOperand > Ops) |
Inserts Ops BEFORE It. Can untie/retie tied operands. | |
void | setDesc (const MCInstrDesc &TID) |
Replace the instruction descriptor (thus opcode) of the current instruction with a new one. | |
void | setDebugLoc (DebugLoc DL) |
Replace current source information with new such. | |
void | removeOperand (unsigned OpNo) |
Erase an operand from an instruction, leaving it with one fewer operand than it started with. | |
void | dropMemRefs (MachineFunction &MF) |
Clear this MachineInstr's memory reference descriptor list. | |
void | setMemRefs (MachineFunction &MF, ArrayRef< MachineMemOperand * > MemRefs) |
Assign this MachineInstr's memory reference descriptor list. | |
void | addMemOperand (MachineFunction &MF, MachineMemOperand *MO) |
Add a MachineMemOperand to the machine instruction. | |
void | cloneMemRefs (MachineFunction &MF, const MachineInstr &MI) |
Clone another MachineInstr's memory reference descriptor list and replace ours with it. | |
void | cloneMergedMemRefs (MachineFunction &MF, ArrayRef< const MachineInstr * > MIs) |
Clone the merge of multiple MachineInstrs' memory reference descriptors list and replace ours with it. | |
void | setPreInstrSymbol (MachineFunction &MF, MCSymbol *Symbol) |
Set a symbol that will be emitted just prior to the instruction itself. | |
void | setPostInstrSymbol (MachineFunction &MF, MCSymbol *Symbol) |
Set a symbol that will be emitted just after the instruction itself. | |
void | cloneInstrSymbols (MachineFunction &MF, const MachineInstr &MI) |
Clone another MachineInstr's pre- and post- instruction symbols and replace ours with it. | |
void | setHeapAllocMarker (MachineFunction &MF, MDNode *MD) |
Set a marker on instructions that denotes where we should create and emit heap alloc site labels. | |
void | setPCSections (MachineFunction &MF, MDNode *MD) |
void | setMMRAMetadata (MachineFunction &MF, MDNode *MMRAs) |
void | setCFIType (MachineFunction &MF, uint32_t Type) |
Set the CFI type for the instruction. | |
uint32_t | mergeFlagsWith (const MachineInstr &Other) const |
Return the MIFlags which represent both MachineInstrs. | |
void | copyIRFlags (const Instruction &I) |
Copy all flags to MachineInst MIFlags. | |
void | untieRegOperand (unsigned OpIdx) |
Break any tie involving OpIdx. | |
void | addImplicitDefUseOperands (MachineFunction &MF) |
Add all implicit def and use operands to this instruction. | |
void | collectDebugValues (SmallVectorImpl< MachineInstr * > &DbgValues) |
Scan instructions immediately following MI and collect any matching DBG_VALUEs. | |
void | changeDebugValuesDefReg (Register Reg) |
Find all DBG_VALUEs that point to the register def in this instruction and point them to Reg instead. | |
void | setDebugValueUndef () |
Sets all register debug operands in this debug value instruction to be undef. | |
std::tuple< Register, Register > | getFirst2Regs () const |
std::tuple< Register, Register, Register > | getFirst3Regs () const |
std::tuple< Register, Register, Register, Register > | getFirst4Regs () const |
std::tuple< Register, Register, Register, Register, Register > | getFirst5Regs () const |
std::tuple< LLT, LLT > | getFirst2LLTs () const |
std::tuple< LLT, LLT, LLT > | getFirst3LLTs () const |
std::tuple< LLT, LLT, LLT, LLT > | getFirst4LLTs () const |
std::tuple< LLT, LLT, LLT, LLT, LLT > | getFirst5LLTs () const |
std::tuple< Register, LLT, Register, LLT > | getFirst2RegLLTs () const |
std::tuple< Register, LLT, Register, LLT, Register, LLT > | getFirst3RegLLTs () const |
std::tuple< Register, LLT, Register, LLT, Register, LLT, Register, LLT > | getFirst4RegLLTs () const |
std::tuple< Register, LLT, Register, LLT, Register, LLT, Register, LLT, Register, LLT > | getFirst5RegLLTs () const |
LLT | getTypeToPrint (unsigned OpIdx, SmallBitVector &PrintedTypes, const MachineRegisterInfo &MRI) const |
Debugging supportDetermine the generic type to be printed (if needed) on uses and defs. | |
bool | hasComplexRegisterTies () const |
Return true when an instruction has tied register that can't be determined by the instruction's descriptor. | |
void | print (raw_ostream &OS, bool IsStandalone=true, bool SkipOpers=false, bool SkipDebugLoc=false, bool AddNewLine=true, const TargetInstrInfo *TII=nullptr) const |
Print this MI to OS . | |
void | print (raw_ostream &OS, ModuleSlotTracker &MST, bool IsStandalone=true, bool SkipOpers=false, bool SkipDebugLoc=false, bool AddNewLine=true, const TargetInstrInfo *TII=nullptr) const |
void | dump () const |
void | dumpr (const MachineRegisterInfo &MRI, unsigned MaxDepth=UINT_MAX) const |
Print on dbgs() the current instruction and the instructions defining its operands and so on until we reach MaxDepth . | |
Public Member Functions inherited from llvm::ilist_node_with_parent< MachineInstr, MachineBasicBlock, ilist_sentinel_tracking< true > > | |
MachineInstr * | getPrevNode () |
const MachineInstr * | getPrevNode () const |
Get the previous node, or nullptr for the list head. | |
MachineInstr * | getNextNode () |
Get the next node, or nullptr for the list tail. | |
const MachineInstr * | getNextNode () const |
Get the next node, or nullptr for the list tail. | |
Public Member Functions inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< T, Options... >::type > | |
self_iterator | getIterator () |
const_self_iterator | getIterator () const |
reverse_self_iterator | getReverseIterator () |
const_reverse_self_iterator | getReverseIterator () const |
bool | isSentinel () const |
Check whether this is the sentinel node. | |
Public Member Functions inherited from llvm::ilist_detail::node_parent_access< NodeTy, ParentTy > | |
const ParentTy * | getParent () const |
ParentTy * | getParent () |
void | setParent (ParentTy *Parent) |
Static Public Member Functions | |
template<typename Operand , typename Instruction > | |
static iterator_range< filter_iterator< Operand *, std::function< bool(Operand &Op)> > > | getDebugOperandsForReg (Instruction *MI, Register Reg) |
Returns a range of all of the operands that correspond to a debug use of Reg . | |
static uint32_t | copyFlagsFromInstruction (const Instruction &I) |
Friends | |
struct | ilist_traits< MachineInstr > |
struct | ilist_callback_traits< MachineBasicBlock > |
class | MachineFunction |
Representation of each machine instruction.
This class isn't a POD type, but it must have a trivial destructor. When a MachineFunction is deleted, all the contained MachineInstrs are deallocated without having their destructor called.
Definition at line 67 of file MachineInstr.h.
Definition at line 683 of file MachineInstr.h.
using llvm::MachineInstr::filtered_const_mop_iterator = filter_iterator<const_mop_iterator, bool (*)(const MachineOperand &)> |
Definition at line 757 of file MachineInstr.h.
using llvm::MachineInstr::filtered_mop_iterator = filter_iterator<mop_iterator, bool (*)(const MachineOperand &)> |
Definition at line 755 of file MachineInstr.h.
using llvm::MachineInstr::mmo_iterator = ArrayRef<MachineMemOperand *>::iterator |
Definition at line 71 of file MachineInstr.h.
iterator/begin/end - Iterate over all operands of a machine instruction.
Definition at line 682 of file MachineInstr.h.
Flags to specify different kinds of comments to output in assembly code.
These flags carry semantic information not otherwise easily derivable from the IR text.
Enumerator | |
---|---|
ReloadReuse | |
NoSchedComment | |
TAsmComments |
Definition at line 77 of file MachineInstr.h.
Enumerator | |
---|---|
CheckDefs | |
CheckKillDead | |
IgnoreDefs | |
IgnoreVRegDefs |
Definition at line 1277 of file MachineInstr.h.
Definition at line 83 of file MachineInstr.h.
API for querying MachineInstr properties.
They are the same as MCInstrDesc queries but they are bundle aware.
Enumerator | |
---|---|
IgnoreBundle | |
AnyInBundle | |
AllInBundle |
Definition at line 892 of file MachineInstr.h.
|
delete |
|
delete |
void MachineInstr::addImplicitDefUseOperands | ( | MachineFunction & | MF | ) |
Add all implicit def and use operands to this instruction.
Definition at line 88 of file MachineInstr.cpp.
References addOperand(), llvm::MachineOperand::CreateReg(), llvm::MCInstrDesc::implicit_defs(), and llvm::MCInstrDesc::implicit_uses().
Referenced by ExpandMOVImmSExti8().
void MachineInstr::addMemOperand | ( | MachineFunction & | MF, |
MachineMemOperand * | MO | ||
) |
Add a MachineMemOperand to the machine instruction.
This function should be used only occasionally. The setMemRefs function is the primary method for setting up a MachineInstr's MemRefs list.
Definition at line 381 of file MachineInstr.cpp.
References llvm::SmallVectorImpl< T >::append(), memoperands_begin(), memoperands_end(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and setMemRefs().
Referenced by llvm::TargetLoweringBase::emitPatchPoint(), foldInlineAsmMemOperand(), and llvm::TargetInstrInfo::foldMemoryOperand().
void MachineInstr::addOperand | ( | const MachineOperand & | Op | ) |
Add an operand without providing an MF reference.
This only works for instructions that are inserted in a basic block.
MachineInstrBuilder and the two-argument addOperand(MF, MO) should be preferred.
Definition at line 181 of file MachineInstr.cpp.
References addOperand(), assert(), llvm::MachineBasicBlock::getParent(), getParent(), and MBB.
void MachineInstr::addOperand | ( | MachineFunction & | MF, |
const MachineOperand & | Op | ||
) |
Add the specified operand to the instruction.
addOperand - Add the specified operand to the instruction.
If it is an implicit operand, it is added to the end of the operand list. If it is an explicit operand it is added at the end of the explicit operand list (before the first implicit operand).
MF must be the machine function that was used to allocate this instruction.
MachineInstrBuilder provides a more convenient interface for creating instructions and adding operands.
If it is an implicit operand, it is added to the end of the operand list. If it is an explicit operand it is added at the end of the explicit operand list (before the first implicit operand).
Definition at line 204 of file MachineInstr.cpp.
References addOperand(), llvm::MachineFunction::allocateOperandArray(), assert(), llvm::MachineFunction::deallocateOperandArray(), llvm::MCOI::EARLY_CLOBBER, getNumOperands(), llvm::MCInstrDesc::getOperandConstraint(), isDebugInstr(), isInlineAsm(), llvm::MachineOperand::isReg(), isReg(), llvm::MachineOperand::isUse(), moveOperands(), MRI, llvm::MachineOperand::setIsDebug(), llvm::MachineOperand::setIsEarlyClobber(), llvm::MCOI::TIED_TO, and tieOperands().
Referenced by addConstantsToTrack(), addImplicitDefUseOperands(), addOperand(), addRegisterDead(), addRegisterDefined(), addRegisterKilled(), llvm::X86InstrInfo::commuteInstructionImpl(), llvm::SIInstrInfo::convertToThreeAddress(), copyImplicitOps(), llvm::XCoreFrameLowering::emitEpilogue(), llvm::HexagonFrameLowering::emitPrologue(), expandSGPRCopy(), insert(), llvm::XtensaInstrInfo::insertIndirectBranch(), LowerCallResults(), llvm::SIInstrInfo::moveToVALUImpl(), llvm::PPCInstrInfo::promoteInstr32To64ForElimEXTSW(), and llvm::X86InstrInfo::replaceBranchWithTailCall().
bool MachineInstr::addRegisterDead | ( | Register | Reg, |
const TargetRegisterInfo * | RegInfo, | ||
bool | AddIfNotFound = false |
||
) |
We have determined MI defined a register without a use.
Look for the operand that defines it and mark it as IsDead. If AddIfNotFound is true, add a implicit operand if it's not found. Returns true if the operand exists / is added.
Definition at line 2101 of file MachineInstr.cpp.
References addOperand(), llvm::SmallVectorTemplateCommon< T, typename >::back(), llvm::MachineOperand::CreateReg(), llvm::SmallVectorBase< Size_T >::empty(), findInlineAsmFlagIdx(), getNumOperands(), getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isDead(), llvm::MachineOperand::isDef(), isInlineAsm(), llvm::Register::isPhysical(), llvm::MachineOperand::isReg(), llvm::MCRegisterInfo::isSubRegister(), llvm::MCRegisterInfo::isSuperRegister(), llvm::MCRegAliasIterator::isValid(), llvm::SmallVectorTemplateBase< T, bool >::pop_back(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), removeOperand(), and llvm::MachineOperand::setIsDead().
Referenced by llvm::Thumb1InstrInfo::copyPhysReg(), and llvm::SystemZInstrInfo::foldMemoryOperandImpl().
void MachineInstr::addRegisterDefined | ( | Register | Reg, |
const TargetRegisterInfo * | RegInfo = nullptr |
||
) |
We have determined MI defines a register.
Make sure there is an operand defining Reg.
Definition at line 2165 of file MachineInstr.cpp.
References addOperand(), all_defs(), llvm::MachineOperand::CreateReg(), findRegisterDefOperand(), llvm::MachineOperand::getReg(), and llvm::MachineOperand::getSubReg().
Referenced by llvm::ARMBaseInstrInfo::copyPhysReg(), llvm::SparcInstrInfo::copyPhysReg(), copyPhysSubRegs(), and setPhysRegsDeadExcept().
bool MachineInstr::addRegisterKilled | ( | Register | IncomingReg, |
const TargetRegisterInfo * | RegInfo, | ||
bool | AddIfNotFound = false |
||
) |
We have determined MI kills a register.
Look for the operand that uses it and mark it as IsKill. If AddIfNotFound is true, add a implicit operand if it's not found. Returns true if the operand exists / is added.
Definition at line 2022 of file MachineInstr.cpp.
References addOperand(), llvm::SmallVectorTemplateCommon< T, typename >::back(), llvm::MachineOperand::CreateReg(), llvm::SmallVectorBase< Size_T >::empty(), findInlineAsmFlagIdx(), getNumOperands(), getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isDebug(), isInlineAsm(), llvm::MachineOperand::isKill(), llvm::Register::isPhysical(), llvm::MachineOperand::isReg(), isRegTiedToDefOperand(), llvm::MCRegisterInfo::isSubRegister(), llvm::MCRegisterInfo::isSuperRegister(), llvm::MachineOperand::isUndef(), llvm::MachineOperand::isUse(), llvm::MCRegAliasIterator::isValid(), llvm::SmallVectorTemplateBase< T, bool >::pop_back(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), removeOperand(), and llvm::MachineOperand::setIsKill().
Referenced by llvm::ARMBaseInstrInfo::copyPhysReg(), llvm::SparcInstrInfo::copyPhysReg(), llvm::VEInstrInfo::copyPhysReg(), copyPhysSubRegs(), emitAlignedDPRCS2Restores(), emitAlignedDPRCS2Spills(), llvm::XCoreFrameLowering::emitPrologue(), and llvm::VEInstrInfo::expandPostRAPseudo().
|
inline |
Returns an iterator range over all operands that are (explicit or implicit) register defs.
Definition at line 762 of file MachineInstr.h.
References llvm::make_filter_range(), and operands().
Referenced by addRegisterDefined(), llvm::GCNDownwardRPTracker::advanceToNext(), clearRegisterDeads(), computeLiveOuts(), llvm::MachineFunction::salvageCopySSAImpl(), and setRegisterDefReadUndef().
|
inline |
Returns an iterator range over all operands that are (explicit or implicit) register defs.
Definition at line 766 of file MachineInstr.h.
References llvm::make_filter_range(), and operands().
|
inline |
Returns an iterator range over all operands that are (explicit or implicit) register uses.
Definition at line 772 of file MachineInstr.h.
References llvm::make_filter_range(), and uses().
Referenced by llvm::ScheduleDAGInstrs::addSchedBarrierDeps().
|
inline |
Returns an iterator range over all operands that are (explicit or implicit) register uses.
Definition at line 776 of file MachineInstr.h.
References llvm::make_filter_range(), and uses().
bool MachineInstr::allDefsAreDead | ( | ) | const |
Return true if all the defs of this instruction are dead.
allDefsAreDead - Return true if all the defs of this instruction are dead.
Definition at line 1575 of file MachineInstr.cpp.
References llvm::MachineOperand::isDead(), llvm::MachineOperand::isReg(), llvm::MachineOperand::isUse(), and operands().
bool MachineInstr::allImplicitDefsAreDead | ( | ) | const |
Return true if all the implicit defs of this instruction are dead.
Definition at line 1585 of file MachineInstr.cpp.
References implicit_operands(), llvm::MachineOperand::isDead(), llvm::MachineOperand::isReg(), and llvm::MachineOperand::isUse().
void MachineInstr::bundleWithPred | ( | ) |
Bundle this instruction with its predecessor.
This can be an unbundled instruction, or it can be the first instruction in a bundle.
Definition at line 828 of file MachineInstr.cpp.
References assert(), BundledPred, BundledSucc, llvm::ilist_node_impl< ilist_detail::compute_node_options< T, Options... >::type >::getIterator(), isBundledWithPred(), and setFlag().
Referenced by llvm::MachineFunction::cloneMachineInstrBundle().
void MachineInstr::bundleWithSucc | ( | ) |
Bundle this instruction with its successor.
This can be an unbundled instruction, or it can be the last instruction in a bundle.
Definition at line 837 of file MachineInstr.cpp.
References assert(), BundledPred, BundledSucc, llvm::ilist_node_impl< ilist_detail::compute_node_options< T, Options... >::type >::getIterator(), isBundledWithSucc(), and setFlag().
|
inline |
Return true for instructions that can be folded as memory operands in other instructions.
The most common use for this is instructions that are simple loads from memory that don't modify the loaded value in any way, but it can also be used for instructions that can be expressed as constant-pool loads, such as V_SETALLONES on x86, to allow them to be folded when it is beneficial. This should only be set on instructions that return a value in their only virtual register definition.
Definition at line 1088 of file MachineInstr.h.
References llvm::MCID::FoldableAsLoad, and hasProperty().
Referenced by llvm::TargetInstrInfo::foldMemoryOperand().
void MachineInstr::changeDebugValuesDefReg | ( | Register | Reg | ) |
Find all DBG_VALUEs that point to the register def in this instruction and point them to Reg
instead.
Definition at line 2432 of file MachineInstr.cpp.
References getOperand(), llvm::MachineOperand::getParent(), llvm::MachineOperand::getReg(), isReg(), MRI, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
|
inline |
Clear specific AsmPrinter flags.
Definition at line 385 of file MachineInstr.h.
References assert().
|
inline |
Clear the AsmPrinter bitvector.
Definition at line 368 of file MachineInstr.h.
|
inline |
clearFlag - Clear a MI flag.
Definition at line 419 of file MachineInstr.h.
References assert().
Referenced by llvm::TargetInstrInfo::reassociateOps(), unbundleFromPred(), and unbundleFromSucc().
|
inline |
Definition at line 425 of file MachineInstr.h.
References assert().
Referenced by llvm::GenericMachineInstr::dropPoisonGeneratingFlags().
void MachineInstr::clearKillInfo | ( | ) |
Clears kill flags on all operands.
clearKillInfo - Clears kill flags on all operands.
Definition at line 1271 of file MachineInstr.cpp.
References llvm::MachineOperand::isReg(), llvm::MachineOperand::isUse(), operands(), and llvm::MachineOperand::setIsKill().
Referenced by llvm::LanaiInstrInfo::optimizeSelect(), llvm::ARMBaseInstrInfo::optimizeSelect(), and llvm::RISCVInstrInfo::optimizeSelect().
void MachineInstr::clearRegisterDeads | ( | Register | Reg | ) |
Clear all dead flags on operands defining register Reg
.
Definition at line 2153 of file MachineInstr.cpp.
References all_defs(), llvm::MachineOperand::getReg(), and llvm::MachineOperand::setIsDead().
Referenced by llvm::PPCInstrInfo::optimizeCmpPostRA().
void MachineInstr::clearRegisterKills | ( | Register | Reg, |
const TargetRegisterInfo * | RegInfo | ||
) |
Clear all kill flags affecting Reg.
If RegInfo is provided, this includes all aliasing registers.
Definition at line 2088 of file MachineInstr.cpp.
References llvm::MachineOperand::getReg(), llvm::MachineOperand::isKill(), llvm::MachineOperand::isReg(), llvm::MachineOperand::isUse(), operands(), llvm::TargetRegisterInfo::regsOverlap(), and llvm::MachineOperand::setIsKill().
void MachineInstr::cloneInstrSymbols | ( | MachineFunction & | MF, |
const MachineInstr & | MI | ||
) |
Clone another MachineInstr's pre- and post- instruction symbols and replace ours with it.
Definition at line 545 of file MachineInstr.cpp.
References assert(), MI, setHeapAllocMarker(), setMMRAMetadata(), setPCSections(), setPostInstrSymbol(), and setPreInstrSymbol().
Referenced by llvm::TargetInstrInfo::foldMemoryOperand().
void MachineInstr::cloneMemRefs | ( | MachineFunction & | MF, |
const MachineInstr & | MI | ||
) |
Clone another MachineInstr's memory reference descriptor list and replace ours with it.
Note that *this
may be the incoming MI!
Prefer this API whenever possible as it can avoid allocations in common cases.
Definition at line 389 of file MachineInstr.cpp.
References assert(), getHeapAllocMarker(), getMMRAMetadata(), getPCSections(), getPostInstrSymbol(), getPreInstrSymbol(), MI, and setMemRefs().
Referenced by llvm::CombinerHelper::applyCombineIndexedLoadStore(), and cloneMergedMemRefs().
void MachineInstr::cloneMergedMemRefs | ( | MachineFunction & | MF, |
ArrayRef< const MachineInstr * > | MIs | ||
) |
Clone the merge of multiple MachineInstrs' memory reference descriptors list and replace ours with it.
Note that *this
may be one of the incoming MIs!
Prefer this API whenever possible as it can avoid allocations in common cases.
Definition at line 425 of file MachineInstr.cpp.
References llvm::SmallVectorImpl< T >::append(), assert(), cloneMemRefs(), dropMemRefs(), llvm::ArrayRef< T >::empty(), getMF(), hasIdenticalMMOs(), llvm::make_pointee_range(), memoperands(), memoperands_begin(), memoperands_empty(), memoperands_end(), MI, setMemRefs(), llvm::ArrayRef< T >::size(), and llvm::ArrayRef< T >::slice().
void MachineInstr::collectDebugValues | ( | SmallVectorImpl< MachineInstr * > & | DbgValues | ) |
Scan instructions immediately following MI and collect any matching DBG_VALUEs.
Definition at line 2416 of file MachineInstr.cpp.
References MI, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by emitSelectPseudo().
|
static |
void MachineInstr::copyImplicitOps | ( | MachineFunction & | MF, |
const MachineInstr & | MI | ||
) |
Copy implicit register operands from specified instruction to this instruction.
copyImplicitOps - Copy implicit register operands from specified instruction to this instruction.
Definition at line 1597 of file MachineInstr.cpp.
References addOperand(), llvm::drop_begin(), llvm::MachineOperand::isImplicit(), llvm::MachineOperand::isReg(), llvm::MachineOperand::isRegMask(), and MI.
void MachineInstr::copyIRFlags | ( | const Instruction & | I | ) |
Copy all flags to MachineInst MIFlags.
Definition at line 634 of file MachineInstr.cpp.
References copyFlagsFromInstruction(), and I.
|
inline |
Returns a range over all operands that are used to determine the variable location for this DBG_VALUE instruction.
Definition at line 713 of file MachineInstr.h.
References assert(), isDebugValueLike(), isNonListDebugValue(), llvm::make_range(), operands_begin(), and operands_end().
Referenced by llvm::buildDbgValueForSpill(), getDebugOperand(), getDebugOperandIndex(), getNumDebugOperands(), handleNewDebugValue(), hasDebugOperandForReg(), isDebugOperand(), isUndefDebugValue(), and setDebugValueUndef().
|
inline |
Returns a range over all operands that are used to determine the variable location for this DBG_VALUE instruction.
Definition at line 720 of file MachineInstr.h.
References assert(), isDebugValueLike(), isNonListDebugValue(), llvm::make_range(), operands_begin(), and operands_end().
|
inline |
Return true if the MachineInstr fully defines the specified register.
If TargetRegisterInfo is non-null, then it also checks if there is a def of a super-register. NOTE: It's ignoring subreg indices on virtual registers.
Definition at line 1521 of file MachineInstr.h.
References findRegisterDefOperandIdx(), Reg, and TRI.
Referenced by checkAndUpdateCCRKill(), checkAndUpdateCPSRKill(), checkCCKill(), llvm::SystemZInstrInfo::foldMemoryOperandImpl(), isCCSelectPair(), llvm::PPCInstrInfo::optimizeCmpPostRA(), and llvm::AArch64InstrInfo::optimizeCompareInstr().
|
inline |
Returns a range over all explicit operands that are register definitions.
Implicit definition are not included!
Definition at line 728 of file MachineInstr.h.
References getNumExplicitDefs(), llvm::make_range(), and operands_begin().
Referenced by findSingleRegDef(), getSalvageOpsForTrunc(), llvm::SPIRVGlobalRegistry::getSPIRVTypeID(), isSafeToMove(), LowerCallResults(), llvm::PeelSingleBlockLoop(), llvm::MipsInstrInfo::SafeInFPUDelaySlot(), and llvm::MipsInstrInfo::SafeInLoadDelaySlot().
|
inline |
Returns a range over all explicit operands that are register definitions.
Implicit definition are not included!
Definition at line 733 of file MachineInstr.h.
References getNumExplicitDefs(), llvm::make_range(), and operands_begin().
|
inline |
Drop any variable location debugging information associated with this instruction.
Use when an instruction is modified in such a way that it no longer defines the value it used to. Variable locations using that value will be dropped.
Definition at line 556 of file MachineInstr.h.
Referenced by llvm::X86InstrInfo::optimizeCompareInstr().
void MachineInstr::dropMemRefs | ( | MachineFunction & | MF | ) |
Clear this MachineInstr's memory reference descriptor list.
This resets the memrefs to their most conservative state. This should be used only as a last resort since it greatly pessimizes our knowledge of the memory access performed by the instruction.
Definition at line 360 of file MachineInstr.cpp.
References getCFIType(), getHeapAllocMarker(), getMMRAMetadata(), getPCSections(), getPostInstrSymbol(), getPreInstrSymbol(), and memoperands_empty().
Referenced by cloneMergedMemRefs(), and setMemRefs().
LLVM_DUMP_METHOD void MachineInstr::dump | ( | ) | const |
Definition at line 1647 of file MachineInstr.cpp.
References llvm::dbgs(), and print().
Referenced by llvm::PPCInstrInfo::combineRLWINM(), llvm::ScheduleDAGInstrs::dumpNode(), llvm::PPCInstrInfo::foldFrameOffset(), llvm::SMSchedule::insert(), moveAndTeeForMultiUse(), MoveVPNOTBeforeFirstUser(), llvm::PPCInstrInfo::optimizeCmpPostRA(), rematerializeCheapDef(), and updateOperandRegConstraints().
LLVM_DUMP_METHOD void MachineInstr::dumpr | ( | const MachineRegisterInfo & | MRI, |
unsigned | MaxDepth = UINT_MAX |
||
) | const |
Print on dbgs() the current instruction and the instructions defining its operands and so on until we reach MaxDepth
.
Definition at line 1677 of file MachineInstr.cpp.
Definition at line 2248 of file MachineInstr.cpp.
References llvm::LLVMContext::diagnose(), llvm::Function::getContext(), getDebugLoc(), llvm::MachineFunction::getFunction(), and getMF().
Emit an error referring to the source location of this instruction.
This should only be used for inline assembly that is somehow impossible to compile. Other errors should have been handled much earlier.
Definition at line 2237 of file MachineInstr.cpp.
References assert(), llvm::LLVMContext::diagnose(), llvm::Function::getContext(), llvm::MachineFunction::getFunction(), getLocCookieMD(), getMF(), llvm::MDNode::getOperand(), and isInlineAsm().
Referenced by llvm::RegAllocBase::getErrorAssignment().
void MachineInstr::eraseFromBundle | ( | ) |
Unlink 'this' from its basic block and delete it.
If the instruction is part of a bundle, the other instructions in the bundle remain bundled.
Definition at line 771 of file MachineInstr.cpp.
References assert(), llvm::MachineBasicBlock::erase_instr(), and getParent().
void MachineInstr::eraseFromParent | ( | ) |
Unlink 'this' from the containing basic block and delete it.
If this instruction is the header of a bundle, the whole bundle is erased. This function can not be used for instructions inside a bundle, use eraseFromBundle() to erase individual bundled instructions.
Definition at line 766 of file MachineInstr.cpp.
References assert(), llvm::MachineBasicBlock::erase(), and getParent().
Referenced by llvm::ARCInstrInfo::analyzeBranch(), llvm::MipsInstrInfo::analyzeBranch(), llvm::AArch64InstrInfo::analyzeBranch(), llvm::ARMBaseInstrInfo::analyzeBranch(), llvm::SparcInstrInfo::analyzeBranch(), llvm::VEInstrInfo::analyzeBranch(), llvm::CombinerHelper::applyBuildFnMO(), llvm::CombinerHelper::applyCombineDivRem(), llvm::CombinerHelper::applyCombineExtendingLoads(), llvm::CombinerHelper::applyCombineIndexedLoadStore(), llvm::CombinerHelper::applyExtendThroughPhis(), llvm::CombinerHelper::applySextInRegOfLoad(), llvm::CombinerHelper::applyShiftOfShiftedLogic(), llvm::LegalizerHelper::bitcastExtractSubvector(), llvm::LegalizerHelper::bitcastInsertSubvector(), CombineCVTAToLocal(), llvm::createLibcall(), llvm::createMemLibcall(), EmitLoweredCascadedSelect(), emitSelectPseudo(), llvm::M68kInstrInfo::ExpandMOVEM(), llvm::M68kInstrInfo::ExpandMOVSZX_RR(), llvm::M68kInstrInfo::ExpandMOVX_RR(), llvm::M68kInstrInfo::ExpandPUSH_POP(), llvm::PPCInstrInfo::foldFrameOffset(), foldVGPRCopyIntoRegSequence(), llvm::HexagonInstrInfo::genAllInsnTimingClasses(), llvm::MachineSSAUpdater::GetValueInMiddleOfBlock(), llvm::SystemZELFFrameLowering::inlineStackProbe(), llvm::SystemZXPLINKFrameLowering::inlineStackProbe(), LowerCallResults(), llvm::LegalizerHelper::lowerLoad(), llvm::LegalizerHelper::lowerStore(), llvm::CombinerHelper::matchCombineExtractedVectorLoad(), llvm::CombinerHelper::matchCombineLoadWithAndMask(), llvm::SIInstrInfo::moveFlatAddrToVGPR(), llvm::SIInstrInfo::moveToVALUImpl(), llvm::AArch64InstrInfo::optimizeCompareInstr(), llvm::SIInstrInfo::optimizeCompareInstr(), llvm::ARMBaseInstrInfo::optimizeCompareInstr(), llvm::LanaiInstrInfo::optimizeCompareInstr(), llvm::X86InstrInfo::optimizeCompareInstr(), llvm::PPCInstrInfo::optimizeCompareInstr(), llvm::LanaiInstrInfo::optimizeSelect(), llvm::ARMBaseInstrInfo::optimizeSelect(), llvm::RISCVInstrInfo::optimizeSelect(), llvm::LegalizerHelper::reduceLoadStoreWidth(), RemoveDeadAddBetweenLEAAndJT(), llvm::FastISel::selectPatchpoint(), and splitMBB().
|
inline |
Definition at line 697 of file MachineInstr.h.
References getNumExplicitOperands(), llvm::make_range(), and operands_begin().
Referenced by implicit_operands(), llvm::SIInstrInfo::moveToVALUImpl(), and llvm::TargetInstrInfo::reassociateOps().
|
inline |
Definition at line 701 of file MachineInstr.h.
References getNumExplicitOperands(), llvm::make_range(), and operands_begin().
|
inline |
Definition at line 746 of file MachineInstr.h.
References getNumExplicitDefs(), getNumExplicitOperands(), llvm::make_range(), and operands_begin().
|
inline |
Definition at line 750 of file MachineInstr.h.
References getNumExplicitDefs(), getNumExplicitOperands(), llvm::make_range(), and operands_begin().
int MachineInstr::findFirstPredOperandIdx | ( | ) | const |
Find the index of the first operand in the operand list that is used to represent the predicate.
findFirstPredOperandIdx() - Find the index of the first operand in the operand list that is used to represent the predicate.
It returns -1 if none is found.
Definition at line 1137 of file MachineInstr.cpp.
References getDesc(), getNumOperands(), llvm::MCInstrDesc::isPredicable(), and llvm::MCInstrDesc::operands().
Referenced by llvm::ARMBaseInstrInfo::commuteInstructionImpl().
Find the index of the flag word operand that corresponds to operand OpIdx on an inline asm instruction.
Returns -1 if getOperand(OpIdx) does not belong to an inline asm operand group.
If GroupNo is not NULL, it will receive the number of the operand group containing OpIdx.
Definition at line 879 of file MachineInstr.cpp.
References assert(), F, llvm::MachineOperand::getImm(), getNumOperands(), getOperand(), llvm::MachineOperand::isImm(), isInlineAsm(), and llvm::InlineAsm::MIOp_FirstOperand.
Referenced by addRegisterDead(), addRegisterKilled(), and getRegClassConstraint().
|
inline |
Wrapper for findRegisterDefOperandIdx, it returns a pointer to the MachineOperand rather than an index.
Definition at line 1577 of file MachineInstr.h.
References findRegisterDefOperandIdx(), getOperand(), Idx, isDead(), Reg, and TRI.
Referenced by addRegisterDefined(), findRegisterDefOperand(), llvm::SystemZInstrInfo::foldMemoryOperandImpl(), llvm::X86InstrInfo::hasReassociableOperands(), llvm::X86InstrInfo::optimizeCompareInstr(), llvm::X86InstrInfo::setSpecialOperandAttr(), and transferDeadCC().
|
inline |
Definition at line 1585 of file MachineInstr.h.
References findRegisterDefOperand(), isDead(), Reg, and TRI.
int MachineInstr::findRegisterDefOperandIdx | ( | Register | Reg, |
const TargetRegisterInfo * | TRI, | ||
bool | isDead = false , |
||
bool | Overlap = false |
||
) | const |
Returns the operand index that is a def of the specified register or -1 if it is not found.
findRegisterDefOperandIdx() - Returns the operand index that is a def of the specified register or -1 if it is not found.
If isDead is true, defs that are not dead are skipped. If Overlap is true, then it also looks for defs that merely overlap the specified register. If TargetRegisterInfo is non-null, then it also checks if there is a def of a super-register. This may also return a register mask operand when Overlap is true.
If isDead is true, defs that are not dead are skipped. If TargetRegisterInfo is non-null, then it also checks if there is a def of a super-register.
Definition at line 1108 of file MachineInstr.cpp.
References llvm::MachineOperand::clobbersPhysReg(), getNumOperands(), getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isDead(), isDead(), llvm::MachineOperand::isDef(), llvm::Register::isPhysical(), llvm::MachineOperand::isReg(), llvm::MachineOperand::isRegMask(), and TRI.
Referenced by canFoldIntoCSel(), definesRegister(), findRegisterDefOperand(), getMaddPatterns(), getMiscPatterns(), hasSameValue(), llvm::CombinerHelper::matchEqualDefs(), modifiesRegister(), llvm::SIInstrInfo::moveToVALUImpl(), llvm::AArch64InstrInfo::optimizeCompareInstr(), llvm::AArch64InstrInfo::optimizeCondBranch(), and registerDefIsDead().
|
inline |
Wrapper for findRegisterUseOperandIdx, it returns a pointer to the MachineOperand rather than an index.
Definition at line 1551 of file MachineInstr.h.
References findRegisterUseOperandIdx(), getOperand(), Idx, isKill(), Reg, and TRI.
Referenced by findRegisterUseOperand(), and llvm::CombinerHelper::matchFreezeOfSingleMaybePoisonOperand().
|
inline |
Definition at line 1558 of file MachineInstr.h.
References findRegisterUseOperand(), isKill(), Reg, and TRI.
int MachineInstr::findRegisterUseOperandIdx | ( | Register | Reg, |
const TargetRegisterInfo * | TRI, | ||
bool | isKill = false |
||
) | const |
Returns the operand index that is a use of the specific register or -1 if it is not found.
findRegisterUseOperandIdx() - Returns the MachineOperand that is a use of the specific register or -1 if it is not found.
It further tightens the search criteria to a use that kills the register if isKill is true.
Definition at line 1059 of file MachineInstr.cpp.
References getNumOperands(), getOperand(), llvm::MachineOperand::getReg(), isKill(), llvm::MachineOperand::isKill(), llvm::MachineOperand::isReg(), llvm::MachineOperand::isUse(), and TRI.
Referenced by findRegisterUseOperand(), killsRegister(), readsRegister(), and llvm::salvageDebugInfoForDbgValue().
Given the index of a tied register operand, find the operand it is tied to.
Defs are tied to uses and vice versa. Returns the index of the tied operand which must exist.
Definition at line 1194 of file MachineInstr.cpp.
References assert(), F, llvm::StatepointOpers::getFirstGCPtrIdx(), llvm::MachineOperand::getImm(), llvm::StackMaps::getNextMetaArgIdx(), getNumDefs(), getNumOperands(), getOpcode(), getOperand(), llvm::MachineOperand::isImm(), isInlineAsm(), llvm::MachineOperand::isReg(), isReg(), llvm::MachineOperand::isTied(), llvm::MachineOperand::isUse(), llvm_unreachable, llvm::InlineAsm::MIOp_FirstOperand, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorBase< Size_T >::size(), and TiedMax.
Referenced by hasComplexRegisterTies(), insert(), isRegTiedToDefOperand(), isRegTiedToUseOperand(), print(), and untieRegOperand().
|
inline |
Return whether an AsmPrinter flag is set.
Definition at line 371 of file MachineInstr.h.
References assert().
|
inline |
Return the asm printer flags bitvector.
Definition at line 365 of file MachineInstr.h.
unsigned MachineInstr::getBundleSize | ( | ) | const |
Return the number of instructions inside the MI bundle, excluding the bundle header.
Return the number of instructions inside the MI bundle, not counting the header instruction.
This is the number of instructions that MachineBasicBlock::iterator skips, 0 for unbundled instructions.
Definition at line 1036 of file MachineInstr.cpp.
References llvm::ilist_node_impl< ilist_detail::compute_node_options< T, Options... >::type >::getIterator(), I, and Size.
|
inline |
Helper to extract a CFI type hash if one has been added.
Definition at line 880 of file MachineInstr.h.
References Info.
Referenced by dropMemRefs(), isIdenticalTo(), print(), setCFIType(), setHeapAllocMarker(), setMemRefs(), setMMRAMetadata(), setPCSections(), setPostInstrSymbol(), and setPreInstrSymbol().
const DIExpression * MachineInstr::getDebugExpression | ( | ) | const |
Return the complex address expression referenced by this DBG_VALUE instruction.
Definition at line 941 of file MachineInstr.cpp.
References getDebugExpressionOp().
Referenced by handleNewDebugValue(), isDebugEntryValue(), isEquivalentDbgInstr(), and llvm::salvageDebugInfoForDbgValue().
MachineOperand & MachineInstr::getDebugExpressionOp | ( | ) |
Definition at line 935 of file MachineInstr.cpp.
References assert(), getOperand(), isDebugValueLike(), and isNonListDebugValue().
const MachineOperand & MachineInstr::getDebugExpressionOp | ( | ) | const |
Return the operand for the complex address expression referenced by this DBG_VALUE instruction.
Definition at line 929 of file MachineInstr.cpp.
References assert(), getOperand(), isDebugValueLike(), and isNonListDebugValue().
Referenced by getDebugExpression(), llvm::salvageDebugInfoForDbgValue(), and llvm::updateDbgValueForSpill().
unsigned MachineInstr::getDebugInstrNum | ( | ) |
Fetch the instruction number of this MachineInstr.
If it does not have one already, a new and unique number will be assigned.
Definition at line 2512 of file MachineInstr.cpp.
References llvm::MachineFunction::getNewDebugInstrNum(), llvm::MachineBasicBlock::getParent(), and getParent().
Referenced by llvm::InstrEmitter::EmitDbgInstrRef(), and llvm::MachineFunction::salvageCopySSAImpl().
unsigned MachineInstr::getDebugInstrNum | ( | MachineFunction & | MF | ) |
Fetch instruction number of this MachineInstr – but before it's inserted into MF
.
Needed for transformations that create an instruction but don't immediately insert them.
Definition at line 2518 of file MachineInstr.cpp.
References llvm::MachineFunction::getNewDebugInstrNum().
Return the debug label referenced by this DBG_LABEL instruction.
Definition at line 908 of file MachineInstr.cpp.
References assert(), getOperand(), and isDebugLabel().
Returns the debug location id of this MachineInstr.
Definition at line 499 of file MachineInstr.h.
Referenced by llvm::buildDbgValueForSpill(), llvm::WebAssemblyDebugValueManager::cloneSink(), CombineCVTAToLocal(), combineFPFusedMultiply(), llvm::constrainOperandRegClass(), llvm::ARCFrameLowering::eliminateCallFramePseudoInstr(), llvm::MSP430FrameLowering::eliminateCallFramePseudoInstr(), llvm::XCoreFrameLowering::eliminateCallFramePseudoInstr(), llvm::Thumb1FrameLowering::eliminateCallFramePseudoInstr(), emitGenericError(), llvm::DwarfDebug::emitInitialLocDirective(), llvm::AArch64InstrInfo::emitLdStWithAddr(), llvm::RISCVInstrInfo::emitLdStWithAddr(), expandLoadStackGuard(), expandMOV32r1(), llvm::M68kInstrInfo::ExpandMOVEM(), llvm::M68kInstrInfo::ExpandMOVI(), ExpandMOVImmSExti8(), llvm::M68kInstrInfo::ExpandMOVSZX_RM(), llvm::M68kInstrInfo::ExpandMOVSZX_RR(), llvm::M68kInstrInfo::ExpandMOVX_RR(), llvm::X86InstrInfo::expandPostRAPseudo(), llvm::M68kInstrInfo::ExpandPUSH_POP(), llvm::RegAllocBase::getErrorAssignment(), INITIALIZE_PASS(), llvm::SystemZELFFrameLowering::inlineStackProbe(), llvm::SystemZXPLINKFrameLowering::inlineStackProbe(), insertPHI(), isEquivalentDbgInstr(), isIdenticalTo(), llvm::SIInstrInfo::legalizeOperands(), llvm::SIInstrInfo::moveToVALUImpl(), print(), llvm::ARMBaseInstrInfo::reMaterialize(), llvm::X86InstrInfo::reMaterialize(), llvm::WebAssemblyDebugValueManager::sink(), splitEdge(), and splitMBB().
|
inline |
Definition at line 508 of file MachineInstr.h.
References assert(), getOperand(), and isNonListDebugValue().
|
inline |
Return the operand containing the offset to be used if this DBG_VALUE instruction is indirect; will be an invalid register if this value is not indirect, and an immediate with value 0 otherwise.
Definition at line 504 of file MachineInstr.h.
References assert(), getOperand(), and isNonListDebugValue().
Referenced by isDebugOffsetImm(), and llvm::updateDbgValueForSpill().
|
inline |
Definition at line 594 of file MachineInstr.h.
References assert(), debug_operands(), getNumDebugOperands(), and Index.
Referenced by isEquivalentDbgInstr(), and isIndirectDebugValue().
|
inline |
Definition at line 598 of file MachineInstr.h.
References assert(), debug_operands(), getNumDebugOperands(), and Index.
|
inline |
Definition at line 638 of file MachineInstr.h.
References llvm::adl_begin(), assert(), debug_operands(), and isDebugOperand().
|
inlinestatic |
Returns a range of all of the operands that correspond to a debug use of Reg
.
Definition at line 616 of file MachineInstr.h.
References llvm::make_filter_range(), MI, and Reg.
Referenced by attemptDebugCopyProp(), getDebugOperandsForReg(), and llvm::updateDbgValueForSpill().
|
inline |
Definition at line 629 of file MachineInstr.h.
References Reg.
|
inline |
Definition at line 623 of file MachineInstr.h.
References getDebugOperandsForReg(), and Reg.
const DILocalVariable * MachineInstr::getDebugVariable | ( | ) | const |
Return the debug variable referenced by this DBG_VALUE instruction.
Definition at line 925 of file MachineInstr.cpp.
References getDebugVariableOp().
Referenced by llvm::buildDbgValueForSpill(), isEquivalentDbgInstr(), and print().
MachineOperand & MachineInstr::getDebugVariableOp | ( | ) |
Definition at line 919 of file MachineInstr.cpp.
References assert(), getOperand(), isDebugValueLike(), and isNonListDebugValue().
const MachineOperand & MachineInstr::getDebugVariableOp | ( | ) | const |
Return the operand for the debug variable referenced by this DBG_VALUE instruction.
Definition at line 913 of file MachineInstr.cpp.
References assert(), getOperand(), isDebugValueLike(), and isNonListDebugValue().
Referenced by getDebugVariable(), and print().
|
inline |
Returns the target instruction descriptor of this MachineInstr.
Definition at line 572 of file MachineInstr.h.
Referenced by llvm::ScheduleDAGInstrs::addPhysRegDataDeps(), llvm::buildDbgValueForSpill(), llvm::HexagonPacketizerList::canPromoteToDotNew(), llvm::HexagonPacketizerList::canPromoteToNewValueStore(), llvm::ResourceManager::canReserveResources(), llvm::checkVOPDRegConstraints(), cloneInstr(), llvm::TargetSchedModel::computeOperandLatency(), findFirstPredOperandIdx(), llvm::X86InstrInfo::foldMemoryOperandImpl(), llvm::HexagonInstrInfo::genAllInsnTimingClasses(), llvm::X86InstrInfo::getAddrModeFromMemoryOp(), llvm::ARMHazardRecognizerFPMLx::getHazardType(), llvm::ScheduleDAG::getInstrDesc(), llvm::ARMBaseInstrInfo::getOperandLatency(), getRegClassConstraint(), getTargetMBB(), getTypeToPrint(), hasComplexRegisterTies(), hasProperty(), llvm::HexagonInstrInfo::isDependent(), oneUseDominatesOtherUses(), llvm::LanaiInstrInfo::optimizeSelect(), llvm::ARMBaseInstrInfo::optimizeSelect(), llvm::RISCVInstrInfo::optimizeSelect(), parseCondBranch(), llvm::ResourceManager::reserveResources(), tryChangeVGPRtoSGPRinCopy(), and updateOperandRegConstraints().
Definition at line 2524 of file MachineInstr.cpp.
References getOperand(), getReg(), and getType().
Definition at line 2551 of file MachineInstr.cpp.
References getOperand(), llvm::MachineOperand::getReg(), and getType().
Definition at line 1997 of file MachineInstr.h.
References getOperand(), and getReg().
Definition at line 2529 of file MachineInstr.cpp.
References getOperand(), getReg(), and getType().
Definition at line 2559 of file MachineInstr.cpp.
References getOperand(), llvm::MachineOperand::getReg(), and getType().
Definition at line 2001 of file MachineInstr.h.
References getOperand(), and getReg().
Definition at line 2535 of file MachineInstr.cpp.
References getOperand(), getReg(), and getType().
std::tuple< Register, LLT, Register, LLT, Register, LLT, Register, LLT > MachineInstr::getFirst4RegLLTs | ( | ) | const |
Definition at line 2569 of file MachineInstr.cpp.
References getOperand(), llvm::MachineOperand::getReg(), and getType().
|
inline |
Definition at line 2006 of file MachineInstr.h.
References getOperand(), and getReg().
Definition at line 2542 of file MachineInstr.cpp.
References getOperand(), getReg(), and getType().
std::tuple< Register, LLT, Register, LLT, Register, LLT, Register, LLT, Register, LLT > MachineInstr::getFirst5RegLLTs | ( | ) | const |
Definition at line 2581 of file MachineInstr.cpp.
References getOperand(), llvm::MachineOperand::getReg(), and getType().
|
inline |
Definition at line 2012 of file MachineInstr.h.
References getOperand(), and getReg().
Return whether an MI flag is set.
Definition at line 397 of file MachineInstr.h.
References assert().
Referenced by canCombineFPFusedMultiply(), getFNEGPatterns(), llvm::AArch64InstrInfo::isAssociativeAndCommutative(), llvm::PPCInstrInfo::isAssociativeAndCommutative(), llvm::RISCVInstrInfo::isAssociativeAndCommutative(), llvm::SystemZInstrInfo::isAssociativeAndCommutative(), llvm::X86InstrInfo::isAssociativeAndCommutative(), isBundledWithPred(), isBundledWithSucc(), isCombineInstrCandidateFP(), isConvergent(), isInsideBundle(), llvm::isKnownNeverNaN(), llvm::CombinerHelper::matchAddOverflow(), llvm::CombinerHelper::matchExtOfExt(), mayRaiseFPException(), llvm::PPCInstrInfo::optimizeCompareInstr(), print(), and transferMIFlag().
|
inline |
Return the MI flags bitvector.
Definition at line 392 of file MachineInstr.h.
Referenced by combineFPFusedMultiply(), llvm::AArch64InstrInfo::emitLdStWithAddr(), llvm::RISCVInstrInfo::emitLdStWithAddr(), llvm::AArch64InstrInfo::genAlternativeCodeSequence(), llvm::GenericMachineInstr::hasPoisonGeneratingFlags(), llvm::CombinerHelper::matchSubOfVScale(), mergeFlagsWith(), llvm::SIInstrInfo::moveToVALUImpl(), and llvm::TargetInstrInfo::reassociateOps().
std::optional< LocationSize > MachineInstr::getFoldedRestoreSize | ( | const TargetInstrInfo * | TII | ) | const |
Return a valid size if the instruction is a folded restore instruction.
Definition at line 2505 of file MachineInstr.cpp.
References getMF(), getSpillSlotSize(), llvm::HexagonInstrInfo::hasLoadFromStackSlot(), and TII.
std::optional< LocationSize > MachineInstr::getFoldedSpillSize | ( | const TargetInstrInfo * | TII | ) | const |
Return a valid size if the instruction is a folded spill instruction.
Definition at line 2486 of file MachineInstr.cpp.
References getMF(), getSpillSlotSize(), llvm::HexagonInstrInfo::hasStoreToStackSlot(), and TII.
|
inline |
Helper to extract a heap alloc marker if one has been added.
Definition at line 851 of file MachineInstr.h.
References Info.
Referenced by cloneMemRefs(), dropMemRefs(), print(), setCFIType(), setHeapAllocMarker(), setMemRefs(), setMMRAMetadata(), setPCSections(), setPostInstrSymbol(), and setPreInstrSymbol().
InlineAsm::AsmDialect MachineInstr::getInlineAsmDialect | ( | ) | const |
Definition at line 873 of file MachineInstr.cpp.
References assert(), llvm::InlineAsm::Extra_AsmDialect, llvm::MachineOperand::getImm(), getOperand(), isInlineAsm(), and llvm::InlineAsm::MIOp_ExtraInfo.
Referenced by print(), printAsmMRegister(), and printAsmVRegister().
For inline asm, get the !srcloc metadata node if we have it, and decode the loc cookie from it.
Definition at line 2222 of file MachineInstr.cpp.
References getNumOperands(), llvm::MDNode::getNumOperands(), getOperand(), and llvm::MDNode::getOperand().
Referenced by emitInlineAsmError().
|
inline |
Definition at line 359 of file MachineInstr.h.
References getMF().
const MachineFunction * MachineInstr::getMF | ( | ) | const |
Return the function that contains the basic block that this instruction belongs to.
Note: this is undefined behaviour if the instruction does not have a parent.
Definition at line 752 of file MachineInstr.cpp.
References llvm::MachineBasicBlock::getParent(), and getParent().
Referenced by attemptDebugCopyProp(), canCombineFPFusedMultiply(), llvm::AArch64InstrInfo::canFoldIntoAddrMode(), llvm::checkVOPDRegConstraints(), cloneMergedMemRefs(), collectCallSiteParameters(), combineFPFusedMultiply(), llvm::TargetSchedModel::computeOutputLatency(), emitGenericError(), emitInlineAsmError(), llvm::AArch64InstrInfo::emitLdStWithAddr(), llvm::GIMatchTableExecutor::executeMatchTable(), llvm::PPCInstrInfo::finalizeInsInstrs(), llvm::RISCVInstrInfo::finalizeInsInstrs(), foldInlineAsmMemOperand(), llvm::TargetInstrInfo::genAlternativeCodeSequence(), llvm::RISCVInstrInfo::genAlternativeCodeSequence(), genAlternativeDpCodeSequence(), genIndexedMultiply(), genShXAddAddShift(), getFoldedRestoreSize(), getFoldedSpillSize(), getMF(), getRegClassConstraint(), getRestoreSize(), getSpillSize(), llvm::RISCVInstrInfo::hasReassociableSibling(), interpretValues(), isCombinedImageSampler(), llvm::isKnownNeverNaN(), mayAlias(), llvm::SIInstrInfo::moveFlatAddrToVGPR(), performSink(), llvm::TargetInstrInfo::reassociateOps(), setDesc(), llvm::SIInstrInfo::shouldClusterMemOps(), llvm::stableHashValue(), and UpdatePredRedefs().
|
inline |
Helper to extract mmra.op metadata.
Definition at line 871 of file MachineInstr.h.
References Info.
Referenced by cloneMemRefs(), dropMemRefs(), print(), setCFIType(), setHeapAllocMarker(), setMemRefs(), setMMRAMetadata(), setPCSections(), setPostInstrSymbol(), and setPreInstrSymbol().
|
inline |
Returns the total number of operands which are debug locations.
Definition at line 581 of file MachineInstr.h.
References debug_operands().
Referenced by getDebugOperand(), and isEquivalentDbgInstr().
|
inline |
Returns the total number of definitions.
Definition at line 644 of file MachineInstr.h.
References getNumExplicitDefs(), and llvm::MCInstrDesc::implicit_defs().
Referenced by findTiedOperandIdx(), llvm::X86InstrInfo::hasReassociableOperands(), and llvm::MIPatternMatch::BinaryOpc_match< LHS_P, RHS_P, Commutable >::match().
unsigned MachineInstr::getNumExplicitDefs | ( | ) | const |
Returns the number of non-implicit definitions.
Definition at line 814 of file MachineInstr.cpp.
References llvm::MCInstrDesc::getNumDefs(), getNumOperands(), getOperand(), I, llvm::MachineOperand::isDef(), llvm::MachineOperand::isImplicit(), llvm::MachineOperand::isReg(), and llvm::MCInstrDesc::isVariadic().
Referenced by defs(), explicit_uses(), llvm::GIntrinsic::getIntrinsicID(), getNumDefs(), llvm::X86InstrInfo::hasReassociableOperands(), isConstReg(), and uses().
unsigned MachineInstr::getNumExplicitOperands | ( | ) | const |
Returns the number of non-implicit operands.
Definition at line 795 of file MachineInstr.cpp.
References getNumOperands(), llvm::MCInstrDesc::getNumOperands(), getOperand(), I, llvm::MachineOperand::isImplicit(), llvm::MachineOperand::isReg(), and llvm::MCInstrDesc::isVariadic().
Referenced by llvm::HexagonInstrInfo::analyzeBranch(), explicit_operands(), explicit_uses(), llvm::AArch64InstrInfo::getMemOpBaseRegImmOfsOffsetOperand(), llvm::PPCInstrInfo::getMemOperandWithOffsetWidth(), llvm::RISCVInstrInfo::getMemOperandWithOffsetWidth(), llvm::AArch64InstrInfo::getMemOperandWithOffsetWidth(), getNumImplicitOperands(), getTypeToPrint(), llvm::X86InstrInfo::hasReassociableOperands(), isLdStSafeToCluster(), and parseCondBranch().
|
inline |
Returns the implicit operands number.
Definition at line 657 of file MachineInstr.h.
References getNumExplicitOperands(), and getNumOperands().
|
inline |
Return the number of memory operands.
Definition at line 824 of file MachineInstr.h.
References memoperands().
Referenced by llvm::ARMBankConflictHazardRecognizer::getHazardType(), and mayAlias().
|
inline |
Retuns the total number of operands.
Definition at line 578 of file MachineInstr.h.
Referenced by addOperand(), addRegisterDead(), addRegisterKilled(), llvm::HexagonSubtarget::adjustSchedDependency(), allPhiOperandsUndefined(), llvm::X86InstrInfo::analyzeBranchPredicate(), llvm::HexagonInstrInfo::canExecuteInBundle(), cloneInstr(), llvm::SIInstrInfo::convertToThreeAddress(), llvm::TargetLoweringBase::emitPatchPoint(), llvm::LegalizerHelper::fewerElementsVectorUnmergeValues(), findFirstPredOperandIdx(), findInlineAsmFlagIdx(), findLoopComponents(), findRegisterDefOperandIdx(), findRegisterUseOperandIdx(), findTiedOperandIdx(), foldPatchpoint(), getLocCookieMD(), llvm::LanaiInstrInfo::getMemOperandWithOffsetWidth(), llvm::PatchPointOpers::getNextScratchIdx(), llvm::GUnmerge::getNumDefs(), getNumExplicitDefs(), getNumExplicitOperands(), getNumImplicitOperands(), llvm::GPhi::getNumIncomingValues(), llvm::GMergeLikeInstr::getNumSources(), getOperand(), llvm::PeelingModuloScheduleExpander::getPhiCanonicalReg(), hasComplexRegisterTies(), INITIALIZE_PASS(), insert(), interpretNextInstr(), isConstantValuePHI(), isIdenticalTo(), llvm::HexagonInstrInfo::isToBeScheduledASAP(), llvm::InlineAsmLowering::lowerInlineAsm(), llvm::SPIRV::make_descr_sampled_image(), llvm::MIPatternMatch::BinaryOp_match< LHS_P, RHS_P, Opcode, Commutable >::match(), llvm::MIPatternMatch::BinaryOpc_match< LHS_P, RHS_P, Commutable >::match(), llvm::MIPatternMatch::UnaryOp_match< SrcTy, Opcode >::match(), llvm::MIPatternMatch::TernaryOp_match< Src0Ty, Src1Ty, Src2Ty, Opcode >::match(), llvm::CombinerHelper::matchCombineInsertVecElts(), llvm::CombinerHelper::matchHoistLogicOpWithSameOpcodeHands(), llvm::SIInstrInfo::moveToVALUImpl(), llvm::LanaiInstrInfo::optimizeSelect(), llvm::ARMBaseInstrInfo::optimizeSelect(), print(), llvm::ARMBaseInstrInfo::produceSameValue(), readsWritesVirtualRegister(), removeOperand(), llvm::MachineFunction::substituteDebugValuesForInst(), llvm::LegalizationArtifactCombiner::tryCombineExtract(), updateOperandRegConstraints(), validateFunCallMachineDef(), and validatePtrUnwrapStructField().
|
inline |
Returns the opcode of this MachineInstr.
Definition at line 575 of file MachineInstr.h.
Referenced by AddAtomicFloatRequirements(), addConstantsToTrack(), AddDotProductRequirements(), addInstrRequirements(), addOpAccessChainReqs(), llvm::AArch64Subtarget::adjustSchedDependency(), llvm::R600InstrInfo::analyzeBranch(), llvm::HexagonInstrInfo::analyzeBranch(), llvm::NVPTXInstrInfo::analyzeBranch(), llvm::PPCInstrInfo::analyzeBranch(), llvm::XCoreInstrInfo::analyzeBranch(), llvm::MipsInstrInfo::analyzeBranch(), llvm::AArch64InstrInfo::analyzeBranch(), llvm::ARMBaseInstrInfo::analyzeBranch(), llvm::SparcInstrInfo::analyzeBranch(), llvm::VEInstrInfo::analyzeBranch(), llvm::AArch64InstrInfo::analyzeBranchPredicate(), llvm::X86InstrInfo::analyzeBranchPredicate(), llvm::AArch64InstrInfo::analyzeLoopForPipelining(), llvm::ARMBaseInstrInfo::analyzeLoopForPipelining(), llvm::CombinerHelper::applyCombineExtendingLoads(), llvm::CombinerHelper::applyCombineTruncOfShift(), llvm::CombinerHelper::applyCombineUnmergeZExtToZExt(), llvm::CombinerHelper::applyExtendThroughPhis(), llvm::AMDGPUCombinerHelper::applyFoldableFneg(), llvm::MipsRegisterBankInfo::applyMappingImpl(), llvm::CombinerHelper::applyShiftOfShiftedLogic(), areCandidatesToMergeOrPair(), areCombinableOperations(), BBIsJumpedOver(), bbIsJumpedOver(), llvm::buildAtomicCompareExchangeInst(), llvm::buildBoolRegister(), llvm::SPIRVGeneralDuplicatesTracker::buildDepsGraph(), llvm::buildEnqueueKernel(), llvm::buildNDRange(), buildSpirvTypeName(), llvm::ResourceManager::calculateResMII(), canCmpInstrBeRemoved(), canCompareBeNewValueJump(), canCreateUndefOrPoison(), canEmitConjunction(), llvm::AArch64InstrInfo::canFoldIntoAddrMode(), llvm::RISCVInstrInfo::canFoldIntoAddrMode(), canFoldIntoCSel(), canInstrSubstituteCmpInstr(), canRenameMOP(), llvm::checkVOPDRegConstraints(), combineFPFusedMultiply(), llvm::PPCInstrInfo::combineRLWINM(), llvm::ARMBasicBlockUtils::computeBlockSize(), computeNumSignBitsFromRangeMetadata(), llvm::HexagonInstrInfo::doesNotReturn(), llvm::SystemZHazardRecognizer::dumpSU(), llvm::ARCFrameLowering::eliminateCallFramePseudoInstr(), llvm::MSP430FrameLowering::eliminateCallFramePseudoInstr(), llvm::XCoreFrameLowering::eliminateCallFramePseudoInstr(), llvm::Thumb1FrameLowering::eliminateCallFramePseudoInstr(), llvm::HexagonRegisterInfo::eliminateFrameIndex(), llvm::SIRegisterInfo::eliminateFrameIndex(), llvm::AArch64InstrInfo::emitLdStWithAddr(), llvm::RISCVInstrInfo::emitLdStWithAddr(), llvm::HexagonFrameLowering::emitPrologue(), llvm::HexagonEvaluator::evaluate(), llvm::M68kInstrInfo::ExpandCCR(), ExpandMOVImmSExti8(), expandXorFP(), llvm::AArch64GISelUtils::extractPtrauthBlendDiscriminators(), llvm::PPCInstrInfo::finalizeInsInstrs(), llvm::RISCVInstrInfo::finalizeInsInstrs(), llvm::SPIRVTargetLowering::finalizeLowering(), findLoopComponents(), findRedundantFlagInstr(), findTiedOperandIdx(), foldConstantsIntoIntrinsics(), foldImm(), llvm::SystemZInstrInfo::foldMemoryOperandImpl(), llvm::X86InstrInfo::foldMemoryOperandImpl(), llvm::fuseInstructionPair(), llvm::HexagonInstrInfo::genAllInsnTimingClasses(), genAlternativeDpCodeSequence(), generateAssignInstrs(), llvm::generateDotOrFMulInst(), llvm::generateGroupInst(), llvm::generateICarryBorrowInst(), llvm::generateImageSizeQueryInst(), genIndexedMultiply(), genShXAddAddShift(), genSubAdd2SubSub(), getArrayComponentCount(), llvm::ARMAsmPrinter::getCodeViewJumpTableInfo(), llvm::HexagonInstrInfo::getCompoundOpcode(), llvm::getConstFromIntrinsic(), llvm::X86InstrInfo::getConstValDefinedInReg(), llvm::getDefInstrMaybeConstant(), llvm::getDefSrcRegIgnoringCopies(), getFMAPatterns(), llvm::PPCInstrInfo::getFMAPatterns(), getFMULPatterns(), getFNEGPatterns(), getFPFusedMultiplyPatterns(), llvm::ARMHazardRecognizerFPMLx::getHazardType(), llvm::AArch64RegisterBankInfo::getInstrMapping(), llvm::X86InstrInfo::getMachineCombinerPatterns(), getMaddPatterns(), llvm::SIInstrInfo::getMemOperandsWithOffsetWidth(), llvm::LanaiInstrInfo::getMemOperandsWithOffsetWidth(), llvm::RISCVInstrInfo::getMemOperandsWithOffsetWidth(), llvm::LanaiInstrInfo::getMemOperandWithOffsetWidth(), llvm::AArch64InstrInfo::getMemOperandWithOffsetWidth(), getMiscPatterns(), llvm::getNumSizeComponents(), llvm::getOpcodeDef(), llvm::SPIRVGlobalRegistry::getPointeeType(), llvm::SPIRVGlobalRegistry::getPointeeTypeOp(), llvm::RISCVInstrInfo::getReassociateOperandIndices(), llvm::TargetInstrInfo::getReassociationOpcodes(), llvm::SPIRVGlobalRegistry::getRegClass(), llvm::SPIRVGlobalRegistry::getRegType(), getSalvageOpsForTrunc(), llvm::GVecReduce::getScalarOpcForReduction(), llvm::SPIRVGlobalRegistry::getScalarOrVectorComponentType(), getSHXADDPatterns(), llvm::SPIRVGlobalRegistry::getSPIRVTypeID(), getTypeReg(), llvm::getVRegDef(), llvm::LiveIntervals::handleMoveIntoNewBundle(), hasAllNBitUsers(), llvm::RISCV::hasEqualFRM(), llvm::TargetInstrInfo::hasReassociableSibling(), llvm::RISCVInstrInfo::hasReassociableSibling(), llvm::GIntrinsic::hasSideEffects(), INITIALIZE_PASS(), llvm::SMSchedule::insert(), llvm::GAddSubCarryOut::isAdd(), isADDIInstr(), llvm::PPCInstrInfo::isADDIInstrEligibleForFolding(), llvm::PPCInstrInfo::isADDInstrEligibleForFolding(), isAddressLdStPair(), isAddSub2RegAndConstOnePair(), isAdrpAddPair(), isAESPair(), llvm::isAESPair(), isAnnotationLabel(), isArithmeticBccPair(), isArithmeticCbzPair(), isArithmeticLogicPair(), llvm::AArch64InstrInfo::isAssociativeAndCommutative(), llvm::PPCInstrInfo::isAssociativeAndCommutative(), llvm::RISCVInstrInfo::isAssociativeAndCommutative(), llvm::SystemZInstrInfo::isAssociativeAndCommutative(), llvm::X86InstrInfo::isAssociativeAndCommutative(), llvm::GIMatchTableExecutor::isBaseWithConstantOffset(), llvm::SPIRVGlobalRegistry::isBitcastCompatible(), isBundle(), isCacheInvOrWBInst(), isCandidateForCallSiteEntry(), isCCSelectPair(), isCFIInstruction(), llvm::AArch64GISelUtils::isCMN(), isCombinedImageSampler(), isCombineInstrCandidateFP(), isConstReg(), llvm::GIntrinsic::isConvergent(), isCopy(), isCryptoEORPair(), isCVTAToLocalCombinationCandidate(), isDebugLabel(), isDebugPHI(), isDebugRef(), isDebugValueList(), isEHLabel(), llvm::AArch64InstrInfo::isExtendLikelyToBeFolded(), isExtractHiElt(), isExtractSubreg(), isFakeUse(), isGCLabel(), isGuaranteedNotToBeUndefOrPoison(), isIdenticalTo(), isImageTypeWithUnknownFormat(), isImm(), isImplicitDef(), isInlineAsm(), isInputAttachment(), isInsertSubreg(), isJumpTableDebugInfo(), isKill(), llvm::isKnownNeverNaN(), llvm::HexagonPacketizerList::isLegalToPacketizeTogether(), isLifetimeMarker(), isLiteralsPair(), llvm::isLiteralsPair(), isNonFoldablePartialRegisterLoad(), isNonListDebugValue(), isPHI(), isPreLdStPairCandidate(), llvm::ARMBaseInstrInfo::isProfitableToIfCvt(), isPseudoProbe(), isRedundantFlagInstr(), isRegSequence(), llvm::VLIWResourceModel::isResourceAvailable(), isSafeToMove(), isSampledImage(), llvm::SPIRVGlobalRegistry::isScalarOrVectorOfType(), isSExtLoad(), llvm::GAddSubCarryOut::isSigned(), llvm::GAddCarryOut::isSigned(), llvm::GSubCarryOut::isSigned(), llvm::GSUCmp::isSigned(), isStorageImage(), isStorageTexelBuffer(), isSubregToReg(), llvm::HexagonInstrInfo::isToBeScheduledASAP(), isTransient(), isUniformTexelBuffer(), IsVPNOTEquivalent(), isWaitInstr(), isZExtLoad(), llvm::MipsCallLowering::lowerCall(), LowerCallResults(), llvm::LegalizerHelper::lowerLoad(), llvm::LegalizerHelper::lowerVECTOR_COMPRESS(), llvm::SPIRV::make_descr_sampled_image(), llvm::ARMOverrideBypasses::makeBundleAssumptions(), llvm::MIPatternMatch::BinaryOp_match< LHS_P, RHS_P, Opcode, Commutable >::match(), llvm::MIPatternMatch::BinaryOpc_match< LHS_P, RHS_P, Commutable >::match(), llvm::MIPatternMatch::UnaryOp_match< SrcTy, Opcode >::match(), llvm::MIPatternMatch::CompareOp_match< Pred_P, LHS_P, RHS_P, Opcode, Commutable >::match(), llvm::MIPatternMatch::TernaryOp_match< Src0Ty, Src1Ty, Src2Ty, Opcode >::match(), llvm::MIPatternMatch::ImplicitDefMatch::match(), llvm::CombinerHelper::matchCastOfBuildVector(), llvm::CombinerHelper::matchCastOfInteger(), llvm::CombinerHelper::matchCastOfSelect(), llvm::CombinerHelper::matchCombineFAddFMAFMulToFMadOrFMA(), llvm::CombinerHelper::matchCombineFAddFpExtFMulToFMadOrFMAAggressive(), llvm::CombinerHelper::matchCombineInsertVecElts(), llvm::CombinerHelper::matchCombineTruncOfShift(), llvm::CombinerHelper::matchCombineUnmergeConstant(), llvm::CombinerHelper::matchCommuteConstantToRHS(), llvm::CombinerHelper::matchExtendThroughPhis(), llvm::CombinerHelper::matchExtOfExt(), llvm::CombinerHelper::matchExtractVecEltBuildVec(), llvm::AMDGPUCombinerHelper::matchFoldableFneg(), llvm::CombinerHelper::matchHoistLogicOpWithSameOpcodeHands(), llvm::CombinerHelper::matchNarrowBinop(), llvm::CombinerHelper::matchNarrowBinopFeedingAnd(), llvm::CombinerHelper::matchOptBrCondByInvertingCond(), llvm::CombinerHelper::matchPtrAddImmedChain(), llvm::CombinerHelper::matchShiftImmedChain(), llvm::CombinerHelper::matchShiftOfShiftedLogic(), llvm::matchUnaryPredicate(), llvm::CombinerHelper::matchUseVectorTruncate(), mayOverlapWrite(), llvm::SIInstrInfo::moveFlatAddrToVGPR(), llvm::SIInstrInfo::moveToVALUImpl(), llvm::PPCInstrInfo::optimizeCmpPostRA(), llvm::AArch64InstrInfo::optimizeCompareInstr(), llvm::SIInstrInfo::optimizeCompareInstr(), llvm::ARMBaseInstrInfo::optimizeCompareInstr(), llvm::LanaiInstrInfo::optimizeCompareInstr(), llvm::X86InstrInfo::optimizeCompareInstr(), llvm::PPCInstrInfo::optimizeCompareInstr(), llvm::AArch64InstrInfo::optimizeCondBranch(), llvm::RISCVInstrInfo::optimizeSelect(), llvm::CallLowering::parametersInCSRMatch(), parseCondBranch(), print(), processBlockAddr(), processNewInstrs(), llvm::ARMBaseInstrInfo::produceSameValue(), propagateSPIRVType(), llvm::SIInstrInfo::reMaterialize(), llvm::ARMBaseInstrInfo::reMaterialize(), llvm::X86InstrInfo::reMaterialize(), llvm::VLIWResourceModel::reserveResources(), llvm::ARMBlockPlacement::revertWhileToDoLoop(), llvm::MipsInstrInfo::SafeInFPUDelaySlot(), llvm::salvageDebugInfoForDbgValue(), llvm::SIScheduleDAGMI::schedule(), llvm::AArch64InstrInfo::shouldClusterMemOps(), llvm::PPCInstrInfo::shouldClusterMemOps(), shouldScheduleVOPDAdjacent(), splitMBB(), tieOperands(), tryChangeVGPRtoSGPRinCopy(), llvm::LegalizationArtifactCombiner::tryCombineAnyExt(), llvm::LegalizationArtifactCombiner::tryCombineSExt(), llvm::LegalizationArtifactCombiner::tryFoldUnmergeCast(), llvm::CombinerHelper::tryReassocBinOp(), llvm::X86InstrInfo::unfoldMemoryOperand(), updateGetPCBundle(), validateAccessChain(), validateFunCallMachineDef(), validateGroupWaitEventsPtr(), validateLifetimeStart(), validatePtrTypes(), validatePtrUnwrapStructField(), valueIsKnownNeverF32Denorm(), verifyCFIntrinsic(), and wouldBeTriviallyDead().
|
inline |
Definition at line 589 of file MachineInstr.h.
References assert(), getNumOperands(), and Operands.
|
inline |
Definition at line 585 of file MachineInstr.h.
References assert(), getNumOperands(), and Operands.
Referenced by AddAtomicFloatRequirements(), AddDotProductRequirements(), addInstrRequirements(), addOpAccessChainReqs(), llvm::ScheduleDAGInstrs::addPhysRegDataDeps(), llvm::ScheduleDAGInstrs::addPhysRegDeps(), addRegisterDead(), addRegisterKilled(), llvm::SrcOp::addSrcToMIB(), llvm::AArch64Subtarget::adjustSchedDependency(), llvm::HexagonSubtarget::adjustSchedDependency(), allPhiOperandsUndefined(), llvm::R600InstrInfo::analyzeBranch(), llvm::HexagonInstrInfo::analyzeBranch(), llvm::NVPTXInstrInfo::analyzeBranch(), llvm::PPCInstrInfo::analyzeBranch(), llvm::XCoreInstrInfo::analyzeBranch(), llvm::MipsInstrInfo::analyzeBranch(), llvm::AArch64InstrInfo::analyzeBranch(), llvm::SparcInstrInfo::analyzeBranch(), llvm::VEInstrInfo::analyzeBranch(), llvm::AArch64InstrInfo::analyzeBranchPredicate(), llvm::X86InstrInfo::analyzeBranchPredicate(), llvm::AArch64InstrInfo::analyzeLoopForPipelining(), llvm::CombinerHelper::applyCombineDivRem(), llvm::CombinerHelper::applyCombineExtendingLoads(), llvm::CombinerHelper::applyCombineTruncOfShift(), llvm::CombinerHelper::applyCombineUnmergeZExtToZExt(), llvm::CombinerHelper::applyExtendThroughPhis(), llvm::AMDGPUCombinerHelper::applyFoldableFneg(), llvm::SwingSchedulerDAG::applyInstrChange(), llvm::CombinerHelper::applyOptBrCondByInvertingCond(), llvm::CombinerHelper::applyShiftOfShiftedLogic(), areCombinableOperations(), llvm::HexagonInstrInfo::areMemAccessesTriviallyDisjoint(), BBIsJumpedOver(), bbIsJumpedOver(), llvm::buildAtomicCompareExchangeInst(), llvm::buildBoolRegister(), llvm::SPIRVGeneralDuplicatesTracker::buildDepsGraph(), llvm::buildEnqueueKernel(), llvm::SPIRVGlobalRegistry::buildGlobalVariable(), llvm::buildNDRange(), buildRegSequence(), buildScratchExecCopy(), llvm::R600InstrInfo::buildSlotOfVectorInstruction(), buildSpirvTypeName(), canCombineShiftIntoShXAdd(), canCreateUndefOrPoison(), canEmitConjunction(), llvm::HexagonInstrInfo::canExecuteInBundle(), llvm::AArch64InstrInfo::canFoldIntoAddrMode(), llvm::RISCVInstrInfo::canFoldIntoAddrMode(), canFoldIntoCSel(), canInstrSubstituteCmpInstr(), canRenameMOP(), changeDebugValuesDefReg(), cloneInstr(), llvm::WebAssemblyDebugValueManager::cloneSink(), CombineCVTAToLocal(), combineFPFusedMultiply(), llvm::PPCInstrInfo::combineRLWINM(), llvm::X86InstrInfo::commuteInstructionImpl(), llvm::TargetInstrInfo::commuteInstructionImpl(), llvm::ARMBaseInstrInfo::commuteInstructionImpl(), llvm::TargetSchedModel::computeOperandLatency(), llvm::TargetSchedModel::computeOutputLatency(), ConsecutiveInstr(), llvm::SIInstrInfo::convertToThreeAddress(), llvm::ARMBaseInstrInfo::convertToThreeAddress(), llvm::R600InstrInfo::copyPhysReg(), createNewPtrType(), createPHIsForSelects(), llvm::ARCFrameLowering::eliminateCallFramePseudoInstr(), llvm::XCoreFrameLowering::eliminateCallFramePseudoInstr(), llvm::HexagonRegisterInfo::eliminateFrameIndex(), llvm::SITargetLowering::EmitInstrWithCustomInserter(), llvm::AArch64InstrInfo::emitLdStWithAddr(), llvm::RISCVInstrInfo::emitLdStWithAddr(), EmitLoweredCascadedSelect(), llvm::HexagonEvaluator::evaluate(), Expand2AddrUndef(), llvm::M68kInstrInfo::ExpandCCR(), llvm::M68kInstrInfo::ExpandMOVEM(), llvm::M68kInstrInfo::ExpandMOVI(), ExpandMOVImmSExti8(), llvm::M68kInstrInfo::ExpandMOVSZX_RM(), llvm::M68kInstrInfo::ExpandMOVSZX_RR(), llvm::M68kInstrInfo::ExpandMOVX_RR(), expandNOVLXLoad(), expandNOVLXStore(), llvm::SIInstrInfo::expandPostRAPseudo(), llvm::X86InstrInfo::expandPostRAPseudo(), llvm::M68kInstrInfo::ExpandPUSH_POP(), expandSHXDROT(), llvm::AArch64GISelUtils::extractPtrauthBlendDiscriminators(), llvm::PPCInstrInfo::finalizeInsInstrs(), llvm::RISCVInstrInfo::finalizeInsInstrs(), llvm::SPIRVTargetLowering::finalizeLowering(), findAssignTypeInstr(), findInlineAsmFlagIdx(), findLoopComponents(), findRedundantFlagInstr(), findRegisterDefOperand(), findRegisterDefOperandIdx(), findRegisterUseOperand(), findRegisterUseOperandIdx(), findTiedOperandIdx(), llvm::SwingSchedulerDAG::fixupRegisterOverlaps(), foldConstantsIntoIntrinsics(), llvm::PPCInstrInfo::foldFrameOffset(), foldImm(), foldInlineAsmMemOperand(), llvm::AArch64InstrInfo::foldMemoryOperandImpl(), llvm::SystemZInstrInfo::foldMemoryOperandImpl(), llvm::X86InstrInfo::foldMemoryOperandImpl(), foldVGPRCopyIntoRegSequence(), llvm::TargetInstrInfo::genAlternativeCodeSequence(), llvm::AArch64InstrInfo::genAlternativeCodeSequence(), llvm::RISCVInstrInfo::genAlternativeCodeSequence(), genAlternativeDpCodeSequence(), generateAssignInstrs(), llvm::generateCoopMatrInst(), llvm::generateImageMiscQueryInst(), llvm::generateImageSizeQueryInst(), genFNegatedMAD(), genFusedMultiply(), genIndexedMultiply(), genMaddR(), genNeg(), genShXAddAddShift(), genSubAdd2SubSub(), llvm::X86InstrInfo::getAddrModeFromMemoryOp(), getArrayComponentCount(), getAS(), llvm::GIndexedLoad::getBaseReg(), llvm::GIndexedStore::getBaseReg(), llvm::GInsertSubvector::getBigVec(), llvm::getBlockStructInstr(), llvm::HexagonInstrInfo::getBundleNoShuf(), llvm::ARMAsmPrinter::getCodeViewJumpTableInfo(), llvm::HexagonInstrInfo::getCompoundOpcode(), llvm::GAnyCmp::getCond(), llvm::getConstFromIntrinsic(), llvm::X86InstrInfo::getConstValDefinedInReg(), getDebugExpressionOp(), getDebugLabel(), getDebugOffset(), getDebugVariableOp(), llvm::getDefInstrMaybeConstant(), llvm::getDefSrcRegIgnoringCopies(), llvm::GIndexedLoad::getDstReg(), llvm::GAnyLoad::getDstReg(), llvm::GInsertVectorElement::getElementReg(), getFirst2LLTs(), getFirst2RegLLTs(), getFirst2Regs(), getFirst3LLTs(), getFirst3RegLLTs(), getFirst3Regs(), getFirst4LLTs(), getFirst4RegLLTs(), getFirst4Regs(), getFirst5LLTs(), getFirst5RegLLTs(), getFirst5Regs(), getFMAPatterns(), llvm::PPCInstrInfo::getFMAPatterns(), getFMULPatterns(), getFNEGPatterns(), getFPFusedMultiplyPatterns(), llvm::StatepointOpers::getGCPointerMap(), llvm::GPhi::getIncomingBlock(), llvm::GPhi::getIncomingValue(), llvm::GExtractSubvector::getIndexImm(), llvm::GInsertSubvector::getIndexImm(), llvm::GExtractVectorElement::getIndexReg(), llvm::GInsertVectorElement::getIndexReg(), getInlineAsmDialect(), llvm::GIntrinsic::getIntrinsicID(), llvm::GBinOpCarryOut::getLHS(), llvm::GBinOpCarryOut::getLHSReg(), llvm::GSUCmp::getLHSReg(), llvm::SrcOp::getLLTTy(), getLocCookieMD(), llvm::getMachineInstrType(), getMaddPatterns(), llvm::GShuffleVector::getMask(), llvm::AArch64InstrInfo::getMemOpBaseRegImmOfsOffsetOperand(), llvm::SIInstrInfo::getMemOperandsWithOffsetWidth(), llvm::LanaiInstrInfo::getMemOperandWithOffsetWidth(), llvm::PPCInstrInfo::getMemOperandWithOffsetWidth(), llvm::RISCVInstrInfo::getMemOperandWithOffsetWidth(), llvm::AArch64InstrInfo::getMemOperandWithOffsetWidth(), getMiscPatterns(), getNewSource(), llvm::PatchPointOpers::getNextScratchIdx(), getNumExplicitDefs(), getNumExplicitOperands(), llvm::getNumSizeComponents(), llvm::GIndexedLoad::getOffsetReg(), llvm::GIndexedStore::getOffsetReg(), llvm::SPIRVGlobalRegistry::getOrCreateConsIntVector(), llvm::SPIRVGlobalRegistry::getOrCreateConstIntArray(), llvm::SPIRVGlobalRegistry::getOrCreateConstVector(), llvm::SPIRVGlobalRegistry::getOrCreateOpTypeSampledImage(), llvm::PeelingModuloScheduleExpander::getPhiCanonicalReg(), llvm::SPIRVGlobalRegistry::getPointeeType(), llvm::GLoadStore::getPointerReg(), llvm::SSAUpdaterTraits< MachineSSAUpdater >::GetPoisonVal(), llvm::SrcOp::getReg(), llvm::GenericMachineInstr::getReg(), llvm::SPIRVGlobalRegistry::getRegClass(), getRegClassConstraint(), getRegClassConstraintEffect(), llvm::SPIRVGlobalRegistry::getRegType(), llvm::GBinOpCarryOut::getRHS(), llvm::GBinOpCarryOut::getRHSReg(), llvm::GSUCmp::getRHSReg(), getSalvageOpsForTrunc(), llvm::GSplatVector::getScalarReg(), llvm::GShl::getShiftReg(), getSHXADDPatterns(), getSingleUnwindDest(), llvm::GUnmerge::getSourceReg(), llvm::GFreeze::getSourceReg(), llvm::GVScale::getSrc(), llvm::GShuffleVector::getSrc1Reg(), llvm::GShuffleVector::getSrc2Reg(), llvm::GCastOp::getSrcReg(), llvm::GShl::getSrcReg(), llvm::GExtractSubvector::getSrcVec(), llvm::GStepVector::getStep(), llvm::GInsertSubvector::getSubVec(), getTargetMBB(), getTypeReg(), getTypeToPrint(), llvm::MachineSSAUpdater::GetValueInMiddleOfBlock(), llvm::GIndexedStore::getValueReg(), llvm::GStore::getValueReg(), llvm::GExtractVectorElement::getVectorReg(), llvm::GInsertVectorElement::getVectorReg(), llvm::getVRegDef(), llvm::GIndexedLoad::getWritebackReg(), llvm::GIndexedStore::getWritebackReg(), handleADRP(), hasAllNBitUsers(), hasComplexRegisterTies(), llvm::RISCV::hasEqualFRM(), hasMoreUses(), hasRAWHazard(), llvm::TargetInstrInfo::hasReassociableOperands(), llvm::RISCVInstrInfo::hasReassociableOperands(), llvm::TargetInstrInfo::hasReassociableSibling(), llvm::RISCVInstrInfo::hasReassociableSibling(), hasUnmodeledSideEffects(), INITIALIZE_PASS(), llvm::SystemZELFFrameLowering::inlineStackProbe(), insert(), llvm::R600InstrInfo::insertBranch(), llvm::SIInstrInfo::insertBranch(), insertDivByZeroTrap(), llvm::LoongArchInstrInfo::insertIndirectBranch(), insertPHI(), llvm::SIInstrInfo::insertScratchExecCopy(), llvm::PPCInstrInfo::isADDIInstrEligibleForFolding(), isAddressLdStPair(), isAddSub2RegAndConstOnePair(), isAGPRCopy(), isArithmeticBccPair(), llvm::GIMatchTableExecutor::isBaseWithConstantOffset(), llvm::AArch64GISelUtils::isCMN(), isCombinedImageSampler(), isConstantValuePHI(), isConstReg(), isConvergent(), isCVTAToLocalCombinationCandidate(), llvm::AArch64InstrInfo::isExtendLikelyToBeFolded(), isExtractHiElt(), isFullCopy(), isIdenticalTo(), isIdentityCopy(), isImageTypeWithUnknownFormat(), isImm(), isInputAttachment(), llvm::isKnownNeverNaN(), isLdStSafeToCluster(), llvm::HexagonPacketizerList::isLegalToPacketizeTogether(), isLiteralsPair(), isMatchingStartStopPair(), isNonFoldablePartialRegisterLoad(), isOperandSubregIdx(), llvm::GIndexedLoad::isPre(), llvm::GIndexedStore::isPre(), isRedundantFlagInstr(), isRegTiedToDefOperand(), isRegTiedToUseOperand(), isSampledImage(), llvm::SPIRVGlobalRegistry::isScalarOrVectorSigned(), isSignExtendedW(), llvm::PPCInstrInfo::isSignOrZeroExtended(), isStackAligningInlineAsm(), isStorageImage(), isStorageTexelBuffer(), llvm::HexagonInstrInfo::isToBeScheduledASAP(), isUniformTexelBuffer(), llvm::PPCInstrInfo::isValidToBeChangedReg(), IsVPNOTEquivalent(), isWaitInstr(), llvm::AArch64LegalizerInfo::legalizeIntrinsic(), llvm::AMDGPULegalizerInfo::legalizeIntrinsic(), llvm::X86InstrInfo::loadStoreTileReg(), llvm::MipsCallLowering::lowerCall(), llvm::X86CallLowering::lowerCall(), LowerCallResults(), llvm::SPIRVCallLowering::lowerFormalArguments(), llvm::AMDGPUCallLowering::lowerTailCall(), llvm::SPIRV::make_descr_sampled_image(), llvm::MIPatternMatch::BinaryOp_match< LHS_P, RHS_P, Opcode, Commutable >::match(), llvm::MIPatternMatch::BinaryOpc_match< LHS_P, RHS_P, Commutable >::match(), llvm::MIPatternMatch::UnaryOp_match< SrcTy, Opcode >::match(), llvm::MIPatternMatch::CompareOp_match< Pred_P, LHS_P, RHS_P, Opcode, Commutable >::match(), llvm::MIPatternMatch::TernaryOp_match< Src0Ty, Src1Ty, Src2Ty, Opcode >::match(), llvm::CombinerHelper::matchCombineExtractedVectorLoad(), llvm::CombinerHelper::matchCombineFAddFMAFMulToFMadOrFMA(), llvm::CombinerHelper::matchCombineFAddFpExtFMulToFMadOrFMA(), llvm::CombinerHelper::matchCombineFAddFpExtFMulToFMadOrFMAAggressive(), llvm::CombinerHelper::matchCombineFSubFNegFMulToFMadOrFMA(), llvm::CombinerHelper::matchCombineFSubFpExtFMulToFMadOrFMA(), llvm::CombinerHelper::matchCombineFSubFpExtFNegFMulToFMadOrFMA(), llvm::CombinerHelper::matchCombineInsertVecElts(), llvm::CombinerHelper::matchCombineTruncOfShift(), llvm::CombinerHelper::matchCombineUnmergeConstant(), llvm::CombinerHelper::matchExtractVecEltBuildVec(), llvm::AMDGPUCombinerHelper::matchFoldableFneg(), llvm::CombinerHelper::matchHoistLogicOpWithSameOpcodeHands(), llvm::CombinerHelper::matchNarrowBinopFeedingAnd(), llvm::CombinerHelper::matchOptBrCondByInvertingCond(), llvm::CombinerHelper::matchPtrAddImmedChain(), llvm::CombinerHelper::matchShiftImmedChain(), llvm::CombinerHelper::matchShiftOfShiftedLogic(), llvm::matchUnaryPredicate(), llvm::CombinerHelper::matchUnmergeValuesAnyExtBuildVector(), mayFoldInlineAsmRegOp(), mayLoad(), mayStore(), llvm::SIInstrInfo::moveFlatAddrToVGPR(), llvm::PeelingModuloScheduleExpander::moveStageBetweenBlocks(), llvm::SIInstrInfo::moveToVALUImpl(), MoveVPNOTBeforeFirstUser(), oneUseDominatesOtherUses(), llvm::PPCInstrInfo::optimizeCmpPostRA(), llvm::AArch64InstrInfo::optimizeCompareInstr(), llvm::ARMBaseInstrInfo::optimizeCompareInstr(), llvm::LanaiInstrInfo::optimizeCompareInstr(), llvm::X86InstrInfo::optimizeCompareInstr(), llvm::PPCInstrInfo::optimizeCompareInstr(), llvm::AArch64InstrInfo::optimizeCondBranch(), llvm::LanaiInstrInfo::optimizeSelect(), llvm::ARMBaseInstrInfo::optimizeSelect(), llvm::RISCVInstrInfo::optimizeSelect(), llvm::CallLowering::parametersInCSRMatch(), parseCondBranch(), llvm::PeelSingleBlockLoop(), print(), processBlockAddr(), processNewInstrs(), processSwitchesConstants(), llvm::ARMBaseInstrInfo::produceSameValue(), readsWritesVirtualRegister(), llvm::SGPRSpillBuilder::readWriteTmpVGPR(), llvm::TargetInstrInfo::reassociateOps(), reinsertVectorIndexAdd(), llvm::SIInstrInfo::reMaterialize(), llvm::ARMBaseInstrInfo::reMaterialize(), llvm::X86InstrInfo::reMaterialize(), removeCopies(), RemoveDeadAddBetweenLEAAndJT(), llvm::X86FrameLowering::restoreWin32EHStackPointers(), llvm::RevertLoopDec(), llvm::ARMBlockPlacement::revertWhileToDoLoop(), llvm::MachineSSAUpdater::RewriteUse(), llvm::SelectionDAGISel::runOnMachineFunction(), llvm::salvageDebugInfoForDbgValue(), llvm::AArch64InstrInfo::shouldClusterMemOps(), splitBlock(), splitEdge(), splitMBB(), llvm::MachineFunction::substituteDebugValuesForInst(), substituteSimpleCopyRegs(), tieOperands(), llvm::LegalizationArtifactCombiner::tryCombineExtract(), llvm::LegalizationArtifactCombiner::tryFoldUnmergeCast(), llvm::CombinerHelper::tryReassocBinOp(), llvm::X86InstrInfo::unfoldMemoryOperand(), untieRegOperand(), llvm::HexagonPacketizerList::updateOffset(), updateOperandRegConstraints(), updatePhysDepsDownwards(), llvm::WebAssemblyDebugValueManager::updateReg(), validateAccessChain(), validateFunCall(), validateFunCallMachineDef(), validateGroupWaitEventsPtr(), validateLifetimeStart(), validatePtrTypes(), validatePtrUnwrapStructField(), valueIsKnownNeverF32Denorm(), and verifyCFIntrinsic().
|
inline |
Returns the number of the operand iterator I
points to.
Definition at line 781 of file MachineInstr.h.
References I, and operands_begin().
Referenced by llvm::MachineOperand::getOperandNo(), and insert().
|
inline |
Definition at line 348 of file MachineInstr.h.
|
inline |
Definition at line 347 of file MachineInstr.h.
Referenced by addOperand(), llvm::LiveIntervals::addSegmentToEndOfBlock(), llvm::GCNSubtarget::adjustSchedDependency(), BlockSplitInfo::allInstrsInSameMBB(), analyzeCompressibleUses(), canCombineFPFusedMultiply(), llvm::checkVOPDRegConstraints(), llvm::WebAssemblyDebugValueManager::cloneSink(), collectCallSiteParameters(), CombineCVTAToLocal(), llvm::constrainOperandRegClass(), llvm::AArch64InstrInfo::emitLdStWithAddr(), llvm::RISCVInstrInfo::emitLdStWithAddr(), llvm::DebugHandlerBase::endInstruction(), eraseFromBundle(), eraseFromParent(), llvm::examineCFlagsUse(), expandLoadStackGuard(), expandMOV32r1(), llvm::M68kInstrInfo::ExpandMOVEM(), llvm::M68kInstrInfo::ExpandMOVI(), ExpandMOVImmSExti8(), llvm::M68kInstrInfo::ExpandMOVSZX_RM(), llvm::M68kInstrInfo::ExpandMOVSZX_RR(), llvm::X86InstrInfo::expandPostRAPseudo(), llvm::M68kInstrInfo::ExpandPUSH_POP(), expandXorFP(), llvm::findCMPToFoldIntoCBZ(), findPrologueEndLoc(), findRedundantFlagInstr(), findRenameRegForSameLdStRegPair(), findSingleRegUse(), llvm::ARMBlockPlacement::fixBackwardsWLS(), llvm::SIInstrInfo::foldImmediate(), llvm::SystemZInstrInfo::foldMemoryOperandImpl(), llvm::TargetInstrInfo::genAlternativeCodeSequence(), llvm::AArch64InstrInfo::genAlternativeCodeSequence(), llvm::rdf::Liveness::getAllReachingDefs(), getDebugInstrNum(), getFMAPatterns(), llvm::PPCInstrInfo::getFMAPatterns(), getFMULPatterns(), getFNEGPatterns(), getFoldableImm(), llvm::ARMHazardRecognizerFPMLx::getHazardType(), getLoadStoreOffsetSizeInBits(), getMaddPatterns(), getMF(), getMiscPatterns(), llvm::PPCInstrInfo::getOperandLatency(), llvm::PeelingModuloScheduleExpander::getPhiCanonicalReg(), getRegClassConstraint(), getSHXADDPatterns(), GetSymbolRef(), handleADRP(), llvm::LiveVariables::HandleVirtRegUse(), hasAllNBitUsers(), llvm::TargetInstrInfo::hasReassociableOperands(), llvm::RISCVInstrInfo::hasReassociableOperands(), llvm::TargetInstrInfo::hasReassociableSibling(), hoistAndMergeSGPRInits(), INITIALIZE_PASS(), insertPHI(), llvm::AArch64InstrInfo::isAssociativeAndCommutative(), isCombineInstrCandidateFP(), isCVTAToLocalCombinationCandidate(), isDereferenceableInvariantLoad(), llvm::SIInstrInfo::isLegalRegOperand(), llvm::GIMatchTableExecutor::isObviouslySafeToFold(), isReachable(), llvm::TargetInstrInfo::isReassociationCandidate(), isSafeToMove(), llvm::SIInstrInfo::isSafeToSink(), jumpTableFollowsTB(), llvm::AArch64MCInstLower::lowerSymbolOperandELF(), llvm::CombinerHelper::matchCombineExtractedVectorLoad(), llvm::CombinerHelper::matchFreezeOfSingleMaybePoisonOperand(), moveBefore(), llvm::SIInstrInfo::moveToVALUImpl(), llvm::PPCInstrInfo::optimizeCmpPostRA(), llvm::AArch64InstrInfo::optimizeCompareInstr(), llvm::SIInstrInfo::optimizeCompareInstr(), llvm::ARMBaseInstrInfo::optimizeCompareInstr(), llvm::LanaiInstrInfo::optimizeCompareInstr(), llvm::X86InstrInfo::optimizeCompareInstr(), llvm::PPCInstrInfo::optimizeCompareInstr(), llvm::AArch64InstrInfo::optimizeCondBranch(), llvm::LanaiInstrInfo::optimizeSelect(), llvm::ARMBaseInstrInfo::optimizeSelect(), llvm::RISCVInstrInfo::optimizeSelect(), llvm::ARMBaseInstrInfo::produceSameValue(), reinsertVectorIndexAdd(), removeFromBundle(), removeFromParent(), rescheduleCanonically(), llvm::MachineSSAUpdater::RewriteUse(), llvm::salvageDebugInfoForDbgValue(), setDesc(), llvm::AArch64InstrInfo::shouldClusterMemOps(), llvm::SystemZRegisterInfo::shouldCoalesce(), llvm::WebAssemblyDebugValueManager::sink(), splitBlock(), splitMBB(), llvm::TailDuplicator::tailDuplicateAndUpdate(), tryChangeVGPRtoSGPRinCopy(), updateGetPCBundle(), updatePHIs(), validateFunCall(), validateFunCallMachineDef(), validatePtrTypes(), validThroughout(), and verifyCFIntrinsic().
|
inline |
Helper to extract PCSections metadata target sections.
Definition at line 861 of file MachineInstr.h.
References Info.
Referenced by cloneMemRefs(), dropMemRefs(), print(), setCFIType(), setHeapAllocMarker(), setMemRefs(), setMMRAMetadata(), setPCSections(), setPostInstrSymbol(), and setPreInstrSymbol().
|
inline |
Helper to extract a post-instruction symbol if one has been added.
Definition at line 839 of file MachineInstr.h.
References Info.
Referenced by cloneMemRefs(), dropMemRefs(), isIdenticalTo(), isNotDuplicable(), print(), setCFIType(), setHeapAllocMarker(), setMemRefs(), setMMRAMetadata(), setPCSections(), setPostInstrSymbol(), and setPreInstrSymbol().
|
inline |
Helper to extract a pre-instruction symbol if one has been added.
Definition at line 827 of file MachineInstr.h.
References Info.
Referenced by cloneMemRefs(), dropMemRefs(), isIdenticalTo(), isNotDuplicable(), print(), setCFIType(), setHeapAllocMarker(), setMemRefs(), setMMRAMetadata(), setPCSections(), setPostInstrSymbol(), and setPreInstrSymbol().
const TargetRegisterClass * MachineInstr::getRegClassConstraint | ( | unsigned | OpIdx, |
const TargetInstrInfo * | TII, | ||
const TargetRegisterInfo * | TRI | ||
) | const |
Compute the static register class constraint for operand OpIdx.
For normal instructions, this is derived from the MCInstrDesc. For inline assembly it is derived from the flag words.
Returns NULL if the static register class constraint cannot be determined.
Definition at line 950 of file MachineInstr.cpp.
References assert(), F, findInlineAsmFlagIdx(), getDesc(), getMF(), getOperand(), getParent(), isInlineAsm(), isReg(), isRegTiedToDefOperand(), TII, and TRI.
Referenced by getRegClassConstraintEffect(), and llvm::TargetInstrInfo::reassociateOps().
const TargetRegisterClass * MachineInstr::getRegClassConstraintEffect | ( | unsigned | OpIdx, |
const TargetRegisterClass * | CurRC, | ||
const TargetInstrInfo * | TII, | ||
const TargetRegisterInfo * | TRI | ||
) | const |
Applies the constraints (def/use) implied by the OpIdx
operand to the given CurRC
.
Returns the register class that satisfies both CurRC
and the constraints set by OpIdx
MI. Returns NULL if such a register class does not exist.
OpIdx
must be a register. Definition at line 1016 of file MachineInstr.cpp.
References assert(), getOperand(), getRegClassConstraint(), llvm::MachineOperand::getSubReg(), llvm::MachineOperand::isReg(), TII, and TRI.
const TargetRegisterClass * MachineInstr::getRegClassConstraintEffectForVReg | ( | Register | Reg, |
const TargetRegisterClass * | CurRC, | ||
const TargetInstrInfo * | TII, | ||
const TargetRegisterInfo * | TRI, | ||
bool | ExploreBundle = false |
||
) | const |
Applies the constraints (def/use) implied by this MI on Reg
to the given CurRC
.
If ExploreBundle
is set and MI is part of a bundle, all the instructions inside the bundle will be taken into account. In other words, this method accumulates all the constraints of the operand of this MI and the related bundle if MI is a bundle or inside a bundle.
Returns the register class that satisfies both CurRC
and the constraints set by MI. Returns NULL if such a register class does not exist.
Definition at line 987 of file MachineInstr.cpp.
References llvm::MIBundleOperandIteratorBase< ValueT >::isValid(), TII, and TRI.
std::optional< LocationSize > MachineInstr::getRestoreSize | ( | const TargetInstrInfo * | TII | ) | const |
Return a valid size if the instruction is a restore instruction.
Definition at line 2494 of file MachineInstr.cpp.
References llvm::MachineFunction::getFrameInfo(), getMF(), llvm::MachineFrameInfo::isSpillSlotObjectIndex(), memoperands_begin(), and TII.
std::optional< LocationSize > MachineInstr::getSpillSize | ( | const TargetInstrInfo * | TII | ) | const |
Return a valid size if the instruction is a spill instruction.
Definition at line 2475 of file MachineInstr.cpp.
References llvm::MachineFunction::getFrameInfo(), getMF(), llvm::MachineFrameInfo::isSpillSlotObjectIndex(), memoperands_begin(), and TII.
LLT MachineInstr::getTypeToPrint | ( | unsigned | OpIdx, |
SmallBitVector & | PrintedTypes, | ||
const MachineRegisterInfo & | MRI | ||
) | const |
Debugging supportDetermine the generic type to be printed (if needed) on uses and defs.
Definition at line 1622 of file MachineInstr.cpp.
References getDesc(), getNumExplicitOperands(), getOperand(), llvm::LLT::isValid(), isVariadic(), MRI, llvm::MCInstrDesc::operands(), and llvm::SmallBitVector::set().
Referenced by print().
bool MachineInstr::hasComplexRegisterTies | ( | ) | const |
Return true when an instruction has tied register that can't be determined by the instruction's descriptor.
This is useful for MIR printing, to determine whether we need to print the ties or not.
Definition at line 1605 of file MachineInstr.cpp.
References findTiedOperandIdx(), getDesc(), getNumOperands(), getOperand(), llvm::MCInstrDesc::getOperandConstraint(), I, llvm::MCInstrDesc::Opcode, and llvm::MCOI::TIED_TO.
Referenced by print().
Returns whether this debug value has at least one debug operand with the register Reg
.
Definition at line 605 of file MachineInstr.h.
References llvm::any_of(), debug_operands(), and Reg.
Referenced by performSink(), and llvm::salvageDebugInfoForDbgValue().
|
inline |
Returns true if the specified instruction has a delay slot which must be filled by the code generator.
Definition at line 1076 of file MachineInstr.h.
References llvm::MCID::DelaySlot, and hasProperty().
Referenced by collectCallSiteParameters().
|
inline |
Returns true if this instruction def operands have special register allocation requirements that are not captured by the operand register classes.
e.g. ARM::LDRD's two def registers must be an even / odd pair, ARM::LDM registers have to be in ascending order. Post-register allocation passes should not attempt to change allocations for definitions of instructions with this flag.
Definition at line 1273 of file MachineInstr.h.
References llvm::MCID::ExtraDefRegAllocReq, and hasProperty().
|
inline |
Returns true if this instruction source operands have special register allocation requirements that are not captured by the operand register classes.
e.g. ARM::STRD's two source registers must be an even / odd pair, ARM::STM registers have to be in ascending order. Post-register allocation passes should not attempt to change allocations for sources of instructions with this flag.
Definition at line 1263 of file MachineInstr.h.
References llvm::MCID::ExtraSrcRegAllocReq, and hasProperty().
|
inline |
Returns true if the instruction has implicit definition.
Definition at line 649 of file MachineInstr.h.
References implicit_operands().
Referenced by llvm::PPCInstrInfo::combineRLWINM(), and llvm::PPCInstrInfo::optimizeCmpPostRA().
|
inline |
Return true if this instruction has exactly one MachineMemOperand.
Definition at line 821 of file MachineInstr.h.
References memoperands().
Referenced by llvm::SystemZInstrInfo::areMemAccessesTriviallyDisjoint(), llvm::X86InstrInfo::foldMemoryOperandImpl(), llvm::PPCInstrInfo::getMemOperandWithOffsetWidth(), llvm::RISCVInstrInfo::getMemOperandWithOffsetWidth(), and memOpsHaveSameBasePtr().
|
inline |
Set if this instruction has an optional definition, e.g.
ARM instructions which can set condition code if 's' bit is set.
Definition at line 930 of file MachineInstr.h.
References llvm::MCID::HasOptionalDef, and hasProperty().
Referenced by llvm::ARMBaseInstrInfo::optimizeSelect().
bool MachineInstr::hasOrderedMemoryRef | ( | ) | const |
Return true if this instruction may have an ordered or volatile memory reference, or if the information describing the memory reference is not available.
hasOrderedMemoryRef - Return true if this instruction may have an ordered or volatile memory reference, or if the information describing the memory reference is not available.
Return false if it is known to have no ordered or volatile memory references.
Return false if it is known to have no ordered memory references.
Definition at line 1485 of file MachineInstr.cpp.
References llvm::any_of(), hasUnmodeledSideEffects(), isCall(), llvm::MachineMemOperand::isUnordered(), mayLoad(), mayStore(), memoperands(), and memoperands_empty().
Referenced by areCandidatesToMergeOrPair(), llvm::AArch64InstrInfo::areMemAccessesTriviallyDisjoint(), llvm::SIInstrInfo::areMemAccessesTriviallyDisjoint(), llvm::HexagonInstrInfo::areMemAccessesTriviallyDisjoint(), llvm::LanaiInstrInfo::areMemAccessesTriviallyDisjoint(), llvm::PPCInstrInfo::areMemAccessesTriviallyDisjoint(), llvm::RISCVInstrInfo::areMemAccessesTriviallyDisjoint(), isLdStSafeToCluster(), llvm::HexagonPacketizerList::isLegalToPacketizeTogether(), llvm::SwingSchedulerDAG::isLoopCarriedDep(), and isSafeToMove().
|
inline |
Return true if this instruction requires adjustment after instruction selection by calling a target hook.
For example, this can be used to fill in ARM 's' optional operand depending on whether the conditional flag register is used.
Definition at line 1232 of file MachineInstr.h.
References llvm::MCID::HasPostISelHook, and hasProperty().
|
inline |
Return true if the instruction (or in the case of a bundle, the instructions inside the bundle) has the specified property.
The first argument is the property being queried. The second argument indicates whether the query should look inside instruction bundles.
Definition at line 903 of file MachineInstr.h.
References assert(), getDesc(), llvm::MCInstrDesc::getFlags(), IgnoreBundle, isBundled(), and isBundledWithPred().
Referenced by canFoldAsLoad(), hasDelaySlot(), hasExtraDefRegAllocReq(), hasExtraSrcRegAllocReq(), hasOptionalDef(), hasPostISelHook(), hasUnmodeledSideEffects(), isAsCheapAsAMove(), isBarrier(), isBitcast(), isBranch(), isCall(), isCommutable(), isCompare(), isConvergent(), isConvertibleTo3Addr(), isEHScopeReturn(), isExtractSubregLike(), isIndirectBranch(), isInsertSubregLike(), isMetaInstruction(), isMoveImmediate(), isMoveReg(), isNotDuplicable(), isPredicable(), isPreISelOpcode(), isPseudo(), isRegSequenceLike(), isRematerializable(), isReturn(), isSelect(), isTerminator(), isVariadic(), mayLoad(), mayRaiseFPException(), mayStore(), and usesCustomInsertionHook().
Returns true if the MachineInstr has an implicit-use operand of exactly the given register (not considering sub/super-registers).
Definition at line 1048 of file MachineInstr.cpp.
References llvm::MachineOperand::getReg(), implicit_operands(), llvm::MachineOperand::isReg(), and llvm::MachineOperand::isUse().
bool MachineInstr::hasUnmodeledSideEffects | ( | ) | const |
Return true if this instruction has side effects that are not modeled by mayLoad / mayStore, etc.
For all instructions, the property is encoded in MCInstrDesc::Flags (see MCInstrDesc::hasUnmodeledSideEffects(). The only exception is INLINEASM instruction, in which case the side effect property is encoded in one of its operands (see InlineAsm::Extra_HasSideEffect).
Definition at line 1556 of file MachineInstr.cpp.
References llvm::InlineAsm::Extra_HasSideEffects, llvm::MachineOperand::getImm(), getOperand(), hasProperty(), isInlineAsm(), llvm::InlineAsm::MIOp_ExtraInfo, and llvm::MCID::UnmodeledSideEffects.
Referenced by llvm::AArch64InstrInfo::areMemAccessesTriviallyDisjoint(), llvm::SIInstrInfo::areMemAccessesTriviallyDisjoint(), llvm::HexagonInstrInfo::areMemAccessesTriviallyDisjoint(), llvm::LanaiInstrInfo::areMemAccessesTriviallyDisjoint(), llvm::PPCInstrInfo::areMemAccessesTriviallyDisjoint(), llvm::RISCVInstrInfo::areMemAccessesTriviallyDisjoint(), hasOrderedMemoryRef(), hasSameValue(), isLoadFoldBarrier(), llvm::SwingSchedulerDAG::isLoopCarriedDep(), and isSafeToMove().
|
inline |
Definition at line 705 of file MachineInstr.h.
References explicit_operands(), llvm::make_range(), and operands_end().
Referenced by allImplicitDefsAreDead(), hasImplicitDef(), hasRegisterImplicitUseOperand(), and llvm::SIInstrInfo::moveToVALUImpl().
|
inline |
Definition at line 708 of file MachineInstr.h.
References explicit_operands(), llvm::make_range(), and operands_end().
void MachineInstr::insert | ( | mop_iterator | InsertBefore, |
ArrayRef< MachineOperand > | Ops | ||
) |
Inserts Ops BEFORE It. Can untie/retie tied operands.
Definition at line 2593 of file MachineInstr.cpp.
References addOperand(), assert(), llvm::SmallVectorImpl< T >::emplace_back(), llvm::ArrayRef< T >::empty(), findTiedOperandIdx(), getNumOperands(), getOperand(), getOperandNo(), llvm::MachineOperand::getParent(), I, llvm::MachineOperand::isReg(), llvm::MachineOperand::isTied(), operands(), removeOperand(), llvm::SmallVectorImpl< T >::reserve(), llvm::ArrayRef< T >::size(), tieOperands(), and untieRegOperand().
Referenced by llvm::RegBankSelect::repairReg().
|
inline |
|
inline |
Returns true if this instruction has the same cost (or less) than a move instruction.
This is useful during certain types of optimizations (e.g., remat during two-address conversion or machine licm) where we would like to remat or hoist the instruction, but not if it costs more than moving the instruction into the appropriate register. Note, we are not marking copies from and to the same register class with this flag.
Definition at line 1252 of file MachineInstr.h.
References llvm::MCID::CheapAsAMove, and hasProperty().
|
inline |
Returns true if the specified instruction stops control flow from executing the instruction immediately following it.
Examples include unconditional branches and return instructions.
Definition at line 971 of file MachineInstr.h.
References llvm::MCID::Barrier, and hasProperty().
Referenced by llvm::ScheduleDAGInstrs::addSchedBarrierDeps(), cannotCoexistAsymm(), llvm::ARMHazardRecognizerFPMLx::getHazardType(), llvm::HexagonPacketizerList::hasControlDependence(), isConditionalBranch(), isUnconditionalBranch(), and ProfitableToMerge().
|
inline |
Return true if this instruction is a bitcast instruction.
Definition at line 1042 of file MachineInstr.h.
References llvm::MCID::Bitcast, and hasProperty().
|
inline |
Returns true if this is a conditional, unconditional, or indirect branch.
Predicates below can be used to discriminate between these cases, and the TargetInstrInfo::analyzeBranch method can be used to get more information.
Definition at line 988 of file MachineInstr.h.
References llvm::MCID::Branch, and hasProperty().
Referenced by cannotCoexistAsymm(), llvm::HexagonPacketizerList::hasControlDependence(), isConditionalBranch(), llvm::HexagonPacketizerList::isLegalToPacketizeTogether(), isUnconditionalBranch(), and splitBlock().
|
inline |
Definition at line 1433 of file MachineInstr.h.
References getOpcode().
Referenced by llvm::GCNSubtarget::adjustSchedDependency(), llvm::GCNHazardRecognizer::AdvanceCycle(), llvm::HexagonInstrInfo::getBundleNoShuf(), interpretNextInstr(), isIdenticalTo(), and shouldUpdateCallSiteInfo().
|
inline |
Return true if this instruction part of a bundle.
This is true if either itself or its following instruction is marked "InsideBundle".
Definition at line 472 of file MachineInstr.h.
References isBundledWithPred(), and isBundledWithSucc().
Referenced by hasProperty(), isCopyOfBundle(), and updateGetPCBundle().
|
inline |
Return true if this instruction is part of a bundle, and it is not the first instruction in the bundle.
Definition at line 478 of file MachineInstr.h.
References BundledPred, and getFlag().
Referenced by bundleWithPred(), hasProperty(), isBundled(), isCopyOfBundle(), and unbundleFromPred().
|
inline |
Return true if this instruction is part of a bundle, and it is not the last instruction in the bundle.
Definition at line 482 of file MachineInstr.h.
References BundledSucc, and getFlag().
Referenced by bundleWithSucc(), isBundled(), isCopyOfBundle(), moveInstrOut(), and unbundleFromSucc().
|
inline |
Definition at line 956 of file MachineInstr.h.
References llvm::MCID::Call, and hasProperty().
Referenced by llvm::ScheduleDAGInstrs::addSchedBarrierDeps(), cannotCoexistAsymm(), llvm::HexagonRegisterInfo::eliminateFrameIndex(), llvm::ARMBaseInstrInfo::getOutliningCandidateInfo(), llvm::HexagonPacketizerList::hasControlDependence(), llvm::HexagonPacketizerList::hasDeadDependence(), hasOrderedMemoryRef(), llvm::HexagonPacketizerList::hasRegMaskDependence(), interpretNextInstr(), isCandidateForCallSiteEntry(), isIdenticalTo(), llvm::HexagonPacketizerList::isLegalToPacketizeTogether(), isLoadFoldBarrier(), llvm::ARMBaseInstrInfo::isMBBSafeToOutlineFrom(), isSafeToMove(), isSignExtendedW(), llvm::PPCInstrInfo::isSignOrZeroExtended(), llvm::TargetInstrInfo::isTailCall(), and mayAlias().
bool MachineInstr::isCandidateForCallSiteEntry | ( | QueryType | Type = IgnoreBundle | ) | const |
Return true if this is a call instruction that may have an associated call site entry in the debug info.
Definition at line 776 of file MachineInstr.cpp.
References getOpcode(), and isCall().
Referenced by llvm::MachineFunction::addCallSiteInfo(), and shouldUpdateCallSiteInfo().
|
inline |
Definition at line 1342 of file MachineInstr.h.
References getOpcode().
Referenced by llvm::TargetInstrInfo::duplicate(), isPosition(), and print().
|
inline |
Return true if this may be a 2- or 3-address instruction (of the form "X = op Y, Z, ..."), which produces the same result if Y and Z are exchanged.
If this flag is set, then the TargetInstrInfo::commuteInstruction method may be used to hack on the instruction.
Note that this flag may be set on instructions that are only commutable sometimes. In these cases, the call to commuteInstruction will fail. Also note that some instructions require non-trivial modification to commute them.
Definition at line 1194 of file MachineInstr.h.
References llvm::MCID::Commutable, and hasProperty().
|
inline |
Return true if this instruction is a comparison.
Definition at line 1025 of file MachineInstr.h.
References llvm::MCID::Compare, and hasProperty().
|
inline |
Return true if this is a branch which may fall through to the next instruction or may transfer control flow to some other block.
The TargetInstrInfo::analyzeBranch method can be used to get more information about this branch.
Definition at line 1002 of file MachineInstr.h.
References isBarrier(), isBranch(), and isIndirectBranch().
Register MachineInstr::isConstantValuePHI | ( | ) | const |
If the specified instruction is a PHI that always merges together the same virtual register, return the register, otherwise return Register().
Definition at line 1543 of file MachineInstr.cpp.
References assert(), getNumOperands(), getOperand(), llvm::MachineOperand::getReg(), getReg(), and isPHI().
Referenced by llvm::MachineSSAUpdater::GetValueInMiddleOfBlock().
|
inline |
Return true if this instruction is convergent.
Convergent instructions can not be made control-dependent on any additional values.
Definition at line 1063 of file MachineInstr.h.
References llvm::MCID::Convergent, llvm::InlineAsm::Extra_IsConvergent, getFlag(), llvm::MachineOperand::getImm(), getOperand(), hasProperty(), isInlineAsm(), llvm::InlineAsm::MIOp_ExtraInfo, and NoConvergent.
|
inline |
Return true if this is a 2-address instruction which can be changed into a 3-address instruction if needed.
Doing this transformation can be profitable in the register allocator, because it means that the instruction can use a 2-address form if possible, but degrade into a less efficient form if the source and dest register cannot be assigned to the same register. For example, this allows the x86 backend to turn a "shl reg, 3" instruction into an LEA instruction, which is the same speed as the shift but has bigger code size.
If this returns true, then the target must implement the TargetInstrInfo::convertToThreeAddress method for this instruction, which is allowed to fail if the transformation isn't valid for this specific instruction (e.g. shl reg, 4 on x86).
Definition at line 1212 of file MachineInstr.h.
References llvm::MCID::ConvertibleTo3Addr, and hasProperty().
|
inline |
Definition at line 1437 of file MachineInstr.h.
References getOpcode().
Referenced by llvm::HexagonSubtarget::adjustSchedDependency(), llvm::createLibcall(), llvm::createMemLibcall(), foldVGPRCopyIntoRegSequence(), isAGPRCopy(), isCopyLike(), isFullCopy(), isIdentityCopy(), llvm::SIInstrInfo::moveToVALUImpl(), and llvm::AArch64InstrInfo::optimizeCondBranch().
|
inline |
Return true if the instruction behaves like a copy.
This does not include native copy instructions.
Definition at line 1453 of file MachineInstr.h.
References isCopy(), and isSubregToReg().
Referenced by llvm::InstrEmitter::EmitDbgInstrRef(), llvm::ARMBaseInstrInfo::getOperandLatency(), and llvm::MachineFunction::salvageCopySSAImpl().
bool MachineInstr::isDebugEntryValue | ( | ) | const |
A DBG_VALUE is an entry value iff its debug expression contains the DW_OP_LLVM_entry_value operation.
Definition at line 945 of file MachineInstr.cpp.
References getDebugExpression(), isDebugValue(), and llvm::DIExpression::isEntryValue().
Referenced by handleNewDebugValue().
|
inline |
Definition at line 1366 of file MachineInstr.h.
References isDebugLabel(), isDebugPHI(), isDebugRef(), and isDebugValue().
Referenced by addOperand(), llvm::createLibcall(), llvm::createMemLibcall(), llvm::SlotIndexes::getInstructionIndex(), getMatchedEntries(), isDebugOrPseudoInstr(), isIdenticalTo(), and isSafeToMove().
|
inline |
Definition at line 1362 of file MachineInstr.h.
References getOpcode().
Referenced by getDebugLabel(), isDebugInstr(), and print().
|
inline |
Definition at line 1373 of file MachineInstr.h.
References getDebugOffset(), llvm::MachineOperand::isImm(), and isNonListDebugValue().
Referenced by isIndirectDebugValue().
|
inline |
Definition at line 634 of file MachineInstr.h.
References llvm::adl_begin(), llvm::adl_end(), and debug_operands().
Referenced by getDebugOperandIndex().
|
inline |
Definition at line 1369 of file MachineInstr.h.
References isDebugInstr(), and isPseudoProbe().
|
inline |
Definition at line 1365 of file MachineInstr.h.
References getOpcode().
Referenced by isDebugInstr().
|
inline |
Definition at line 1363 of file MachineInstr.h.
References getOpcode().
Referenced by llvm::buildDbgValueForSpill(), isDebugInstr(), isDebugValueLike(), and print().
|
inline |
Definition at line 1359 of file MachineInstr.h.
References isDebugValueList(), and isNonListDebugValue().
Referenced by isDebugEntryValue(), isDebugInstr(), isDebugValueLike(), isUndefDebugValue(), setDebugValueUndef(), and llvm::TailDuplicator::tailDuplicateAndUpdate().
|
inline |
Definition at line 1364 of file MachineInstr.h.
References isDebugRef(), and isDebugValue().
Referenced by debug_operands(), getDebugExpressionOp(), getDebugVariableOp(), isEquivalentDbgInstr(), and print().
|
inline |
Definition at line 1356 of file MachineInstr.h.
References getOpcode().
Referenced by llvm::buildDbgValueForSpill(), isDebugValue(), and print().
bool MachineInstr::isDereferenceableInvariantLoad | ( | ) | const |
Return true if this load instruction never traps and points to a memory location whose value doesn't change during the execution of this function.
isDereferenceableInvariantLoad - Return true if this instruction will never trap and is loading from a location whose value is invariant across a run of this function.
Examples include loading a value from the constant pool or from the argument area of a function (if it does not change). If the instruction does multiple loads, this returns true only if all of the loads are dereferenceable and invariant.
Definition at line 1507 of file MachineInstr.cpp.
References llvm::MachineFunction::getFrameInfo(), llvm::MachineBasicBlock::getParent(), getParent(), mayLoad(), memoperands(), and memoperands_empty().
Referenced by hasSameValue(), isSafeToMove(), and llvm::CombinerHelper::matchEqualDefs().
|
inline |
|
inline |
Return true if this is an instruction that marks the end of an EH scope, i.e., a catchpad or a cleanuppad instruction.
Definition at line 952 of file MachineInstr.h.
References llvm::MCID::EHScopeReturn, and hasProperty().
Referenced by llvm::MachineBasicBlock::isEHScopeReturnBlock().
bool MachineInstr::isEquivalentDbgInstr | ( | const MachineInstr & | Other | ) | const |
Returns true if this instruction is a debug instruction that represents an identical debug value to Other
.
This function considers these debug instructions equivalent if they have identical variables, debug locations, and debug operands, and if the DIExpressions combined with the directness flags are equivalent.
Definition at line 733 of file MachineInstr.cpp.
References getDebugExpression(), getDebugLoc(), getDebugOperand(), getDebugVariable(), getNumDebugOperands(), isDebugValueLike(), llvm::DIExpression::isEqualExpression(), llvm::MachineOperand::isIdenticalTo(), isIndirectDebugValue(), and llvm::Other.
|
inline |
Definition at line 1445 of file MachineInstr.h.
References getOpcode().
Referenced by isOperandSubregIdx().
|
inline |
Return true if this instruction behaves the same way as the generic EXTRACT_SUBREG instructions.
E.g., on ARM, rX, rY VMOVRRD dZ is equivalent to two EXTRACT_SUBREG: rX = EXTRACT_SUBREG dZ, ssub_0 rY = EXTRACT_SUBREG dZ, ssub_1
Note that for the optimizers to be able to take advantage of this property, TargetInstrInfo::getExtractSubregLikeInputs has to be override accordingly.
Definition at line 1117 of file MachineInstr.h.
References llvm::MCID::ExtractSubreg, and hasProperty().
|
inline |
Definition at line 1449 of file MachineInstr.h.
References getOpcode().
Referenced by wouldBeTriviallyDead().
|
inline |
Definition at line 1441 of file MachineInstr.h.
References getOperand(), llvm::MachineOperand::getSubReg(), and isCopy().
Referenced by removeCopies().
|
inline |
bool MachineInstr::isIdenticalTo | ( | const MachineInstr & | Other, |
MICheckType | Check = CheckDefs |
||
) | const |
Return true if this instruction is identical to Other
.
Two instructions are identical if they have the same opcode and all their operands are identical (with respect to MachineOperand::isIdenticalTo()). Note that this means liveness related flags (dead, undef, kill) do not affect the notion of identical.
Definition at line 654 of file MachineInstr.cpp.
References assert(), Check, CheckKillDead, getCFIType(), getDebugLoc(), llvm::ilist_node_impl< ilist_detail::compute_node_options< T, Options... >::type >::getIterator(), getNumOperands(), getOpcode(), getOperand(), getPostInstrSymbol(), getPreInstrSymbol(), llvm::MachineOperand::getReg(), IgnoreDefs, IgnoreVRegDefs, isBundle(), isCall(), llvm::MachineOperand::isDead(), isDebugInstr(), llvm::MachineOperand::isDef(), llvm::MachineOperand::isIdenticalTo(), llvm::MachineOperand::isKill(), llvm::MachineOperand::isReg(), llvm::Register::isVirtual(), and llvm::Other.
Referenced by llvm::SwingSchedulerDAG::isLoopCarriedDep(), llvm::ARMBaseInstrInfo::produceSameValue(), and llvm::TargetInstrInfo::produceSameValue().
|
inline |
Return true is the instruction is an identity copy.
Definition at line 1458 of file MachineInstr.h.
References getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::getSubReg(), and isCopy().
|
inline |
Definition at line 1408 of file MachineInstr.h.
References getOpcode().
Referenced by llvm::HexagonPacketizerList::canPromoteToDotNew(), llvm::ARMBaseInstrInfo::getOperandLatency(), and shouldPreventUndefRegUpdateMemFold().
|
inline |
Return true if this is an indirect branch, such as a branch through a register.
Definition at line 994 of file MachineInstr.h.
References hasProperty(), and llvm::MCID::IndirectBranch.
Referenced by llvm::MipsInstrInfo::analyzeBranch(), blockEndsInUnreachable(), isConditionalBranch(), llvm::HexagonInstrInfo::isHVXMemWithAIndirect(), isUnconditionalBranch(), and llvm::TailDuplicator::shouldTailDuplicate().
|
inline |
A DBG_VALUE is indirect iff the location operand is a register and the offset operand is an immediate.
Definition at line 1379 of file MachineInstr.h.
References getDebugOperand(), isDebugOffsetImm(), and llvm::MachineOperand::isReg().
Referenced by isEquivalentDbgInstr(), print(), and llvm::salvageDebugInfoForDbgValue().
|
inline |
Definition at line 1409 of file MachineInstr.h.
References getOpcode().
Referenced by addOperand(), addRegisterDead(), addRegisterKilled(), cannotCoexistAsymm(), llvm::HexagonPacketizerList::canPromoteToDotCur(), llvm::HexagonPacketizerList::canPromoteToDotNew(), emitInlineAsmError(), findInlineAsmFlagIdx(), findTiedOperandIdx(), llvm::RegAllocBase::getErrorAssignment(), getInlineAsmDialect(), getRegClassConstraint(), hasUnmodeledSideEffects(), isConvergent(), isStackAligningInlineAsm(), mayFoldInlineAsmRegOp(), mayLoad(), mayStore(), print(), llvm::MipsInstrInfo::SafeInFPUDelaySlot(), llvm::MipsInstrInfo::SafeInLoadDelaySlot(), and tieOperands().
|
inline |
Definition at line 1421 of file MachineInstr.h.
References getOpcode().
Referenced by llvm::ARMBaseInstrInfo::getOperandLatency(), and isOperandSubregIdx().
|
inline |
Return true if this instruction behaves the same way as the generic INSERT_SUBREG instructions.
E.g., on ARM, dX = VSETLNi32 dY, rZ, Imm is equivalent to a INSERT_SUBREG: dX = INSERT_SUBREG dY, rZ, translateImmToSubIdx(Imm)
Note that for the optimizers to be able to take advantage of this property, TargetInstrInfo::getInsertSubregLikeInputs has to be override accordingly.
Definition at line 1131 of file MachineInstr.h.
References hasProperty(), and llvm::MCID::InsertSubreg.
|
inline |
Return true if MI is in a bundle (but not the first MI in a bundle).
In this case, the first MI starts a bundle but is not inside a bundle, the next 2 MIs are considered "inside" the bundle.
The first instruction has the special opcode "BUNDLE". It's not "inside" a bundle, but the next three MIs are.
Definition at line 466 of file MachineInstr.h.
References BundledPred, and getFlag().
|
inline |
Definition at line 1399 of file MachineInstr.h.
References getOpcode().
Referenced by isSafeToMove().
|
inline |
Definition at line 1407 of file MachineInstr.h.
References getOpcode().
Referenced by findRegisterUseOperand(), and findRegisterUseOperandIdx().
|
inline |
Returns true if the MachineInstr represents a label.
Definition at line 1338 of file MachineInstr.h.
References isAnnotationLabel(), isEHLabel(), and isGCLabel().
Referenced by isPosition().
|
inline |
Definition at line 1332 of file MachineInstr.h.
References getOpcode().
Referenced by wouldBeTriviallyDead().
bool MachineInstr::isLoadFoldBarrier | ( | ) | const |
Returns true if it is illegal to fold a load across this instruction.
Definition at line 1568 of file MachineInstr.cpp.
References hasUnmodeledSideEffects(), isCall(), isPseudoProbe(), and mayStore().
|
inline |
Return true if this instruction doesn't produce any output in the form of executable instructions.
Definition at line 942 of file MachineInstr.h.
References hasProperty(), and llvm::MCID::Meta.
Referenced by llvm::DebugHandlerBase::endInstruction(), and isTransient().
|
inline |
Return true if this instruction is a move immediate (including conditional moves) instruction.
Definition at line 1031 of file MachineInstr.h.
References hasProperty(), and llvm::MCID::MoveImm.
|
inline |
Return true if this instruction is a register move.
(including moving values from subreg to reg)
Definition at line 1037 of file MachineInstr.h.
References hasProperty(), and llvm::MCID::MoveReg.
|
inline |
Definition at line 1353 of file MachineInstr.h.
References getOpcode().
Referenced by llvm::buildDbgValueForSpill(), debug_operands(), getDebugExpressionOp(), getDebugOffset(), getDebugVariableOp(), isDebugOffsetImm(), isDebugValue(), print(), and llvm::updateDbgValueForSpill().
|
inline |
Return true if this instruction cannot be safely duplicated.
For example, if the instruction has a unique labels attached to it, duplicating it would cause multiple definition errors.
Definition at line 1054 of file MachineInstr.h.
References getPostInstrSymbol(), getPreInstrSymbol(), hasProperty(), and llvm::MCID::NotDuplicable.
Referenced by llvm::TargetInstrInfo::duplicate().
Return true if operand OpIdx
is a subregister index.
Definition at line 662 of file MachineInstr.h.
References assert(), getOperand(), isExtractSubreg(), isImm(), isInsertSubreg(), isRegSequence(), and isSubregToReg().
Referenced by print().
|
inline |
Definition at line 1403 of file MachineInstr.h.
References getOpcode().
Referenced by llvm::SMSchedule::computeStart(), llvm::SMSchedule::computeUnpipelineableNodes(), llvm::PeelingModuloScheduleExpander::getPhiCanonicalReg(), llvm::SwingSchedulerDAG::isBackedge(), isConstantValuePHI(), llvm::SMSchedule::isLoopCarried(), llvm::SwingSchedulerDAG::isLoopCarriedDep(), isSafeToMove(), llvm::CombinerHelper::matchFreezeOfSingleMaybePoisonOperand(), multipleIterations(), llvm::PeelingModuloScheduleExpander::peelPrologAndEpilogs(), llvm::PeelSingleBlockLoop(), llvm::SMSchedule::reorderInstructions(), llvm::MachineSSAUpdater::RewriteUse(), llvm::TailDuplicator::tailDuplicateAndUpdate(), and wouldBeTriviallyDead().
|
inline |
Definition at line 1351 of file MachineInstr.h.
References isCFIInstruction(), and isLabel().
Referenced by isSafeToMove().
|
inline |
Return true if this instruction has a predicate operand that controls execution.
It may be set to 'always', or may be set to other values. There are various methods in TargetInstrInfo that can be used to control and modify the predicate in this instruction.
Definition at line 1018 of file MachineInstr.h.
References hasProperty(), and llvm::MCID::Predicable.
|
inline |
Return true if this is an instruction that should go through the usual legalization steps.
Definition at line 916 of file MachineInstr.h.
References hasProperty(), and llvm::MCID::PreISelOpcode.
|
inline |
Return true if this is a pseudo instruction that doesn't correspond to a real machine instruction.
Definition at line 936 of file MachineInstr.h.
References hasProperty(), and llvm::MCID::Pseudo.
Referenced by canRenameUntilSecondLoad(), llvm::ResourceManager::canReserveResources(), llvm::ResourceManager::reserveResources(), and llvm::ConvergingVLIWScheduler::SchedulingCost().
|
inline |
Definition at line 1346 of file MachineInstr.h.
References getOpcode().
Referenced by isDebugOrPseudoInstr(), and isLoadFoldBarrier().
|
inline |
Definition at line 1429 of file MachineInstr.h.
References getOpcode().
Referenced by llvm::HexagonSubtarget::adjustSchedDependency(), llvm::ARMBaseInstrInfo::getOperandLatency(), and isOperandSubregIdx().
|
inline |
Return true if this instruction behaves the same way as the generic REG_SEQUENCE instructions.
E.g., on ARM, dX VMOVDRR rY, rZ is equivalent to dX = REG_SEQUENCE rY, ssub_0, rZ, ssub_1.
Note that for the optimizers to be able to take advantage of this property, TargetInstrInfo::getRegSequenceLikeInputs has to be override accordingly.
Definition at line 1102 of file MachineInstr.h.
References hasProperty(), and llvm::MCID::RegSequence.
|
inline |
Return true if the use operand of the specified index is tied to a def operand.
It also returns the def operand index by reference if DefOpIdx is not null.
Definition at line 1678 of file MachineInstr.h.
References findTiedOperandIdx(), getOperand(), llvm::MachineOperand::isReg(), llvm::MachineOperand::isTied(), and llvm::MachineOperand::isUse().
Referenced by addRegisterKilled(), llvm::AnalyzeVirtRegInBundle(), and getRegClassConstraint().
|
inline |
Given the index of a register def operand, check if the register def is tied to a source operand, due to either two-address elimination or inline assembly constraints.
Returns the first tied use operand index by reference if UseOpIdx is not null.
Definition at line 1665 of file MachineInstr.h.
References findTiedOperandIdx(), getOperand(), llvm::MachineOperand::isDef(), llvm::MachineOperand::isReg(), and llvm::MachineOperand::isTied().
|
inline |
Returns true if this instruction is a candidate for remat.
This flag is deprecated, please don't use it anymore. If this flag is set, the isReallyTriviallyReMaterializable() method is called to verify the instruction is really rematerializable.
Definition at line 1240 of file MachineInstr.h.
References hasProperty(), and llvm::MCID::Rematerializable.
|
inline |
Definition at line 946 of file MachineInstr.h.
References hasProperty(), and llvm::MCID::Return.
Referenced by blockEndsInUnreachable(), cannotInsertTailCall(), llvm::createLibcall(), llvm::createMemLibcall(), llvm::MachineBasicBlock::isReturnBlock(), and llvm::TargetInstrInfo::isTailCall().
Return true if it is safe to move this instruction.
isSafeToMove - Return true if it is safe to move this instruction.
If SawStore is set to true, it means that there is a store (or call) between the instruction's location and its intended destination.
Definition at line 1301 of file MachineInstr.cpp.
References hasOrderedMemoryRef(), hasUnmodeledSideEffects(), isCall(), isDebugInstr(), isDereferenceableInvariantLoad(), isJumpTableDebugInfo(), isPHI(), isPosition(), isTerminator(), mayLoad(), mayRaiseFPException(), and mayStore().
Referenced by llvm::SystemZInstrInfo::optimizeLoadInstr(), llvm::X86InstrInfo::optimizeLoadInstr(), and wouldBeTriviallyDead().
|
inline |
Return true if this instruction is a select instruction.
Definition at line 1047 of file MachineInstr.h.
References hasProperty(), and llvm::MCID::Select.
bool MachineInstr::isStackAligningInlineAsm | ( | ) | const |
Definition at line 864 of file MachineInstr.cpp.
References llvm::InlineAsm::Extra_IsAlignStack, llvm::MachineOperand::getImm(), getOperand(), isInlineAsm(), and llvm::InlineAsm::MIOp_ExtraInfo.
|
inline |
Definition at line 1425 of file MachineInstr.h.
References getOpcode().
Referenced by isCopyLike(), and isOperandSubregIdx().
|
inline |
Returns true if this instruction part of the terminator for a basic block.
Typically this is things like return and branch instructions.
Various passes use this to insert code into the bottom of a basic block, but before control flow occurs.
Definition at line 980 of file MachineInstr.h.
References hasProperty(), and llvm::MCID::Terminator.
Referenced by cannotCoexistAsymm(), and isSafeToMove().
|
inline |
Return true if this is a transient instruction that is either very likely to be eliminated during register allocation (such as copy-like instructions), or if this instruction doesn't have an execution-time cost.
Definition at line 1466 of file MachineInstr.h.
References getOpcode(), and isMetaInstruction().
Referenced by llvm::TargetSchedModel::computeOperandLatency(), llvm::SchedDFSImpl::visitPostorderNode(), and llvm::SchedDFSImpl::visitPreorder().
|
inline |
Return true if this is a branch which always transfers control flow to some other block.
The TargetInstrInfo::analyzeBranch method can be used to get more information about this branch.
Definition at line 1010 of file MachineInstr.h.
References isBarrier(), isBranch(), and isIndirectBranch().
Referenced by llvm::MipsInstrInfo::analyzeBranch(), and llvm::RegBankSelect::tryAvoidingSplit().
|
inline |
Return true if the instruction is a debug value which describes a part of a variable as unavailable.
Definition at line 1389 of file MachineInstr.h.
References debug_operands(), and isDebugValue().
|
inline |
Return true if this instruction can have a variable number of operands.
In this case, the variable operands will be after the normal operands but before the implicit definitions and uses (if any are present).
Definition at line 924 of file MachineInstr.h.
References hasProperty(), and llvm::MCID::Variadic.
Referenced by getTypeToPrint().
|
inline |
Return true if the MachineInstr kills the specified register.
If TargetRegisterInfo is non-null, then it also checks if there is a kill of a super-register.
Definition at line 1513 of file MachineInstr.h.
References findRegisterUseOperandIdx(), Reg, and TRI.
bool MachineInstr::mayAlias | ( | AAResults * | AA, |
const MachineInstr & | Other, | ||
bool | UseTBAA | ||
) | const |
Returns true if this instruction's memory access aliases the memory access of Other.
Assumes any physical registers used to compute addresses have the same value for both instructions. Returns false if neither instruction writes to memory.
AA | Optional alias analysis, used to compare memory operands. |
Other | MachineInstr to check aliasing against. |
UseTBAA | Whether to pass TBAA information to alias analysis. |
Definition at line 1437 of file MachineInstr.cpp.
References llvm::HexagonInstrInfo::areMemAccessesTriviallyDisjoint(), llvm::MachineFunction::getFrameInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), getMF(), getNumMemOperands(), llvm::MachineFunction::getSubtarget(), isCall(), mayLoadOrStore(), mayStore(), memoperands(), memoperands_empty(), MemOperandsHaveAlias(), llvm::Other, TII, and UseTBAA.
Referenced by llvm::ScheduleDAGInstrs::addChainDependency(), and mayAlias().
Returns true if the register operand can be folded with a load or store into a frame index.
Does so by checking the InlineAsm::Flag immediate operand at OpId - 1.
Definition at line 2638 of file MachineInstr.cpp.
References assert(), F, llvm::MachineOperand::getImm(), getOperand(), llvm::MachineOperand::isImm(), isInlineAsm(), and isReg().
|
inline |
Return true if this instruction could possibly read memory.
Instructions with this flag set are not necessarily simple load instructions, they may load a value and modify it, for example.
Definition at line 1142 of file MachineInstr.h.
References llvm::InlineAsm::Extra_MayLoad, llvm::MachineOperand::getImm(), getOperand(), hasProperty(), isInlineAsm(), llvm::MCID::MayLoad, and llvm::InlineAsm::MIOp_ExtraInfo.
Referenced by llvm::SUnit::addPredBarrier(), llvm::HexagonSubtarget::HVXMemLatencyMutation::apply(), llvm::HexagonSubtarget::BankConflictMutation::apply(), llvm::HexagonInstrInfo::areMemAccessesTriviallyDisjoint(), llvm::HexagonPacketizerList::canPromoteToNewValueStore(), llvm::AArch64InstrInfo::emitLdStWithAddr(), llvm::RISCVInstrInfo::emitLdStWithAddr(), llvm::TargetLoweringBase::emitPatchPoint(), findRenameRegForSameLdStRegPair(), llvm::TargetInstrInfo::foldMemoryOperand(), llvm::ARMBankConflictHazardRecognizer::getHazardType(), llvm::SIInstrInfo::getMemOperandsWithOffsetWidth(), hasOrderedMemoryRef(), isDereferenceableInvariantLoad(), llvm::HexagonPacketizerList::isLegalToPacketizeTogether(), isSafeToMove(), mayLoadOrStore(), llvm::HexagonHazardRecognizer::ShouldPreferAnother(), and llvm::GCNMaxMemoryClauseSchedStrategy::tryCandidate().
|
inline |
Return true if this instruction could possibly read or modify memory.
Definition at line 1165 of file MachineInstr.h.
References mayLoad(), and mayStore().
Referenced by llvm::TargetInstrInfo::areMemAccessesTriviallyDisjoint(), llvm::AArch64InstrInfo::areMemAccessesTriviallyDisjoint(), llvm::SIInstrInfo::areMemAccessesTriviallyDisjoint(), llvm::LanaiInstrInfo::areMemAccessesTriviallyDisjoint(), llvm::PPCInstrInfo::areMemAccessesTriviallyDisjoint(), llvm::RISCVInstrInfo::areMemAccessesTriviallyDisjoint(), llvm::ARMHazardRecognizerFPMLx::getHazardType(), llvm::AArch64InstrInfo::getMemOpBaseRegImmOfsOffsetOperand(), llvm::SIInstrInfo::getMemOperandsWithOffsetWidth(), llvm::AArch64InstrInfo::getMemOperandsWithOffsetWidth(), llvm::RISCVInstrInfo::getMemOperandsWithOffsetWidth(), llvm::PPCInstrInfo::getMemOperandWithOffsetWidth(), llvm::RISCVInstrInfo::getMemOperandWithOffsetWidth(), llvm::AArch64InstrInfo::getMemOperandWithOffsetWidth(), hasSameValue(), llvm::SwingSchedulerDAG::isLoopCarriedDep(), llvm::CombinerHelper::matchEqualDefs(), and mayAlias().
|
inline |
Return true if this instruction could possibly raise a floating-point exception.
This is the case if the instruction is a floating-point instruction that can in principle raise an exception, as indicated by the MCID::MayRaiseFPException property, and at the same time, the instruction is used in a context where we expect floating-point exceptions are not disabled, as indicated by the NoFPExcept MI flag.
Definition at line 1175 of file MachineInstr.h.
References getFlag(), hasProperty(), llvm::MCID::MayRaiseFPException, and NoFPExcept.
Referenced by llvm::SwingSchedulerDAG::isLoopCarriedDep(), and isSafeToMove().
|
inline |
Return true if this instruction could possibly modify memory.
Instructions with this flag set are not necessarily simple store instructions, they may store a modified value based on their operands, or may not actually modify anything, for example.
Definition at line 1155 of file MachineInstr.h.
References llvm::InlineAsm::Extra_MayStore, llvm::MachineOperand::getImm(), getOperand(), hasProperty(), isInlineAsm(), llvm::MCID::MayStore, and llvm::InlineAsm::MIOp_ExtraInfo.
Referenced by llvm::SUnit::addPredBarrier(), llvm::HexagonSubtarget::HVXMemLatencyMutation::apply(), llvm::HexagonSubtarget::BankConflictMutation::apply(), llvm::HexagonInstrInfo::canExecuteInBundle(), cannotCoexistAsymm(), llvm::HexagonPacketizerList::canPromoteToNewValueStore(), canRenameUpToDef(), llvm::TargetInstrInfo::foldMemoryOperand(), llvm::ARMBankConflictHazardRecognizer::getHazardType(), llvm::SIInstrInfo::getMemOperandsWithOffsetWidth(), llvm::HexagonPacketizerList::hasDualStoreDependence(), hasOrderedMemoryRef(), llvm::HexagonPacketizerList::isLegalToPacketizeTogether(), isLoadFoldBarrier(), isSafeToMove(), mayAlias(), and mayLoadOrStore().
|
inline |
Access to memory operands of the instruction.
If there are none, that does not imply anything about whether the function accesses memory. Instead, the caller must behave conservatively.
Definition at line 788 of file MachineInstr.h.
References Info.
Referenced by llvm::VLIWPacketizerList::alias(), cloneMergedMemRefs(), llvm::AArch64InstrInfo::emitLdStWithAddr(), llvm::RISCVInstrInfo::emitLdStWithAddr(), llvm::TargetInstrInfo::foldMemoryOperand(), llvm::ARMBankConflictHazardRecognizer::getHazardType(), getNumMemOperands(), hasOneMemOperand(), hasOrderedMemoryRef(), isDereferenceableInvariantLoad(), mayAlias(), memoperands_begin(), memoperands_empty(), memoperands_end(), llvm::ARMOverrideBypasses::memoryRAWHazard(), print(), llvm::SIInstrInfo::reMaterialize(), setCFIType(), setHeapAllocMarker(), setMMRAMetadata(), setPCSections(), setPostInstrSymbol(), and setPreInstrSymbol().
|
inline |
Access to memory operands of the instruction.
If memoperands_begin() == memoperands_end()
, that does not imply anything about whether the function accesses memory. Instead, the caller must behave conservatively.
Definition at line 806 of file MachineInstr.h.
References memoperands().
Referenced by addMemOperand(), llvm::SystemZInstrInfo::areMemAccessesTriviallyDisjoint(), cloneMergedMemRefs(), expandLoadStackGuard(), llvm::TargetInstrInfo::foldMemoryOperand(), llvm::X86InstrInfo::foldMemoryOperandImpl(), llvm::PPCInstrInfo::getMemOperandWithOffsetWidth(), llvm::RISCVInstrInfo::getMemOperandWithOffsetWidth(), llvm::GMemOperation::getMMO(), getRestoreSize(), getSpillSize(), llvm::SwingSchedulerDAG::isLoopCarriedDep(), llvm::LegalizerHelper::lowerStore(), and memOpsHaveSameBasePtr().
|
inline |
Return true if we don't have any memory operands which described the memory access done by this instruction.
If this is true, calling code must be conservative.
Definition at line 818 of file MachineInstr.h.
References memoperands().
Referenced by llvm::VLIWPacketizerList::alias(), cloneMergedMemRefs(), dropMemRefs(), hasOrderedMemoryRef(), isDereferenceableInvariantLoad(), mayAlias(), and print().
|
inline |
Access to memory operands of the instruction.
If memoperands_begin() == memoperands_end()
, that does not imply anything about whether the function accesses memory. Instead, the caller must behave conservatively.
Definition at line 813 of file MachineInstr.h.
References memoperands().
Referenced by addMemOperand(), cloneMergedMemRefs(), and llvm::TargetInstrInfo::foldMemoryOperand().
uint32_t MachineInstr::mergeFlagsWith | ( | const MachineInstr & | Other | ) | const |
Return the MIFlags which represent both MachineInstrs.
This should be used when merging two MachineInstrs into one. This routine does not modify the MIFlags of this MachineInstr.
Definition at line 561 of file MachineInstr.cpp.
References getFlags(), and llvm::Other.
Referenced by llvm::AArch64InstrInfo::genAlternativeCodeSequence(), and genSubAdd2SubSub().
|
inline |
Return true if the MachineInstr modifies (fully define or partially define) the specified register.
NOTE: It's ignoring subreg indices on virtual registers.
Definition at line 1528 of file MachineInstr.h.
References findRegisterDefOperandIdx(), Reg, and TRI.
Referenced by llvm::HexagonPacketizerList::canPromoteToNewValueStore(), llvm::checkVOPDRegConstraints(), isLdStSafeToCluster(), llvm::HexagonPacketizerList::isLegalToPacketizeTogether(), and llvm::X86InstrInfo::reMaterialize().
void MachineInstr::moveBefore | ( | MachineInstr * | MovePos | ) |
Move the instruction before MovePos
.
Definition at line 150 of file MachineInstr.cpp.
References llvm::ilist_node_impl< ilist_detail::compute_node_options< T, Options... >::type >::getIterator(), getParent(), and llvm::MachineBasicBlock::splice().
|
inline |
Definition at line 691 of file MachineInstr.h.
References llvm::make_range(), operands_begin(), and operands_end().
Referenced by llvm::GCNDownwardRPTracker::advanceBeforeNext(), all_defs(), allDefsAreDead(), llvm::LiveRangeEdit::allUsesAvailableAt(), llvm::HexagonPacketizerList::canPromoteToNewValueStore(), canRenameUpToDef(), canUsePressureDiffs(), clearKillInfo(), clearRegisterKills(), llvm::PPCInstrInfo::convertToImmediateForm(), llvm::SIFrameLowering::determineCalleeSaves(), llvm::HexagonRegisterInfo::eliminateFrameIndex(), llvm::InstrEmitter::EmitDbgInstrRef(), llvm::GIMatchTableExecutor::executeMatchTable(), llvm::SystemZInstrInfo::foldMemoryOperandImpl(), llvm::LiveIntervals::handleMoveIntoNewBundle(), llvm::HexagonPacketizerList::hasDeadDependence(), llvm::HexagonPacketizerList::hasRegMaskDependence(), hasWriteToReadDep(), insert(), isSafeToMove(), scavengeFrameVirtualRegsInBlock(), setPhysRegsDeadExcept(), substituteRegister(), and updatePhysDepsDownwards().
|
inline |
Definition at line 694 of file MachineInstr.h.
References llvm::make_range(), operands_begin(), and operands_end().
|
inline |
Definition at line 685 of file MachineInstr.h.
References Operands.
Referenced by debug_operands(), defs(), explicit_operands(), explicit_uses(), llvm::X86InstrInfo::foldMemoryOperandImpl(), getOperandNo(), operands(), llvm::R600SchedStrategy::schedNode(), and uses().
|
inline |
Definition at line 688 of file MachineInstr.h.
References Operands.
|
inline |
Definition at line 686 of file MachineInstr.h.
References Operands.
Referenced by debug_operands(), implicit_operands(), operands(), llvm::R600SchedStrategy::schedNode(), and uses().
|
inline |
Definition at line 689 of file MachineInstr.h.
References Operands.
|
delete |
|
inline |
Examine the instruction number of this MachineInstr.
May be zero if it hasn't been assigned a number yet.
Definition at line 546 of file MachineInstr.h.
Referenced by llvm::TargetInstrInfo::reassociateOps(), and llvm::MachineFunction::substituteDebugValuesForInst().
void MachineInstr::print | ( | raw_ostream & | OS, |
bool | IsStandalone = true , |
||
bool | SkipOpers = false , |
||
bool | SkipDebugLoc = false , |
||
bool | AddNewLine = true , |
||
const TargetInstrInfo * | TII = nullptr |
||
) | const |
Print this MI to OS
.
Don't print information that can be inferred from other instructions if IsStandalone
is false. It is usually true when only a fragment of the function is printed. Only print the defs and the opcode if SkipOpers
is true. Otherwise, also print operands if SkipDebugLoc
is true. Otherwise, also print the debug loc, with a terminating newline. TII
is used to print the opcode name. If it's not present, but the MI is in a function, the opcode will be printed using the function's TII.
Definition at line 1684 of file MachineInstr.cpp.
References F, llvm::MachineFunction::getFunction(), llvm::TargetSubtargetInfo::getInstrInfo(), getMFIfAvailable(), llvm::MachineFunction::getSubtarget(), llvm::ModuleSlotTracker::incorporateFunction(), OS, print(), and TII.
Referenced by llvm::SPIRVGeneralDuplicatesTracker::buildDepsGraph(), dump(), llvm::ScheduleDAGInstrs::getGraphNodeLabel(), llvm::SMSchedule::print(), print(), false::Chain::str(), and llvm::DbgValueHistoryMap::trimLocationRanges().
void MachineInstr::print | ( | raw_ostream & | OS, |
ModuleSlotTracker & | MST, | ||
bool | IsStandalone = true , |
||
bool | SkipOpers = false , |
||
bool | SkipDebugLoc = false , |
||
bool | AddNewLine = true , |
||
const TargetInstrInfo * | TII = nullptr |
||
) | const |
Definition at line 1702 of file MachineInstr.cpp.
References llvm::InlineAsm::AD_ATT, llvm::InlineAsm::AD_Intel, assert(), Disjoint, DL, llvm::InlineAsm::Extra_HasSideEffects, llvm::InlineAsm::Extra_IsAlignStack, llvm::InlineAsm::Extra_IsConvergent, llvm::InlineAsm::Extra_MayLoad, llvm::InlineAsm::Extra_MayStore, F, findTiedOperandIdx(), FmAfn, FmArcp, FmContract, FmNoInfs, FmNoNans, FmNsz, FmReassoc, FrameDestroy, FrameSetup, getCFIType(), llvm::Function::getContext(), getDebugLoc(), getDebugVariable(), getDebugVariableOp(), getFlag(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getFunction(), getHeapAllocMarker(), llvm::MachineOperand::getImm(), getInlineAsmDialect(), llvm::InlineAsm::getMemConstraintName(), llvm::MachineOperand::getMetadata(), getMFIfAvailable(), getMMRAMetadata(), getNumOperands(), getOpcode(), getOperand(), getPCSections(), getPostInstrSymbol(), getPreInstrSymbol(), getTypeToPrint(), hasComplexRegisterTies(), isCFIInstruction(), isDebugLabel(), isDebugRef(), isDebugValueLike(), isDebugValueList(), llvm::MachineOperand::isDef(), IsExact, llvm::MachineOperand::isImm(), llvm::MachineOperand::isImplicit(), isIndirectDebugValue(), isInlineAsm(), llvm::MachineOperand::isMetadata(), isNonListDebugValue(), isOperandSubregIdx(), llvm::MachineOperand::isReg(), llvm::MachineOperand::isTied(), memoperands(), memoperands_empty(), llvm::InlineAsm::MIOp_AsmString, llvm::InlineAsm::MIOp_ExtraInfo, llvm::InlineAsm::MIOp_FirstOperand, MRI, NoFPExcept, NoMerge, NonNeg, NoSWrap, NoUWrap, OS, llvm::MachineBasicBlock::print(), llvm::MachineOperand::print(), llvm::DWARFExpression::Operation::print(), llvm::MachineBasicBlock::printAsOperand(), llvm::Metadata::printAsOperand(), llvm::MachineOperand::printSubRegIdx(), llvm::MachineOperand::printSymbol(), SameSign, TII, TRI, and tryToGetTargetInfo().
|
inline |
Return true if the MachineInstr reads the specified register.
If TargetRegisterInfo is non-null, then it also checks if there is a read of a super-register. This does not count partial redefines of virtual registers as reads: reg1024:6 = OP.
Definition at line 1493 of file MachineInstr.h.
References findRegisterUseOperandIdx(), Reg, and TRI.
Referenced by checkAndUpdateCCRKill(), checkAndUpdateCPSRKill(), checkCCKill(), llvm::TargetSchedModel::computeOutputLatency(), llvm::ARMBaseInstrInfo::convertToThreeAddress(), llvm::HexagonInstrInfo::getCompoundOpcode(), hasWriteToReadDep(), llvm::HexagonPacketizerList::isLegalToPacketizeTogether(), and llvm::RegBankSelect::tryAvoidingSplit().
Return true if the MachineInstr reads the specified virtual register.
Take into account that a partial define is a read-modify-write operation.
Definition at line 1500 of file MachineInstr.h.
References readsWritesVirtualRegister(), and Reg.
std::pair< bool, bool > MachineInstr::readsWritesVirtualRegister | ( | Register | Reg, |
SmallVectorImpl< unsigned > * | Ops = nullptr |
||
) | const |
Return a pair of bools (reads, writes) indicating if this instruction reads or writes Reg.
readsWritesVirtualRegister - Return a pair of bools (reads, writes) indicating if this instruction reads or writes Reg.
This also considers partial defines. If Ops is not null, all operand indices for Reg are added.
This also considers partial defines.
Definition at line 1080 of file MachineInstr.cpp.
References getNumOperands(), getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::getSubReg(), llvm::MachineOperand::isReg(), llvm::MachineOperand::isUndef(), llvm::MachineOperand::isUse(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by readsVirtualRegister(), and llvm::MipsInstrInfo::SafeInFPUDelaySlot().
|
inline |
Returns true if the register is dead in this machine instruction.
If TargetRegisterInfo is non-null, then it also checks if there is a dead def of a super-register.
Definition at line 1535 of file MachineInstr.h.
References findRegisterDefOperandIdx(), Reg, and TRI.
Referenced by transferDeadCC().
MachineInstr * MachineInstr::removeFromBundle | ( | ) |
Unlink this instruction from its basic block and return it without deleting it.
If the instruction is part of a bundle, the other instructions in the bundle remain bundled.
Definition at line 761 of file MachineInstr.cpp.
References assert(), getParent(), and llvm::MachineBasicBlock::remove_instr().
MachineInstr * MachineInstr::removeFromParent | ( | ) |
Unlink 'this' from the containing basic block, and return it without deleting it.
This function can not be used on bundled instructions, use removeFromBundle() to remove individual instructions from a bundle.
Definition at line 756 of file MachineInstr.cpp.
References assert(), getParent(), and llvm::MachineBasicBlock::remove().
Referenced by llvm::M68kInstrInfo::ExpandMOVI(), llvm::WebAssemblyDebugValueManager::removeDef(), and llvm::ARMBlockPlacement::revertWhileToDoLoop().
void MachineInstr::removeOperand | ( | unsigned | OpNo | ) |
Erase an operand from an instruction, leaving it with one fewer operand than it started with.
Definition at line 294 of file MachineInstr.cpp.
References assert(), getNumOperands(), isReg(), moveOperands(), MRI, N, and untieRegOperand().
Referenced by addRegisterDead(), addRegisterKilled(), llvm::X86InstrInfo::commuteInstructionImpl(), llvm::SIInstrInfo::convertToThreeAddress(), ExpandMOVImmSExti8(), expandSHXDROT(), genAlternativeDpCodeSequence(), llvm::MipsInstrInfo::genInstrWithNewOpc(), insert(), LowerCallResults(), llvm::SIInstrInfo::moveFlatAddrToVGPR(), llvm::SIInstrInfo::moveToVALUImpl(), llvm::AArch64InstrInfo::optimizeCompareInstr(), and llvm::X86InstrInfo::optimizeCompareInstr().
|
inline |
Set a flag for the AsmPrinter.
Definition at line 378 of file MachineInstr.h.
References assert().
Referenced by llvm::addNumImm(), llvm::SIRegisterInfo::buildSpillLoadStore(), and spillVGPRtoAGPR().
void MachineInstr::setCFIType | ( | MachineFunction & | MF, |
uint32_t | Type | ||
) |
Set the CFI type for the instruction.
Definition at line 527 of file MachineInstr.cpp.
References getCFIType(), getHeapAllocMarker(), getMMRAMetadata(), getPCSections(), getPostInstrSymbol(), getPreInstrSymbol(), and memoperands().
|
inline |
Set instruction number of this MachineInstr.
Avoid using unless you're deserializing this information.
Definition at line 550 of file MachineInstr.h.
Referenced by llvm::TargetInstrInfo::reassociateOps().
|
inline |
Replace current source information with new such.
Avoid using this, the constructor argument is preferable.
Definition at line 1877 of file MachineInstr.h.
Referenced by llvm::WebAssemblyDebugValueManager::cloneSink(), expandLoadStackGuard(), and llvm::WebAssemblyDebugValueManager::sink().
|
inline |
Sets all register debug operands in this debug value instruction to be undef.
Definition at line 1987 of file MachineInstr.h.
References assert(), debug_operands(), and isDebugValue().
Referenced by performSink(), and llvm::WebAssemblyDebugValueManager::removeDef().
void MachineInstr::setDesc | ( | const MCInstrDesc & | TID | ) |
Replace the instruction descriptor (thus opcode) of the current instruction with a new one.
Definition at line 143 of file MachineInstr.cpp.
References getMF(), getParent(), llvm::MachineFunction::handleChangeDesc(), and llvm::MCInstrDesc::Opcode.
Referenced by addConstantsToTrack(), llvm::X86InstrInfo::commuteInstructionImpl(), llvm::SIInstrInfo::commuteInstructionImpl(), llvm::SIInstrInfo::convertToThreeAddress(), Expand2AddrKreg(), Expand2AddrUndef(), llvm::M68kInstrInfo::ExpandCCR(), expandLoadStackGuard(), expandMOV32r1(), llvm::M68kInstrInfo::ExpandMOVI(), ExpandMOVImmSExti8(), llvm::M68kInstrInfo::ExpandMOVSZX_RM(), llvm::M68kInstrInfo::ExpandMOVX_RR(), expandNOVLXLoad(), expandNOVLXStore(), llvm::X86InstrInfo::expandPostRAPseudo(), expandSHXDROT(), expandXorFP(), genAlternativeDpCodeSequence(), llvm::SIInstrInfo::moveFlatAddrToVGPR(), llvm::SIInstrInfo::moveToVALUImpl(), llvm::PPCInstrInfo::optimizeCmpPostRA(), llvm::AArch64InstrInfo::optimizeCompareInstr(), llvm::X86InstrInfo::optimizeCompareInstr(), llvm::CombinerHelper::replaceOpcodeWith(), selectMergeValues(), selectUnmergeValues(), llvm::HexagonPacketizerList::shouldAddToPacket(), and llvm::X86InstrInfo::unfoldMemoryOperand().
|
inline |
Set a MI flag.
Definition at line 404 of file MachineInstr.h.
References assert().
Referenced by bundleWithPred(), bundleWithSucc(), emitFROUND(), emitQuietFCMP(), fuseInst(), and transferMIFlag().
|
inline |
Definition at line 410 of file MachineInstr.h.
References assert(), BundledPred, and BundledSucc.
Referenced by llvm::TargetInstrInfo::reassociateOps().
void MachineInstr::setHeapAllocMarker | ( | MachineFunction & | MF, |
MDNode * | MD | ||
) |
Set a marker on instructions that denotes where we should create and emit heap alloc site labels.
This waits until after instruction selection and optimizations to create the label, so it should still work if the instruction is removed or duplicated.
Definition at line 508 of file MachineInstr.cpp.
References getCFIType(), getHeapAllocMarker(), getMMRAMetadata(), getPCSections(), getPostInstrSymbol(), getPreInstrSymbol(), and memoperands().
Referenced by cloneInstrSymbols(), and llvm::FastISel::lowerCallTo().
void MachineInstr::setMemRefs | ( | MachineFunction & | MF, |
ArrayRef< MachineMemOperand * > | MemRefs | ||
) |
Assign this MachineInstr's memory reference descriptor list.
Unlike other methods, this will allocate them into a new array associated with the provided MachineFunction
.
Definition at line 369 of file MachineInstr.cpp.
References dropMemRefs(), llvm::ArrayRef< T >::empty(), getCFIType(), getHeapAllocMarker(), getMMRAMetadata(), getPCSections(), getPostInstrSymbol(), and getPreInstrSymbol().
Referenced by addMemOperand(), cloneMemRefs(), cloneMergedMemRefs(), and llvm::TargetInstrInfo::foldMemoryOperand().
void MachineInstr::setMMRAMetadata | ( | MachineFunction & | MF, |
MDNode * | MMRAs | ||
) |
Definition at line 536 of file MachineInstr.cpp.
References getCFIType(), getHeapAllocMarker(), getMMRAMetadata(), getPCSections(), getPostInstrSymbol(), getPreInstrSymbol(), and memoperands().
Referenced by cloneInstrSymbols().
void MachineInstr::setPCSections | ( | MachineFunction & | MF, |
MDNode * | MD | ||
) |
Definition at line 517 of file MachineInstr.cpp.
References getCFIType(), getHeapAllocMarker(), getMMRAMetadata(), getPCSections(), getPostInstrSymbol(), getPreInstrSymbol(), and memoperands().
Referenced by cloneInstrSymbols().
void MachineInstr::setPhysRegsDeadExcept | ( | ArrayRef< Register > | UsedRegs, |
const TargetRegisterInfo & | TRI | ||
) |
Mark every physreg used by this instruction as dead except those in the UsedRegs list.
On instructions with register mask operands, also add implicit-def operands for all registers in UsedRegs.
Definition at line 2182 of file MachineInstr.cpp.
References addRegisterDefined(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isDef(), llvm::MachineOperand::isReg(), llvm::MachineOperand::isRegMask(), llvm::none_of(), operands(), llvm::MachineOperand::setIsDead(), and TRI.
Referenced by llvm::FastISel::lowerCallTo(), and llvm::FastISel::selectPatchpoint().
void MachineInstr::setPostInstrSymbol | ( | MachineFunction & | MF, |
MCSymbol * | Symbol | ||
) |
Set a symbol that will be emitted just after the instruction itself.
Setting this to a null pointer will remove any such symbol.
FIXME: This is not fully implemented yet.
Definition at line 492 of file MachineInstr.cpp.
References getCFIType(), getHeapAllocMarker(), getMMRAMetadata(), getPCSections(), getPostInstrSymbol(), getPreInstrSymbol(), and memoperands().
Referenced by cloneInstrSymbols(), and llvm::SIInstrInfo::insertIndirectBranch().
void MachineInstr::setPreInstrSymbol | ( | MachineFunction & | MF, |
MCSymbol * | Symbol | ||
) |
Set a symbol that will be emitted just prior to the instruction itself.
Setting this to a null pointer will remove any such symbol.
FIXME: This is not fully implemented yet.
Definition at line 476 of file MachineInstr.cpp.
References getCFIType(), getHeapAllocMarker(), getMMRAMetadata(), getPCSections(), getPostInstrSymbol(), getPreInstrSymbol(), and memoperands().
Referenced by cloneInstrSymbols().
Mark all subregister defs of register Reg
with the undef flag.
This function is used when we determined to have a subregister def in an otherwise undefined super register.
Definition at line 2159 of file MachineInstr.cpp.
References all_defs(), llvm::MachineOperand::getReg(), llvm::MachineOperand::getSubReg(), and llvm::MachineOperand::setIsUndef().
Referenced by llvm::RegisterOperands::adjustLaneLiveness().
bool MachineInstr::shouldUpdateCallSiteInfo | ( | ) | const |
Return true if copying, moving, or erasing this instruction requires updating Call Site Info (see copyCallSiteInfo, moveCallSiteInfo, eraseCallSiteInfo).
Definition at line 789 of file MachineInstr.cpp.
References AnyInBundle, isBundle(), and isCandidateForCallSiteEntry().
Referenced by llvm::MachineFunction::cloneMachineInstrBundle(), llvm::MachineFunction::copyCallSiteInfo(), and llvm::MachineFunction::moveCallSiteInfo().
void MachineInstr::substituteRegister | ( | Register | FromReg, |
Register | ToReg, | ||
unsigned | SubIdx, | ||
const TargetRegisterInfo & | RegInfo | ||
) |
Replace all occurrences of FromReg with ToReg:SubIdx, properly composing subreg indices where necessary.
Definition at line 1278 of file MachineInstr.cpp.
References llvm::MachineOperand::getReg(), llvm::TargetRegisterInfo::getSubReg(), llvm::Register::isPhysical(), llvm::MachineOperand::isReg(), operands(), llvm::MachineOperand::substPhysReg(), and llvm::MachineOperand::substVirtReg().
Referenced by llvm::X86InstrInfo::reMaterialize().
Add a tie between the register operands at DefIdx and UseIdx.
tieOperands - Mark operands at DefIdx and UseIdx as tied to each other.
The tie will cause the register allocator to ensure that the two operands are assigned the same physical register.
Tied operands are managed automatically for explicit operands in the MCInstrDesc. This method is for exceptional cases like inline asm.
Use and def operands can be tied together, indicated by a non-zero TiedTo field. TiedTo can have these values:
0: Operand is not tied to anything. 1 to TiedMax-1: Tied to getOperand(TiedTo-1). TiedMax: Tied to an operand >= TiedMax-1.
The tied def must be one of the first TiedMax operands on a normal instruction. INLINEASM instructions allow more tied defs.
Definition at line 1167 of file MachineInstr.cpp.
References assert(), getOpcode(), getOperand(), llvm::MachineOperand::isDef(), isInlineAsm(), llvm::MachineOperand::isTied(), llvm::MachineOperand::isUse(), and TiedMax.
Referenced by addOperand(), llvm::SIInstrInfo::copyPhysReg(), llvm::TargetLoweringBase::emitPatchPoint(), llvm::SIInstrInfo::expandPostRAPseudo(), foldPatchpoint(), insert(), llvm::SIInstrInfo::moveFlatAddrToVGPR(), llvm::LanaiInstrInfo::optimizeSelect(), and llvm::ARMBaseInstrInfo::optimizeSelect().
void MachineInstr::unbundleFromPred | ( | ) |
Break bundle above this instruction.
Definition at line 846 of file MachineInstr.cpp.
References assert(), BundledPred, BundledSucc, clearFlag(), llvm::ilist_node_impl< ilist_detail::compute_node_options< T, Options... >::type >::getIterator(), and isBundledWithPred().
Referenced by moveInstrOut().
void MachineInstr::unbundleFromSucc | ( | ) |
Break bundle below this instruction.
Definition at line 855 of file MachineInstr.cpp.
References assert(), BundledPred, BundledSucc, clearFlag(), llvm::ilist_node_impl< ilist_detail::compute_node_options< T, Options... >::type >::getIterator(), and isBundledWithSucc().
|
inline |
Break any tie involving OpIdx.
Definition at line 1966 of file MachineInstr.h.
References findTiedOperandIdx(), getOperand(), llvm::MachineOperand::isReg(), and llvm::MachineOperand::isTied().
Referenced by genAlternativeDpCodeSequence(), insert(), llvm::SIInstrInfo::moveFlatAddrToVGPR(), and removeOperand().
|
inline |
Returns a range that includes all operands which may be register uses.
This may include unrelated operands which are not register uses.
Definition at line 739 of file MachineInstr.h.
References getNumExplicitDefs(), llvm::make_range(), operands_begin(), and operands_end().
Referenced by all_uses(), llvm::checkVOPDRegConstraints(), collectCallSiteParameters(), llvm::PPCInstrInfo::getConstantFromConstantPool(), llvm::SPIRVGlobalRegistry::getSPIRVTypeID(), hasSameValue(), llvm::StatepointOpers::isFoldableReg(), isGuaranteedNotToBeUndefOrPoison(), llvm::isKnownNeverNaN(), LowerCallResults(), and llvm::CombinerHelper::matchFreezeOfSingleMaybePoisonOperand().
|
inline |
Returns a range that includes all operands which may be register uses.
This may include unrelated operands which are not register uses.
Definition at line 743 of file MachineInstr.h.
References getNumExplicitDefs(), llvm::make_range(), operands_begin(), and operands_end().
|
inline |
Return true if this instruction requires custom insertion support when the DAG scheduler is inserting it into a machine basic block.
If this is true for the instruction, it basically means that it is a pseudo instruction used at SelectionDAG time that is expanded out into magic code by the target when MachineInstrs are formed.
If this is true, the TargetLoweringInfo::InsertAtEndOfBasicBlock method is used to insert this into the MachineBasicBlock.
Definition at line 1224 of file MachineInstr.h.
References hasProperty(), and llvm::MCID::UsesCustomInserter.
bool MachineInstr::wouldBeTriviallyDead | ( | ) | const |
Return true if this instruction would be trivially dead if all of its defined registers were dead.
Definition at line 1331 of file MachineInstr.cpp.
References getOpcode(), isFakeUse(), isLifetimeMarker(), isPHI(), and isSafeToMove().
|
friend |
Definition at line 309 of file MachineInstr.h.
|
friend |
Definition at line 309 of file MachineInstr.h.
|
friend |
Definition at line 327 of file MachineInstr.h.