LLVM 20.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
llvm::SIInstrInfo Class Referencefinal

#include "Target/AMDGPU/SIInstrInfo.h"

Inheritance diagram for llvm::SIInstrInfo:
Inheritance graph
[legend]

Public Types

enum  TargetOperandFlags {
  MO_MASK = 0xf , MO_NONE = 0 , MO_GOTPCREL = 1 , MO_GOTPCREL32 = 2 ,
  MO_GOTPCREL32_LO = 2 , MO_GOTPCREL32_HI = 3 , MO_REL32 = 4 , MO_REL32_LO = 4 ,
  MO_REL32_HI = 5 , MO_FAR_BRANCH_OFFSET = 6 , MO_ABS32_LO = 8 , MO_ABS32_HI = 9
}
 

Public Member Functions

unsigned buildExtractSubReg (MachineBasicBlock::iterator MI, MachineRegisterInfo &MRI, const MachineOperand &SuperReg, const TargetRegisterClass *SuperRC, unsigned SubIdx, const TargetRegisterClass *SubRC) const
 
MachineOperand buildExtractSubRegOrImm (MachineBasicBlock::iterator MI, MachineRegisterInfo &MRI, const MachineOperand &SuperReg, const TargetRegisterClass *SuperRC, unsigned SubIdx, const TargetRegisterClass *SubRC) const
 
 SIInstrInfo (const GCNSubtarget &ST)
 
const SIRegisterInfogetRegisterInfo () const
 
const GCNSubtargetgetSubtarget () const
 
bool isReallyTriviallyReMaterializable (const MachineInstr &MI) const override
 
bool isIgnorableUse (const MachineOperand &MO) const override
 
bool isSafeToSink (MachineInstr &MI, MachineBasicBlock *SuccToSinkTo, MachineCycleInfo *CI) const override
 
bool areLoadsFromSameBasePtr (SDNode *Load0, SDNode *Load1, int64_t &Offset0, int64_t &Offset1) const override
 
bool getMemOperandsWithOffsetWidth (const MachineInstr &LdSt, SmallVectorImpl< const MachineOperand * > &BaseOps, int64_t &Offset, bool &OffsetIsScalable, LocationSize &Width, const TargetRegisterInfo *TRI) const final
 
bool shouldClusterMemOps (ArrayRef< const MachineOperand * > BaseOps1, int64_t Offset1, bool OffsetIsScalable1, ArrayRef< const MachineOperand * > BaseOps2, int64_t Offset2, bool OffsetIsScalable2, unsigned ClusterSize, unsigned NumBytes) const override
 
bool shouldScheduleLoadsNear (SDNode *Load0, SDNode *Load1, int64_t Offset0, int64_t Offset1, unsigned NumLoads) const override
 
void copyPhysReg (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg, bool KillSrc) const override
 
void materializeImmediate (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const DebugLoc &DL, Register DestReg, int64_t Value) const
 
const TargetRegisterClassgetPreferredSelectRegClass (unsigned Size) const
 
Register insertNE (MachineBasicBlock *MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, Register SrcReg, int Value) const
 
Register insertEQ (MachineBasicBlock *MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, Register SrcReg, int Value) const
 
void storeRegToStackSlot (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, Register SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI, Register VReg) const override
 
void loadRegFromStackSlot (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, Register DestReg, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI, Register VReg) const override
 
bool expandPostRAPseudo (MachineInstr &MI) const override
 
void reMaterialize (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, Register DestReg, unsigned SubIdx, const MachineInstr &Orig, const TargetRegisterInfo &TRI) const override
 
std::pair< MachineInstr *, MachineInstr * > expandMovDPP64 (MachineInstr &MI) const
 
unsigned getMovOpcode (const TargetRegisterClass *DstRC) const
 
const MCInstrDescgetIndirectRegWriteMovRelPseudo (unsigned VecSize, unsigned EltSize, bool IsSGPR) const
 
const MCInstrDescgetIndirectGPRIDXPseudo (unsigned VecSize, bool IsIndirectSrc) const
 
LLVM_READONLY int commuteOpcode (unsigned Opc) const
 
LLVM_READONLY int commuteOpcode (const MachineInstr &MI) const
 
bool findCommutedOpIndices (const MachineInstr &MI, unsigned &SrcOpIdx0, unsigned &SrcOpIdx1) const override
 
bool findCommutedOpIndices (const MCInstrDesc &Desc, unsigned &SrcOpIdx0, unsigned &SrcOpIdx1) const
 
bool isBranchOffsetInRange (unsigned BranchOpc, int64_t BrOffset) const override
 
MachineBasicBlockgetBranchDestBlock (const MachineInstr &MI) const override
 
bool hasDivergentBranch (const MachineBasicBlock *MBB) const
 Return whether the block terminate with divergent branch.
 
void insertIndirectBranch (MachineBasicBlock &MBB, MachineBasicBlock &NewDestBB, MachineBasicBlock &RestoreBB, const DebugLoc &DL, int64_t BrOffset, RegScavenger *RS) const override
 
bool analyzeBranchImpl (MachineBasicBlock &MBB, MachineBasicBlock::iterator I, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify) const
 
bool analyzeBranch (MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify=false) const override
 
unsigned removeBranch (MachineBasicBlock &MBB, int *BytesRemoved=nullptr) const override
 
unsigned insertBranch (MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef< MachineOperand > Cond, const DebugLoc &DL, int *BytesAdded=nullptr) const override
 
bool reverseBranchCondition (SmallVectorImpl< MachineOperand > &Cond) const override
 
bool canInsertSelect (const MachineBasicBlock &MBB, ArrayRef< MachineOperand > Cond, Register DstReg, Register TrueReg, Register FalseReg, int &CondCycles, int &TrueCycles, int &FalseCycles) const override
 
void insertSelect (MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, Register DstReg, ArrayRef< MachineOperand > Cond, Register TrueReg, Register FalseReg) const override
 
void insertVectorSelect (MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, Register DstReg, ArrayRef< MachineOperand > Cond, Register TrueReg, Register FalseReg) const
 
bool analyzeCompare (const MachineInstr &MI, Register &SrcReg, Register &SrcReg2, int64_t &CmpMask, int64_t &CmpValue) const override
 
bool optimizeCompareInstr (MachineInstr &CmpInstr, Register SrcReg, Register SrcReg2, int64_t CmpMask, int64_t CmpValue, const MachineRegisterInfo *MRI) const override
 
bool areMemAccessesTriviallyDisjoint (const MachineInstr &MIa, const MachineInstr &MIb) const override
 
void removeModOperands (MachineInstr &MI) const
 
bool foldImmediate (MachineInstr &UseMI, MachineInstr &DefMI, Register Reg, MachineRegisterInfo *MRI) const final
 
unsigned getMachineCSELookAheadLimit () const override
 
MachineInstrconvertToThreeAddress (MachineInstr &MI, LiveVariables *LV, LiveIntervals *LIS) const override
 
bool isSchedulingBoundary (const MachineInstr &MI, const MachineBasicBlock *MBB, const MachineFunction &MF) const override
 
bool isSALU (uint16_t Opcode) const
 
bool isVALU (uint16_t Opcode) const
 
bool isImage (uint16_t Opcode) const
 
bool isVMEM (uint16_t Opcode) const
 
bool isSOP1 (uint16_t Opcode) const
 
bool isSOP2 (uint16_t Opcode) const
 
bool isSOPC (uint16_t Opcode) const
 
bool isSOPK (uint16_t Opcode) const
 
bool isSOPP (uint16_t Opcode) const
 
bool isPacked (uint16_t Opcode) const
 
bool isVOP1 (uint16_t Opcode) const
 
bool isVOP2 (uint16_t Opcode) const
 
bool isVOP3 (uint16_t Opcode) const
 
bool isSDWA (uint16_t Opcode) const
 
bool isVOPC (uint16_t Opcode) const
 
bool isMUBUF (uint16_t Opcode) const
 
bool isMTBUF (uint16_t Opcode) const
 
bool isSMRD (uint16_t Opcode) const
 
bool isBufferSMRD (const MachineInstr &MI) const
 
bool isDS (uint16_t Opcode) const
 
bool isLDSDMA (uint16_t Opcode)
 
bool isGWS (uint16_t Opcode) const
 
bool isAlwaysGDS (uint16_t Opcode) const
 
bool isMIMG (uint16_t Opcode) const
 
bool isVIMAGE (uint16_t Opcode) const
 
bool isVSAMPLE (uint16_t Opcode) const
 
bool isGather4 (uint16_t Opcode) const
 
bool isSegmentSpecificFLAT (uint16_t Opcode) const
 
bool isFLATGlobal (uint16_t Opcode) const
 
bool isFLATScratch (uint16_t Opcode) const
 
bool isFLAT (uint16_t Opcode) const
 
bool isEXP (uint16_t Opcode) const
 
bool isAtomicNoRet (uint16_t Opcode) const
 
bool isAtomicRet (uint16_t Opcode) const
 
bool isAtomic (uint16_t Opcode) const
 
bool isWQM (uint16_t Opcode) const
 
bool isDisableWQM (uint16_t Opcode) const
 
bool isVGPRSpill (uint16_t Opcode) const
 
bool isSGPRSpill (uint16_t Opcode) const
 
bool isSpill (uint16_t Opcode) const
 
bool isDPP (uint16_t Opcode) const
 
bool isTRANS (uint16_t Opcode) const
 
bool isVOP3P (uint16_t Opcode) const
 
bool isVINTRP (uint16_t Opcode) const
 
bool isMAI (uint16_t Opcode) const
 
bool isWMMA (uint16_t Opcode) const
 
bool isSWMMAC (uint16_t Opcode) const
 
bool isDOT (uint16_t Opcode) const
 
bool isLDSDIR (uint16_t Opcode) const
 
bool isVINTERP (uint16_t Opcode) const
 
bool isScalarStore (uint16_t Opcode) const
 
bool isFixedSize (uint16_t Opcode) const
 
bool hasFPClamp (uint16_t Opcode) const
 
uint64_t getClampMask (const MachineInstr &MI) const
 
bool usesFPDPRounding (uint16_t Opcode) const
 
bool isFPAtomic (uint16_t Opcode) const
 
bool isBarrierStart (unsigned Opcode) const
 
bool isBarrier (unsigned Opcode) const
 
bool doesNotReadTiedSource (uint16_t Opcode) const
 
bool isWaitcnt (unsigned Opcode) const
 
bool isVGPRCopy (const MachineInstr &MI) const
 
bool hasVGPRUses (const MachineInstr &MI) const
 
bool hasUnwantedEffectsWhenEXECEmpty (const MachineInstr &MI) const
 This function is used to determine if an instruction can be safely executed under EXEC = 0 without hardware error, indeterminate results, and/or visible effects on future vector execution or outside the shader.
 
bool mayReadEXEC (const MachineRegisterInfo &MRI, const MachineInstr &MI) const
 Returns true if the instruction could potentially depend on the value of exec.
 
bool isInlineConstant (const APInt &Imm) const
 
bool isInlineConstant (const APFloat &Imm) const
 
bool isInlineConstant (const MachineOperand &MO, uint8_t OperandType) const
 
bool isInlineConstant (const MachineOperand &MO, const MCOperandInfo &OpInfo) const
 
bool isInlineConstant (const MachineInstr &MI, const MachineOperand &UseMO, const MachineOperand &DefMO) const
 returns true if UseMO is substituted with DefMO in MI it would be an inline immediate.
 
bool isInlineConstant (const MachineInstr &MI, unsigned OpIdx) const
 returns true if the operand OpIdx in MI is a valid inline immediate.
 
bool isInlineConstant (const MachineInstr &MI, unsigned OpIdx, const MachineOperand &MO) const
 
bool isInlineConstant (const MachineOperand &MO) const
 
bool isImmOperandLegal (const MachineInstr &MI, unsigned OpNo, const MachineOperand &MO) const
 
bool hasVALU32BitEncoding (unsigned Opcode) const
 Return true if this 64-bit VALU instruction has a 32-bit encoding.
 
bool usesConstantBus (const MachineRegisterInfo &MRI, const MachineOperand &MO, const MCOperandInfo &OpInfo) const
 Returns true if this operand uses the constant bus.
 
bool hasModifiers (unsigned Opcode) const
 Return true if this instruction has any modifiers.
 
bool hasModifiersSet (const MachineInstr &MI, unsigned OpName) const
 
bool hasAnyModifiersSet (const MachineInstr &MI) const
 
bool canShrink (const MachineInstr &MI, const MachineRegisterInfo &MRI) const
 
MachineInstrbuildShrunkInst (MachineInstr &MI, unsigned NewOpcode) const
 
bool verifyInstruction (const MachineInstr &MI, StringRef &ErrInfo) const override
 
unsigned getVALUOp (const MachineInstr &MI) const
 
void insertScratchExecCopy (MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, const DebugLoc &DL, Register Reg, bool IsSCCLive, SlotIndexes *Indexes=nullptr) const
 
void restoreExec (MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, const DebugLoc &DL, Register Reg, SlotIndexes *Indexes=nullptr) const
 
const TargetRegisterClassgetOpRegClass (const MachineInstr &MI, unsigned OpNo) const
 Return the correct register class for OpNo.
 
unsigned getOpSize (uint16_t Opcode, unsigned OpNo) const
 Return the size in bytes of the operand OpNo on the given.
 
unsigned getOpSize (const MachineInstr &MI, unsigned OpNo) const
 This form should usually be preferred since it handles operands with unknown register classes.
 
void legalizeOpWithMove (MachineInstr &MI, unsigned OpIdx) const
 Legalize the OpIndex operand of this instruction by inserting a MOV.
 
bool isOperandLegal (const MachineInstr &MI, unsigned OpIdx, const MachineOperand *MO=nullptr) const
 Check if MO is a legal operand if it was the OpIdx Operand for MI.
 
bool isLegalVSrcOperand (const MachineRegisterInfo &MRI, const MCOperandInfo &OpInfo, const MachineOperand &MO) const
 Check if MO would be a valid operand for the given operand definition OpInfo.
 
bool isLegalRegOperand (const MachineRegisterInfo &MRI, const MCOperandInfo &OpInfo, const MachineOperand &MO) const
 Check if MO (a register operand) is a legal register for the given operand description.
 
void legalizeOperandsVOP2 (MachineRegisterInfo &MRI, MachineInstr &MI) const
 Legalize operands in MI by either commuting it or inserting a copy of src1.
 
void legalizeOperandsVOP3 (MachineRegisterInfo &MRI, MachineInstr &MI) const
 Fix operands in MI to satisfy constant bus requirements.
 
Register readlaneVGPRToSGPR (Register SrcReg, MachineInstr &UseMI, MachineRegisterInfo &MRI) const
 Copy a value from a VGPR (SrcReg) to SGPR.
 
void legalizeOperandsSMRD (MachineRegisterInfo &MRI, MachineInstr &MI) const
 
void legalizeOperandsFLAT (MachineRegisterInfo &MRI, MachineInstr &MI) const
 
void legalizeGenericOperand (MachineBasicBlock &InsertMBB, MachineBasicBlock::iterator I, const TargetRegisterClass *DstRC, MachineOperand &Op, MachineRegisterInfo &MRI, const DebugLoc &DL) const
 
MachineBasicBlocklegalizeOperands (MachineInstr &MI, MachineDominatorTree *MDT=nullptr) const
 Legalize all operands in this instruction.
 
bool moveFlatAddrToVGPR (MachineInstr &Inst) const
 Change SADDR form of a FLAT Inst to its VADDR form if saddr operand was moved to VGPR.
 
void moveToVALU (SIInstrWorklist &Worklist, MachineDominatorTree *MDT) const
 Replace the instructions opcode with the equivalent VALU opcode.
 
void moveToVALUImpl (SIInstrWorklist &Worklist, MachineDominatorTree *MDT, MachineInstr &Inst) const
 
void insertNoop (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const override
 
void insertNoops (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned Quantity) const override
 
void insertReturn (MachineBasicBlock &MBB) const
 
MachineBasicBlockinsertSimulatedTrap (MachineRegisterInfo &MRI, MachineBasicBlock &MBB, MachineInstr &MI, const DebugLoc &DL) const
 Build instructions that simulate the behavior of a s_trap 2 instructions for hardware (namely, gfx11) that runs in PRIV=1 mode.
 
LLVM_READONLY MachineOperandgetNamedOperand (MachineInstr &MI, unsigned OperandName) const
 Returns the operand named Op.
 
LLVM_READONLY const MachineOperandgetNamedOperand (const MachineInstr &MI, unsigned OpName) const
 
int64_t getNamedImmOperand (const MachineInstr &MI, unsigned OpName) const
 Get required immediate operand.
 
uint64_t getDefaultRsrcDataFormat () const
 
uint64_t getScratchRsrcWords23 () const
 
bool isLowLatencyInstruction (const MachineInstr &MI) const
 
bool isHighLatencyDef (int Opc) const override
 
const MCInstrDescgetMCOpcodeFromPseudo (unsigned Opcode) const
 Return the descriptor of the target-specific machine instruction that corresponds to the specified pseudo or native opcode.
 
unsigned isStackAccess (const MachineInstr &MI, int &FrameIndex) const
 
unsigned isSGPRStackAccess (const MachineInstr &MI, int &FrameIndex) const
 
Register isLoadFromStackSlot (const MachineInstr &MI, int &FrameIndex) const override
 
Register isStoreToStackSlot (const MachineInstr &MI, int &FrameIndex) const override
 
unsigned getInstBundleSize (const MachineInstr &MI) const
 
unsigned getInstSizeInBytes (const MachineInstr &MI) const override
 
bool mayAccessFlatAddressSpace (const MachineInstr &MI) const
 
bool isNonUniformBranchInstr (MachineInstr &Instr) const
 
void convertNonUniformIfRegion (MachineBasicBlock *IfEntry, MachineBasicBlock *IfEnd) const
 
void convertNonUniformLoopRegion (MachineBasicBlock *LoopEntry, MachineBasicBlock *LoopEnd) const
 
std::pair< unsigned, unsigneddecomposeMachineOperandsTargetFlags (unsigned TF) const override
 
ArrayRef< std::pair< int, const char * > > getSerializableTargetIndices () const override
 
ArrayRef< std::pair< unsigned, const char * > > getSerializableDirectMachineOperandTargetFlags () const override
 
ArrayRef< std::pair< MachineMemOperand::Flags, const char * > > getSerializableMachineMemOperandTargetFlags () const override
 
ScheduleHazardRecognizerCreateTargetPostRAHazardRecognizer (const InstrItineraryData *II, const ScheduleDAG *DAG) const override
 This is used by the post-RA scheduler (SchedulePostRAList.cpp).
 
ScheduleHazardRecognizerCreateTargetPostRAHazardRecognizer (const MachineFunction &MF) const override
 This is the hazard recognizer used at -O0 by the PostRAHazardRecognizer pass.
 
ScheduleHazardRecognizerCreateTargetMIHazardRecognizer (const InstrItineraryData *II, const ScheduleDAGMI *DAG) const override
 
unsigned getLiveRangeSplitOpcode (Register Reg, const MachineFunction &MF) const override
 
bool isBasicBlockPrologue (const MachineInstr &MI, Register Reg=Register()) const override
 
MachineInstrcreatePHIDestinationCopy (MachineBasicBlock &MBB, MachineBasicBlock::iterator InsPt, const DebugLoc &DL, Register Src, Register Dst) const override
 
MachineInstrcreatePHISourceCopy (MachineBasicBlock &MBB, MachineBasicBlock::iterator InsPt, const DebugLoc &DL, Register Src, unsigned SrcSubReg, Register Dst) const override
 
bool isWave32 () const
 
MachineInstrBuilder getAddNoCarry (MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, Register DestReg) const
 Return a partially built integer add instruction without carry.
 
MachineInstrBuilder getAddNoCarry (MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, Register DestReg, RegScavenger &RS) const
 
const MCInstrDescgetKillTerminatorFromPseudo (unsigned Opcode) const
 
bool isLegalMUBUFImmOffset (unsigned Imm) const
 
bool splitMUBUFOffset (uint32_t Imm, uint32_t &SOffset, uint32_t &ImmOffset, Align Alignment=Align(4)) const
 
bool isLegalFLATOffset (int64_t Offset, unsigned AddrSpace, uint64_t FlatVariant) const
 Returns if Offset is legal for the subtarget as the offset to a FLAT encoded instruction.
 
std::pair< int64_t, int64_t > splitFlatOffset (int64_t COffsetVal, unsigned AddrSpace, uint64_t FlatVariant) const
 Split COffsetVal into {immediate offset field, remainder offset} values.
 
bool allowNegativeFlatOffset (uint64_t FlatVariant) const
 Returns true if negative offsets are allowed for the given FlatVariant.
 
int pseudoToMCOpcode (int Opcode) const
 Return a target-specific opcode if Opcode is a pseudo instruction.
 
bool isAsmOnlyOpcode (int MCOp) const
 Check if this instruction should only be used by assembler.
 
const TargetRegisterClassgetRegClass (const MCInstrDesc &TID, unsigned OpNum, const TargetRegisterInfo *TRI, const MachineFunction &MF) const override
 
void fixImplicitOperands (MachineInstr &MI) const
 
MachineInstrfoldMemoryOperandImpl (MachineFunction &MF, MachineInstr &MI, ArrayRef< unsigned > Ops, MachineBasicBlock::iterator InsertPt, int FrameIndex, LiveIntervals *LIS=nullptr, VirtRegMap *VRM=nullptr) const override
 
unsigned getInstrLatency (const InstrItineraryData *ItinData, const MachineInstr &MI, unsigned *PredCost=nullptr) const override
 
InstructionUniformity getInstructionUniformity (const MachineInstr &MI) const override final
 
InstructionUniformity getGenericInstructionUniformity (const MachineInstr &MI) const
 
const MIRFormattergetMIRFormatter () const override
 
const TargetSchedModelgetSchedModel () const
 
void enforceOperandRCAlignment (MachineInstr &MI, unsigned OpName) const
 

Static Public Member Functions

static bool isFoldableCopy (const MachineInstr &MI)
 
static bool isSALU (const MachineInstr &MI)
 
static bool isVALU (const MachineInstr &MI)
 
static bool isImage (const MachineInstr &MI)
 
static bool isVMEM (const MachineInstr &MI)
 
static bool isSOP1 (const MachineInstr &MI)
 
static bool isSOP2 (const MachineInstr &MI)
 
static bool isSOPC (const MachineInstr &MI)
 
static bool isSOPK (const MachineInstr &MI)
 
static bool isSOPP (const MachineInstr &MI)
 
static bool isPacked (const MachineInstr &MI)
 
static bool isVOP1 (const MachineInstr &MI)
 
static bool isVOP2 (const MachineInstr &MI)
 
static bool isVOP3 (const MachineInstr &MI)
 
static bool isSDWA (const MachineInstr &MI)
 
static bool isVOPC (const MachineInstr &MI)
 
static bool isMUBUF (const MachineInstr &MI)
 
static bool isMTBUF (const MachineInstr &MI)
 
static bool isSMRD (const MachineInstr &MI)
 
static bool isDS (const MachineInstr &MI)
 
static bool isLDSDMA (const MachineInstr &MI)
 
static bool isGWS (const MachineInstr &MI)
 
static bool isMIMG (const MachineInstr &MI)
 
static bool isVIMAGE (const MachineInstr &MI)
 
static bool isVSAMPLE (const MachineInstr &MI)
 
static bool isGather4 (const MachineInstr &MI)
 
static bool isFLAT (const MachineInstr &MI)
 
static bool isSegmentSpecificFLAT (const MachineInstr &MI)
 
static bool isFLATGlobal (const MachineInstr &MI)
 
static bool isFLATScratch (const MachineInstr &MI)
 
static bool isEXP (const MachineInstr &MI)
 
static bool isDualSourceBlendEXP (const MachineInstr &MI)
 
static bool isAtomicNoRet (const MachineInstr &MI)
 
static bool isAtomicRet (const MachineInstr &MI)
 
static bool isAtomic (const MachineInstr &MI)
 
static bool mayWriteLDSThroughDMA (const MachineInstr &MI)
 
static bool isWQM (const MachineInstr &MI)
 
static bool isDisableWQM (const MachineInstr &MI)
 
static bool isVGPRSpill (const MachineInstr &MI)
 
static bool isSGPRSpill (const MachineInstr &MI)
 
static bool isSpill (const MachineInstr &MI)
 
static bool isWWMRegSpillOpcode (uint16_t Opcode)
 
static bool isChainCallOpcode (uint64_t Opcode)
 
static bool isDPP (const MachineInstr &MI)
 
static bool isTRANS (const MachineInstr &MI)
 
static bool isVOP3P (const MachineInstr &MI)
 
static bool isVINTRP (const MachineInstr &MI)
 
static bool isMAI (const MachineInstr &MI)
 
static bool isMFMA (const MachineInstr &MI)
 
static bool isDOT (const MachineInstr &MI)
 
static bool isWMMA (const MachineInstr &MI)
 
static bool isMFMAorWMMA (const MachineInstr &MI)
 
static bool isSWMMAC (const MachineInstr &MI)
 
static bool isLDSDIR (const MachineInstr &MI)
 
static bool isVINTERP (const MachineInstr &MI)
 
static bool isScalarUnit (const MachineInstr &MI)
 
static bool usesVM_CNT (const MachineInstr &MI)
 
static bool usesLGKM_CNT (const MachineInstr &MI)
 
static bool sopkIsZext (unsigned Opcode)
 
static bool isScalarStore (const MachineInstr &MI)
 
static bool isFixedSize (const MachineInstr &MI)
 
static bool hasFPClamp (const MachineInstr &MI)
 
static bool hasIntClamp (const MachineInstr &MI)
 
static bool usesFPDPRounding (const MachineInstr &MI)
 
static bool isFPAtomic (const MachineInstr &MI)
 
static bool isNeverUniform (const MachineInstr &MI)
 
static bool doesNotReadTiedSource (const MachineInstr &MI)
 
static unsigned getNonSoftWaitcntOpcode (unsigned Opcode)
 
static bool modifiesModeRegister (const MachineInstr &MI)
 Return true if the instruction modifies the mode register.q.
 
static unsigned getNumWaitStates (const MachineInstr &MI)
 Return the number of wait states that result from executing this instruction.
 
static bool isKillTerminator (unsigned Opcode)
 
static unsigned getMaxMUBUFImmOffset (const GCNSubtarget &ST)
 
static unsigned getDSShaderTypeValue (const MachineFunction &MF)
 

Protected Member Functions

std::optional< DestSourcePairisCopyInstrImpl (const MachineInstr &MI) const override
 If the specific machine instruction is a instruction that moves/copies value from one register to another register return destination and source registers as machine operands.
 
bool swapSourceModifiers (MachineInstr &MI, MachineOperand &Src0, unsigned Src0OpName, MachineOperand &Src1, unsigned Src1OpName) const
 
MachineInstrcommuteInstructionImpl (MachineInstr &MI, bool NewMI, unsigned OpIdx0, unsigned OpIdx1) const override
 

Detailed Description

Definition at line 83 of file SIInstrInfo.h.

Member Enumeration Documentation

◆ TargetOperandFlags

Enumerator
MO_MASK 
MO_NONE 
MO_GOTPCREL 
MO_GOTPCREL32 
MO_GOTPCREL32_LO 
MO_GOTPCREL32_HI 
MO_REL32 
MO_REL32_LO 
MO_REL32_HI 
MO_FAR_BRANCH_OFFSET 
MO_ABS32_LO 
MO_ABS32_HI 

Definition at line 197 of file SIInstrInfo.h.

Constructor & Destructor Documentation

◆ SIInstrInfo()

SIInstrInfo::SIInstrInfo ( const GCNSubtarget ST)
explicit

Definition at line 63 of file SIInstrInfo.cpp.

References llvm::TargetSchedModel::init().

Member Function Documentation

◆ allowNegativeFlatOffset()

bool SIInstrInfo::allowNegativeFlatOffset ( uint64_t  FlatVariant) const

Returns true if negative offsets are allowed for the given FlatVariant.

Definition at line 9182 of file SIInstrInfo.cpp.

References llvm::SIInstrFlags::FLAT, llvm::SIInstrFlags::FlatScratch, llvm::GCNSubtarget::hasNegativeScratchOffsetBug(), and llvm::AMDGPU::isGFX12Plus().

Referenced by isLegalFLATOffset(), and splitFlatOffset().

◆ analyzeBranch()

bool SIInstrInfo::analyzeBranch ( MachineBasicBlock MBB,
MachineBasicBlock *&  TBB,
MachineBasicBlock *&  FBB,
SmallVectorImpl< MachineOperand > &  Cond,
bool  AllowModify = false 
) const
override

◆ analyzeBranchImpl()

bool SIInstrInfo::analyzeBranchImpl ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  I,
MachineBasicBlock *&  TBB,
MachineBasicBlock *&  FBB,
SmallVectorImpl< MachineOperand > &  Cond,
bool  AllowModify 
) const

Definition at line 3034 of file SIInstrInfo.cpp.

References Cond, llvm::MachineOperand::CreateImm(), llvm::MachineBasicBlock::end(), I, MBB, and TBB.

Referenced by analyzeBranch().

◆ analyzeCompare()

bool SIInstrInfo::analyzeCompare ( const MachineInstr MI,
Register SrcReg,
Register SrcReg2,
int64_t &  CmpMask,
int64_t &  CmpValue 
) const
override

Definition at line 9711 of file SIInstrInfo.cpp.

References MI.

◆ areLoadsFromSameBasePtr()

bool SIInstrInfo::areLoadsFromSameBasePtr ( SDNode Load0,
SDNode Load1,
int64_t &  Offset0,
int64_t &  Offset1 
) const
override

◆ areMemAccessesTriviallyDisjoint()

bool SIInstrInfo::areMemAccessesTriviallyDisjoint ( const MachineInstr MIa,
const MachineInstr MIb 
) const
override

◆ buildExtractSubReg()

unsigned SIInstrInfo::buildExtractSubReg ( MachineBasicBlock::iterator  MI,
MachineRegisterInfo MRI,
const MachineOperand SuperReg,
const TargetRegisterClass SuperRC,
unsigned  SubIdx,
const TargetRegisterClass SubRC 
) const

◆ buildExtractSubRegOrImm()

MachineOperand SIInstrInfo::buildExtractSubRegOrImm ( MachineBasicBlock::iterator  MI,
MachineRegisterInfo MRI,
const MachineOperand SuperReg,
const TargetRegisterClass SuperRC,
unsigned  SubIdx,
const TargetRegisterClass SubRC 
) const

◆ buildShrunkInst()

MachineInstr * SIInstrInfo::buildShrunkInst ( MachineInstr MI,
unsigned  NewOpcode 
) const

◆ canInsertSelect()

bool SIInstrInfo::canInsertSelect ( const MachineBasicBlock MBB,
ArrayRef< MachineOperand Cond,
Register  DstReg,
Register  TrueReg,
Register  FalseReg,
int &  CondCycles,
int &  TrueCycles,
int &  FalseCycles 
) const
override

◆ canShrink()

bool SIInstrInfo::canShrink ( const MachineInstr MI,
const MachineRegisterInfo MRI 
) const

◆ commuteInstructionImpl()

MachineInstr * SIInstrInfo::commuteInstructionImpl ( MachineInstr MI,
bool  NewMI,
unsigned  OpIdx0,
unsigned  OpIdx1 
) const
overrideprotected

◆ commuteOpcode() [1/2]

LLVM_READONLY int llvm::SIInstrInfo::commuteOpcode ( const MachineInstr MI) const
inline

Definition at line 318 of file SIInstrInfo.h.

References commuteOpcode(), and MI.

◆ commuteOpcode() [2/2]

int SIInstrInfo::commuteOpcode ( unsigned  Opc) const

◆ convertNonUniformIfRegion()

void SIInstrInfo::convertNonUniformIfRegion ( MachineBasicBlock IfEntry,
MachineBasicBlock IfEnd 
) const

◆ convertNonUniformLoopRegion()

void SIInstrInfo::convertNonUniformLoopRegion ( MachineBasicBlock LoopEntry,
MachineBasicBlock LoopEnd 
) const

◆ convertToThreeAddress()

MachineInstr * SIInstrInfo::convertToThreeAddress ( MachineInstr MI,
LiveVariables LV,
LiveIntervals LIS 
) const
override

◆ copyPhysReg()

void SIInstrInfo::copyPhysReg ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
const DebugLoc DL,
MCRegister  DestReg,
MCRegister  SrcReg,
bool  KillSrc 
) const
override

◆ createPHIDestinationCopy()

MachineInstr * SIInstrInfo::createPHIDestinationCopy ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  InsPt,
const DebugLoc DL,
Register  Src,
Register  Dst 
) const
override

◆ createPHISourceCopy()

MachineInstr * SIInstrInfo::createPHISourceCopy ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  InsPt,
const DebugLoc DL,
Register  Src,
unsigned  SrcSubReg,
Register  Dst 
) const
override

◆ CreateTargetMIHazardRecognizer()

ScheduleHazardRecognizer * SIInstrInfo::CreateTargetMIHazardRecognizer ( const InstrItineraryData II,
const ScheduleDAGMI DAG 
) const
override

◆ CreateTargetPostRAHazardRecognizer() [1/2]

ScheduleHazardRecognizer * SIInstrInfo::CreateTargetPostRAHazardRecognizer ( const InstrItineraryData II,
const ScheduleDAG DAG 
) const
override

This is used by the post-RA scheduler (SchedulePostRAList.cpp).

The post-RA version of misched uses CreateTargetMIHazardRecognizer.

Definition at line 8858 of file SIInstrInfo.cpp.

References llvm::ScheduleDAG::MF.

◆ CreateTargetPostRAHazardRecognizer() [2/2]

ScheduleHazardRecognizer * SIInstrInfo::CreateTargetPostRAHazardRecognizer ( const MachineFunction MF) const
override

This is the hazard recognizer used at -O0 by the PostRAHazardRecognizer pass.

Definition at line 8866 of file SIInstrInfo.cpp.

◆ decomposeMachineOperandsTargetFlags()

std::pair< unsigned, unsigned > SIInstrInfo::decomposeMachineOperandsTargetFlags ( unsigned  TF) const
override

Definition at line 8885 of file SIInstrInfo.cpp.

References MO_MASK.

◆ doesNotReadTiedSource() [1/2]

static bool llvm::SIInstrInfo::doesNotReadTiedSource ( const MachineInstr MI)
inlinestatic

Definition at line 949 of file SIInstrInfo.h.

References MI, and llvm::SIInstrFlags::TiedSourceNotRead.

◆ doesNotReadTiedSource() [2/2]

bool llvm::SIInstrInfo::doesNotReadTiedSource ( uint16_t  Opcode) const
inline

Definition at line 953 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::TiedSourceNotRead.

◆ enforceOperandRCAlignment()

void SIInstrInfo::enforceOperandRCAlignment ( MachineInstr MI,
unsigned  OpName 
) const

◆ expandMovDPP64()

std::pair< MachineInstr *, MachineInstr * > SIInstrInfo::expandMovDPP64 ( MachineInstr MI) const

◆ expandPostRAPseudo()

bool SIInstrInfo::expandPostRAPseudo ( MachineInstr MI) const
override

Definition at line 2100 of file SIInstrInfo.cpp.

References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addDef(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::MachineInstr::addRegisterDead(), llvm::MIBundleBuilder::append(), assert(), llvm::MIBundleBuilder::begin(), llvm::BuildMI(), llvm::MachineInstrBuilder::copyImplicitOps(), llvm::RegState::Define, DL, llvm::AMDGPU::VGPRIndexMode::DST_ENABLE, expandMovDPP64(), llvm::TargetInstrInfo::expandPostRAPseudo(), expandPostRAPseudo(), llvm::finalizeBundle(), llvm::MachineBasicBlock::findDebugLoc(), llvm::get(), llvm::SrcOp::getImm(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MCInstrDesc::getNumOperands(), llvm::MachineOperand::getOffset(), llvm::MachineInstr::getOperand(), getOpRegClass(), llvm::MachineBasicBlock::getParent(), llvm::SrcOp::getReg(), llvm::MachineFunction::getRegInfo(), llvm::GCNSubtarget::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), llvm::GCNSubtarget::hasGetPCZeroExtension(), llvm::GCNSubtarget::hasMovB64(), llvm::GCNSubtarget::hasPkMovB32(), llvm::SIRegisterInfo::hasVGPRs(), llvm::Hi, Idx, llvm::RegState::Implicit, llvm::MCInstrDesc::implicit_uses(), llvm::RegState::ImplicitDefine, llvm::SIRegisterInfo::isAGPR(), llvm::MachineOperand::isGlobal(), isInlineConstant(), llvm::GCNSubtarget::isWave32(), llvm::Lo, MBB, MI, llvm::SISrcMods::OP_SEL_0, llvm::SISrcMods::OP_SEL_1, llvm::MachineOperand::setIsUndef(), llvm::MachineOperand::setOffset(), llvm::AMDGPU::VGPRIndexMode::SRC0_ENABLE, SubReg, llvm::MachineInstr::tieOperands(), TRI, llvm::RegState::Undef, and llvm::GCNSubtarget::useVGPRIndexMode().

Referenced by expandPostRAPseudo().

◆ findCommutedOpIndices() [1/2]

bool SIInstrInfo::findCommutedOpIndices ( const MachineInstr MI,
unsigned SrcOpIdx0,
unsigned SrcOpIdx1 
) const
override

Definition at line 2823 of file SIInstrInfo.cpp.

References findCommutedOpIndices(), and MI.

Referenced by findCommutedOpIndices().

◆ findCommutedOpIndices() [2/2]

bool SIInstrInfo::findCommutedOpIndices ( const MCInstrDesc Desc,
unsigned SrcOpIdx0,
unsigned SrcOpIdx1 
) const

Definition at line 2829 of file SIInstrInfo.cpp.

References llvm::AMDGPU::getNamedOperandIdx().

◆ fixImplicitOperands()

void SIInstrInfo::fixImplicitOperands ( MachineInstr MI) const

◆ foldImmediate()

bool SIInstrInfo::foldImmediate ( MachineInstr UseMI,
MachineInstr DefMI,
Register  Reg,
MachineRegisterInfo MRI 
) const
final

◆ foldMemoryOperandImpl()

MachineInstr * SIInstrInfo::foldMemoryOperandImpl ( MachineFunction MF,
MachineInstr MI,
ArrayRef< unsigned Ops,
MachineBasicBlock::iterator  InsertPt,
int  FrameIndex,
LiveIntervals LIS = nullptr,
VirtRegMap VRM = nullptr 
) const
override

◆ getAddNoCarry() [1/2]

MachineInstrBuilder SIInstrInfo::getAddNoCarry ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  I,
const DebugLoc DL,
Register  DestReg 
) const

Return a partially built integer add instruction without carry.

Caller must add source operands. For pre-GFX9 it will generate unused carry destination operand. TODO: After GFX9 it should return a no-carry operation.

Definition at line 8948 of file SIInstrInfo.cpp.

References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::RegState::Dead, llvm::RegState::Define, DL, llvm::get(), llvm::SIRegisterInfo::getBoolRC(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getRegInfo(), llvm::SIRegisterInfo::getVCC(), llvm::GCNSubtarget::hasAddNoCarry(), I, MBB, and MRI.

◆ getAddNoCarry() [2/2]

MachineInstrBuilder SIInstrInfo::getAddNoCarry ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  I,
const DebugLoc DL,
Register  DestReg,
RegScavenger RS 
) const

◆ getBranchDestBlock()

MachineBasicBlock * SIInstrInfo::getBranchDestBlock ( const MachineInstr MI) const
override

Definition at line 2864 of file SIInstrInfo.cpp.

References MI.

◆ getClampMask()

uint64_t llvm::SIInstrInfo::getClampMask ( const MachineInstr MI) const
inline

◆ getDefaultRsrcDataFormat()

uint64_t SIInstrInfo::getDefaultRsrcDataFormat ( ) const

◆ getDSShaderTypeValue()

unsigned SIInstrInfo::getDSShaderTypeValue ( const MachineFunction MF)
static

◆ getGenericInstructionUniformity()

InstructionUniformity SIInstrInfo::getGenericInstructionUniformity ( const MachineInstr MI) const

◆ getIndirectGPRIDXPseudo()

const MCInstrDesc & SIInstrInfo::getIndirectGPRIDXPseudo ( unsigned  VecSize,
bool  IsIndirectSrc 
) const

Definition at line 1397 of file SIInstrInfo.cpp.

References llvm::get(), and llvm_unreachable.

◆ getIndirectRegWriteMovRelPseudo()

const MCInstrDesc & SIInstrInfo::getIndirectRegWriteMovRelPseudo ( unsigned  VecSize,
unsigned  EltSize,
bool  IsSGPR 
) const

◆ getInstBundleSize()

unsigned SIInstrInfo::getInstBundleSize ( const MachineInstr MI) const

Definition at line 8684 of file SIInstrInfo.cpp.

References assert(), getInstSizeInBytes(), I, MI, and Size.

Referenced by getInstSizeInBytes().

◆ getInstrLatency()

unsigned SIInstrInfo::getInstrLatency ( const InstrItineraryData ItinData,
const MachineInstr MI,
unsigned PredCost = nullptr 
) const
override

Definition at line 9538 of file SIInstrInfo.cpp.

References I, and MI.

Referenced by llvm::GCNSubtarget::adjustSchedDependency().

◆ getInstructionUniformity()

InstructionUniformity SIInstrInfo::getInstructionUniformity ( const MachineInstr MI) const
finaloverride

◆ getInstSizeInBytes()

unsigned SIInstrInfo::getInstSizeInBytes ( const MachineInstr MI) const
override

◆ getKillTerminatorFromPseudo()

const MCInstrDesc & SIInstrInfo::getKillTerminatorFromPseudo ( unsigned  Opcode) const

Definition at line 8996 of file SIInstrInfo.cpp.

References llvm::get(), and llvm_unreachable.

◆ getLiveRangeSplitOpcode()

unsigned SIInstrInfo::getLiveRangeSplitOpcode ( Register  Reg,
const MachineFunction MF 
) const
override

◆ getMachineCSELookAheadLimit()

unsigned llvm::SIInstrInfo::getMachineCSELookAheadLimit ( ) const
inlineoverride

Definition at line 399 of file SIInstrInfo.h.

◆ getMaxMUBUFImmOffset()

unsigned SIInstrInfo::getMaxMUBUFImmOffset ( const GCNSubtarget ST)
static

◆ getMCOpcodeFromPseudo()

const MCInstrDesc & llvm::SIInstrInfo::getMCOpcodeFromPseudo ( unsigned  Opcode) const
inline

Return the descriptor of the target-specific machine instruction that corresponds to the specified pseudo or native opcode.

Definition at line 1285 of file SIInstrInfo.h.

References llvm::get(), and pseudoToMCOpcode().

Referenced by getInstSizeInBytes().

◆ getMemOperandsWithOffsetWidth()

bool SIInstrInfo::getMemOperandsWithOffsetWidth ( const MachineInstr LdSt,
SmallVectorImpl< const MachineOperand * > &  BaseOps,
int64_t &  Offset,
bool OffsetIsScalable,
LocationSize Width,
const TargetRegisterInfo TRI 
) const
final

◆ getMIRFormatter()

const MIRFormatter * llvm::SIInstrInfo::getMIRFormatter ( ) const
inlineoverride

Definition at line 1425 of file SIInstrInfo.h.

◆ getMovOpcode()

unsigned SIInstrInfo::getMovOpcode ( const TargetRegisterClass DstRC) const

◆ getNamedImmOperand()

int64_t llvm::SIInstrInfo::getNamedImmOperand ( const MachineInstr MI,
unsigned  OpName 
) const
inline

Get required immediate operand.

Definition at line 1272 of file SIInstrInfo.h.

References llvm::AMDGPU::getNamedOperandIdx(), Idx, and MI.

Referenced by legalizeOperands().

◆ getNamedOperand() [1/2]

LLVM_READONLY const MachineOperand * llvm::SIInstrInfo::getNamedOperand ( const MachineInstr MI,
unsigned  OpName 
) const
inline

Definition at line 1266 of file SIInstrInfo.h.

References getNamedOperand(), and MI.

◆ getNamedOperand() [2/2]

MachineOperand * SIInstrInfo::getNamedOperand ( MachineInstr MI,
unsigned  OperandName 
) const

◆ getNonSoftWaitcntOpcode()

static unsigned llvm::SIInstrInfo::getNonSoftWaitcntOpcode ( unsigned  Opcode)
inlinestatic

Definition at line 957 of file SIInstrInfo.h.

Referenced by isWaitcnt(), isWaitInstr(), and pseudoToMCOpcode().

◆ getNumWaitStates()

unsigned SIInstrInfo::getNumWaitStates ( const MachineInstr MI)
static

Return the number of wait states that result from executing this instruction.

Definition at line 2086 of file SIInstrInfo.cpp.

References MI.

Referenced by llvm::GCNHazardRecognizer::AdvanceCycle().

◆ getOpRegClass()

const TargetRegisterClass * SIInstrInfo::getOpRegClass ( const MachineInstr MI,
unsigned  OpNo 
) const

Return the correct register class for OpNo.

For target-specific instructions, this will return the register class that has been defined in tablegen. For generic instructions, like REG_SEQUENCE it will return the register class of its machine operand. to infer the correct register class base on the other operands.

Definition at line 5619 of file SIInstrInfo.cpp.

References adjustAllocatableRegClass(), llvm::get(), MI, and MRI.

Referenced by expandPostRAPseudo(), getMemOperandsWithOffsetWidth(), getOpSize(), legalizeOperands(), and verifyInstruction().

◆ getOpSize() [1/2]

unsigned llvm::SIInstrInfo::getOpSize ( const MachineInstr MI,
unsigned  OpNo 
) const
inline

This form should usually be preferred since it handles operands with unknown register classes.

Definition at line 1158 of file SIInstrInfo.h.

References getOpRegClass(), llvm::MachineOperand::getSubReg(), llvm::MachineOperand::isReg(), MI, and SubReg.

◆ getOpSize() [2/2]

unsigned llvm::SIInstrInfo::getOpSize ( uint16_t  Opcode,
unsigned  OpNo 
) const
inline

◆ getPreferredSelectRegClass()

const TargetRegisterClass * SIInstrInfo::getPreferredSelectRegClass ( unsigned  Size) const

Definition at line 1222 of file SIInstrInfo.cpp.

◆ getRegClass()

const TargetRegisterClass * SIInstrInfo::getRegClass ( const MCInstrDesc TID,
unsigned  OpNum,
const TargetRegisterInfo TRI,
const MachineFunction MF 
) const
override

◆ getRegisterInfo()

const SIRegisterInfo & llvm::SIInstrInfo::getRegisterInfo ( ) const
inline

◆ getSchedModel()

const TargetSchedModel & llvm::SIInstrInfo::getSchedModel ( ) const
inline

◆ getScratchRsrcWords23()

uint64_t SIInstrInfo::getScratchRsrcWords23 ( ) const

◆ getSerializableDirectMachineOperandTargetFlags()

ArrayRef< std::pair< unsigned, const char * > > SIInstrInfo::getSerializableDirectMachineOperandTargetFlags ( ) const
override

◆ getSerializableMachineMemOperandTargetFlags()

ArrayRef< std::pair< MachineMemOperand::Flags, const char * > > SIInstrInfo::getSerializableMachineMemOperandTargetFlags ( ) const
override

Definition at line 8905 of file SIInstrInfo.cpp.

References llvm::MOLastUse, and llvm::MONoClobber.

◆ getSerializableTargetIndices()

ArrayRef< std::pair< int, const char * > > SIInstrInfo::getSerializableTargetIndices ( ) const
override

◆ getSubtarget()

const GCNSubtarget & llvm::SIInstrInfo::getSubtarget ( ) const
inline

Definition at line 226 of file SIInstrInfo.h.

◆ getVALUOp()

unsigned SIInstrInfo::getVALUOp ( const MachineInstr MI) const

◆ hasAnyModifiersSet()

bool SIInstrInfo::hasAnyModifiersSet ( const MachineInstr MI) const

Definition at line 4412 of file SIInstrInfo.cpp.

References llvm::any_of(), hasModifiersSet(), MI, ModifierOpNames, and Name.

Referenced by foldImmediate().

◆ hasDivergentBranch()

bool SIInstrInfo::hasDivergentBranch ( const MachineBasicBlock MBB) const

Return whether the block terminate with divergent branch.

Note this only work before lowering the pseudo control flow instructions.

Definition at line 2868 of file SIInstrInfo.cpp.

References MBB, MI, and llvm::MachineBasicBlock::terminators().

Referenced by isSafeToSink().

◆ hasFPClamp() [1/2]

static bool llvm::SIInstrInfo::hasFPClamp ( const MachineInstr MI)
inlinestatic

Definition at line 888 of file SIInstrInfo.h.

References llvm::SIInstrFlags::FPClamp, and MI.

◆ hasFPClamp() [2/2]

bool llvm::SIInstrInfo::hasFPClamp ( uint16_t  Opcode) const
inline

Definition at line 892 of file SIInstrInfo.h.

References llvm::SIInstrFlags::FPClamp, and llvm::get().

◆ hasIntClamp()

static bool llvm::SIInstrInfo::hasIntClamp ( const MachineInstr MI)
inlinestatic

Definition at line 896 of file SIInstrInfo.h.

References llvm::SIInstrFlags::IntClamp, and MI.

◆ hasModifiers()

bool SIInstrInfo::hasModifiers ( unsigned  Opcode) const

Return true if this instruction has any modifiers.

e.g. src[012]_mod, omod, clamp.

Definition at line 4399 of file SIInstrInfo.cpp.

References llvm::AMDGPU::hasNamedOperand().

◆ hasModifiersSet()

bool SIInstrInfo::hasModifiersSet ( const MachineInstr MI,
unsigned  OpName 
) const

Definition at line 4406 of file SIInstrInfo.cpp.

References llvm::MachineOperand::getImm(), getNamedOperand(), and MI.

Referenced by canShrink(), and hasAnyModifiersSet().

◆ hasUnwantedEffectsWhenEXECEmpty()

bool SIInstrInfo::hasUnwantedEffectsWhenEXECEmpty ( const MachineInstr MI) const

This function is used to determine if an instruction can be safely executed under EXEC = 0 without hardware error, indeterminate results, and/or visible effects on future vector execution or outside the shader.

Note: as of 2024 the only use of this is SIPreEmitPeephole where it is used in removing branches over short EXEC = 0 sequences. As such it embeds certain assumptions which may not apply to every case of EXEC = 0 execution.

Definition at line 4121 of file SIInstrInfo.cpp.

References isBarrier(), isEXP(), isSMRD(), MI, and modifiesModeRegister().

◆ hasVALU32BitEncoding()

bool SIInstrInfo::hasVALU32BitEncoding ( unsigned  Opcode) const

Return true if this 64-bit VALU instruction has a 32-bit encoding.

This function will return false if you pass it a 32-bit instruction.

Definition at line 4387 of file SIInstrInfo.cpp.

References llvm::AMDGPU::getVOPe32(), llvm::GCNSubtarget::hasGFX90AInsts(), and pseudoToMCOpcode().

Referenced by canShrink().

◆ hasVGPRUses()

bool llvm::SIInstrInfo::hasVGPRUses ( const MachineInstr MI) const
inline

Definition at line 1011 of file SIInstrInfo.h.

References llvm::any_of(), llvm::MachineFunction::getRegInfo(), MI, and MRI.

◆ insertBranch()

unsigned SIInstrInfo::insertBranch ( MachineBasicBlock MBB,
MachineBasicBlock TBB,
MachineBasicBlock FBB,
ArrayRef< MachineOperand Cond,
const DebugLoc DL,
int *  BytesAdded = nullptr 
) const
override

◆ insertEQ()

Register SIInstrInfo::insertEQ ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  I,
const DebugLoc DL,
Register  SrcReg,
int  Value 
) const

◆ insertIndirectBranch()

void SIInstrInfo::insertIndirectBranch ( MachineBasicBlock MBB,
MachineBasicBlock NewDestBB,
MachineBasicBlock RestoreBB,
const DebugLoc DL,
int64_t  BrOffset,
RegScavenger RS 
) const
override

◆ insertNE()

Register SIInstrInfo::insertNE ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  I,
const DebugLoc DL,
Register  SrcReg,
int  Value 
) const

◆ insertNoop()

void SIInstrInfo::insertNoop ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI 
) const
override

Definition at line 1994 of file SIInstrInfo.cpp.

References insertNoops(), MBB, and MI.

◆ insertNoops()

void SIInstrInfo::insertNoops ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
unsigned  Quantity 
) const
override

◆ insertReturn()

void SIInstrInfo::insertReturn ( MachineBasicBlock MBB) const

◆ insertScratchExecCopy()

void SIInstrInfo::insertScratchExecCopy ( MachineFunction MF,
MachineBasicBlock MBB,
MachineBasicBlock::iterator  MBBI,
const DebugLoc DL,
Register  Reg,
bool  IsSCCLive,
SlotIndexes Indexes = nullptr 
) const

◆ insertSelect()

void SIInstrInfo::insertSelect ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  I,
const DebugLoc DL,
Register  DstReg,
ArrayRef< MachineOperand Cond,
Register  TrueReg,
Register  FalseReg 
) const
override

◆ insertSimulatedTrap()

MachineBasicBlock * SIInstrInfo::insertSimulatedTrap ( MachineRegisterInfo MRI,
MachineBasicBlock MBB,
MachineInstr MI,
const DebugLoc DL 
) const

◆ insertVectorSelect()

void SIInstrInfo::insertVectorSelect ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  I,
const DebugLoc DL,
Register  DstReg,
ArrayRef< MachineOperand Cond,
Register  TrueReg,
Register  FalseReg 
) const

◆ isAlwaysGDS()

bool SIInstrInfo::isAlwaysGDS ( uint16_t  Opcode) const

Definition at line 4110 of file SIInstrInfo.cpp.

References isGWS().

◆ isAsmOnlyOpcode()

bool SIInstrInfo::isAsmOnlyOpcode ( int  MCOp) const

Check if this instruction should only be used by assembler.

Return true if this opcode should not be used by codegen.

Definition at line 9210 of file SIInstrInfo.cpp.

Referenced by pseudoToMCOpcode().

◆ isAtomic() [1/2]

static bool llvm::SIInstrInfo::isAtomic ( const MachineInstr MI)
inlinestatic

◆ isAtomic() [2/2]

bool llvm::SIInstrInfo::isAtomic ( uint16_t  Opcode) const
inline

◆ isAtomicNoRet() [1/2]

static bool llvm::SIInstrInfo::isAtomicNoRet ( const MachineInstr MI)
inlinestatic

Definition at line 665 of file SIInstrInfo.h.

References llvm::SIInstrFlags::IsAtomicNoRet, and MI.

◆ isAtomicNoRet() [2/2]

bool llvm::SIInstrInfo::isAtomicNoRet ( uint16_t  Opcode) const
inline

Definition at line 669 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::IsAtomicNoRet.

◆ isAtomicRet() [1/2]

static bool llvm::SIInstrInfo::isAtomicRet ( const MachineInstr MI)
inlinestatic

Definition at line 673 of file SIInstrInfo.h.

References llvm::SIInstrFlags::IsAtomicRet, and MI.

◆ isAtomicRet() [2/2]

bool llvm::SIInstrInfo::isAtomicRet ( uint16_t  Opcode) const
inline

Definition at line 677 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::IsAtomicRet.

◆ isBarrier()

bool llvm::SIInstrInfo::isBarrier ( unsigned  Opcode) const
inline

Definition at line 939 of file SIInstrInfo.h.

References isBarrierStart().

Referenced by hasUnwantedEffectsWhenEXECEmpty().

◆ isBarrierStart()

bool llvm::SIInstrInfo::isBarrierStart ( unsigned  Opcode) const
inline

Definition at line 931 of file SIInstrInfo.h.

Referenced by isBarrier().

◆ isBasicBlockPrologue()

bool SIInstrInfo::isBasicBlockPrologue ( const MachineInstr MI,
Register  Reg = Register() 
) const
override

◆ isBranchOffsetInRange()

bool SIInstrInfo::isBranchOffsetInRange ( unsigned  BranchOpc,
int64_t  BrOffset 
) const
override

Definition at line 2847 of file SIInstrInfo.cpp.

References assert(), BranchOffsetBits, and llvm::isIntN().

◆ isBufferSMRD()

bool SIInstrInfo::isBufferSMRD ( const MachineInstr MI) const

◆ isChainCallOpcode()

static bool llvm::SIInstrInfo::isChainCallOpcode ( uint64_t  Opcode)
inlinestatic

Definition at line 755 of file SIInstrInfo.h.

◆ isCopyInstrImpl()

std::optional< DestSourcePair > SIInstrInfo::isCopyInstrImpl ( const MachineInstr MI) const
overrideprotected

If the specific machine instruction is a instruction that moves/copies value from one register to another register return destination and source registers as machine operands.

Definition at line 2711 of file SIInstrInfo.cpp.

References MI.

◆ isDisableWQM() [1/2]

static bool llvm::SIInstrInfo::isDisableWQM ( const MachineInstr MI)
inlinestatic

Definition at line 703 of file SIInstrInfo.h.

References llvm::SIInstrFlags::DisableWQM, and MI.

◆ isDisableWQM() [2/2]

bool llvm::SIInstrInfo::isDisableWQM ( uint16_t  Opcode) const
inline

Definition at line 707 of file SIInstrInfo.h.

References llvm::SIInstrFlags::DisableWQM, and llvm::get().

◆ isDOT() [1/2]

static bool llvm::SIInstrInfo::isDOT ( const MachineInstr MI)
inlinestatic

Definition at line 805 of file SIInstrInfo.h.

References llvm::SIInstrFlags::IsDOT, and MI.

◆ isDOT() [2/2]

bool llvm::SIInstrInfo::isDOT ( uint16_t  Opcode) const
inline

Definition at line 829 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::IsDOT.

◆ isDPP() [1/2]

static bool llvm::SIInstrInfo::isDPP ( const MachineInstr MI)
inlinestatic

◆ isDPP() [2/2]

bool llvm::SIInstrInfo::isDPP ( uint16_t  Opcode) const
inline

Definition at line 764 of file SIInstrInfo.h.

References llvm::SIInstrFlags::DPP, and llvm::get().

◆ isDS() [1/2]

static bool llvm::SIInstrInfo::isDS ( const MachineInstr MI)
inlinestatic

◆ isDS() [2/2]

bool llvm::SIInstrInfo::isDS ( uint16_t  Opcode) const
inline

Definition at line 558 of file SIInstrInfo.h.

References llvm::SIInstrFlags::DS, and llvm::get().

◆ isDualSourceBlendEXP()

static bool llvm::SIInstrInfo::isDualSourceBlendEXP ( const MachineInstr MI)
inlinestatic

◆ isEXP() [1/2]

static bool llvm::SIInstrInfo::isEXP ( const MachineInstr MI)
inlinestatic

◆ isEXP() [2/2]

bool llvm::SIInstrInfo::isEXP ( uint16_t  Opcode) const
inline

Definition at line 661 of file SIInstrInfo.h.

References llvm::SIInstrFlags::EXP, and llvm::get().

◆ isFixedSize() [1/2]

static bool llvm::SIInstrInfo::isFixedSize ( const MachineInstr MI)
inlinestatic

Definition at line 880 of file SIInstrInfo.h.

References llvm::SIInstrFlags::FIXED_SIZE, and MI.

Referenced by getInstSizeInBytes().

◆ isFixedSize() [2/2]

bool llvm::SIInstrInfo::isFixedSize ( uint16_t  Opcode) const
inline

Definition at line 884 of file SIInstrInfo.h.

References llvm::SIInstrFlags::FIXED_SIZE, and llvm::get().

◆ isFLAT() [1/2]

static bool llvm::SIInstrInfo::isFLAT ( const MachineInstr MI)
inlinestatic

◆ isFLAT() [2/2]

bool llvm::SIInstrInfo::isFLAT ( uint16_t  Opcode) const
inline

Definition at line 645 of file SIInstrInfo.h.

References llvm::SIInstrFlags::FLAT, and llvm::get().

◆ isFLATGlobal() [1/2]

static bool llvm::SIInstrInfo::isFLATGlobal ( const MachineInstr MI)
inlinestatic

Definition at line 628 of file SIInstrInfo.h.

References llvm::SIInstrFlags::FlatGlobal, and MI.

Referenced by areMemAccessesTriviallyDisjoint().

◆ isFLATGlobal() [2/2]

bool llvm::SIInstrInfo::isFLATGlobal ( uint16_t  Opcode) const
inline

Definition at line 632 of file SIInstrInfo.h.

References llvm::SIInstrFlags::FlatGlobal, and llvm::get().

◆ isFLATScratch() [1/2]

static bool llvm::SIInstrInfo::isFLATScratch ( const MachineInstr MI)
inlinestatic

◆ isFLATScratch() [2/2]

bool llvm::SIInstrInfo::isFLATScratch ( uint16_t  Opcode) const
inline

Definition at line 640 of file SIInstrInfo.h.

References llvm::SIInstrFlags::FlatScratch, and llvm::get().

◆ isFoldableCopy()

bool SIInstrInfo::isFoldableCopy ( const MachineInstr MI)
static

Definition at line 3370 of file SIInstrInfo.cpp.

References MI.

Referenced by getFoldableImm().

◆ isFPAtomic() [1/2]

static bool llvm::SIInstrInfo::isFPAtomic ( const MachineInstr MI)
inlinestatic

Definition at line 916 of file SIInstrInfo.h.

References llvm::SIInstrFlags::FPAtomic, and MI.

◆ isFPAtomic() [2/2]

bool llvm::SIInstrInfo::isFPAtomic ( uint16_t  Opcode) const
inline

Definition at line 920 of file SIInstrInfo.h.

References llvm::SIInstrFlags::FPAtomic, and llvm::get().

◆ isGather4() [1/2]

static bool llvm::SIInstrInfo::isGather4 ( const MachineInstr MI)
inlinestatic

Definition at line 604 of file SIInstrInfo.h.

References llvm::SIInstrFlags::Gather4, and MI.

Referenced by verifyInstruction().

◆ isGather4() [2/2]

bool llvm::SIInstrInfo::isGather4 ( uint16_t  Opcode) const
inline

Definition at line 608 of file SIInstrInfo.h.

References llvm::SIInstrFlags::Gather4, and llvm::get().

◆ isGWS() [1/2]

static bool llvm::SIInstrInfo::isGWS ( const MachineInstr MI)
inlinestatic

Definition at line 570 of file SIInstrInfo.h.

References llvm::SIInstrFlags::GWS, and MI.

Referenced by isAlwaysGDS().

◆ isGWS() [2/2]

bool llvm::SIInstrInfo::isGWS ( uint16_t  Opcode) const
inline

Definition at line 574 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::GWS.

◆ isHighLatencyDef()

bool SIInstrInfo::isHighLatencyDef ( int  Opc) const
override

Definition at line 8630 of file SIInstrInfo.cpp.

References llvm::get(), isFLAT(), isMIMG(), isMTBUF(), and isMUBUF().

Referenced by llvm::SIScheduleDAGMI::schedule().

◆ isIgnorableUse()

bool SIInstrInfo::isIgnorableUse ( const MachineOperand MO) const
override

◆ isImage() [1/2]

static bool llvm::SIInstrInfo::isImage ( const MachineInstr MI)
inlinestatic

◆ isImage() [2/2]

bool llvm::SIInstrInfo::isImage ( uint16_t  Opcode) const
inline

Definition at line 428 of file SIInstrInfo.h.

References isMIMG(), isVIMAGE(), and isVSAMPLE().

◆ isImmOperandLegal()

bool SIInstrInfo::isImmOperandLegal ( const MachineInstr MI,
unsigned  OpNo,
const MachineOperand MO 
) const

◆ isInlineConstant() [1/8]

bool SIInstrInfo::isInlineConstant ( const APFloat Imm) const

◆ isInlineConstant() [2/8]

bool SIInstrInfo::isInlineConstant ( const APInt Imm) const

◆ isInlineConstant() [3/8]

bool llvm::SIInstrInfo::isInlineConstant ( const MachineInstr MI,
const MachineOperand UseMO,
const MachineOperand DefMO 
) const
inline

returns true if UseMO is substituted with DefMO in MI it would be an inline immediate.

Definition at line 1055 of file SIInstrInfo.h.

References assert(), llvm::MachineOperand::getOperandNo(), llvm::MachineOperand::getParent(), isInlineConstant(), and MI.

◆ isInlineConstant() [4/8]

bool llvm::SIInstrInfo::isInlineConstant ( const MachineInstr MI,
unsigned  OpIdx 
) const
inline

returns true if the operand OpIdx in MI is a valid inline immediate.

Definition at line 1068 of file SIInstrInfo.h.

References isInlineConstant(), and MI.

◆ isInlineConstant() [5/8]

bool llvm::SIInstrInfo::isInlineConstant ( const MachineInstr MI,
unsigned  OpIdx,
const MachineOperand MO 
) const
inline

◆ isInlineConstant() [6/8]

bool llvm::SIInstrInfo::isInlineConstant ( const MachineOperand MO) const
inline

◆ isInlineConstant() [7/8]

bool llvm::SIInstrInfo::isInlineConstant ( const MachineOperand MO,
const MCOperandInfo OpInfo 
) const
inline

Definition at line 1048 of file SIInstrInfo.h.

References isInlineConstant(), and llvm::MCOperandInfo::OperandType.

◆ isInlineConstant() [8/8]

bool SIInstrInfo::isInlineConstant ( const MachineOperand MO,
uint8_t  OperandType 
) const

Definition at line 4231 of file SIInstrInfo.cpp.

References assert(), llvm::MachineOperand::getImm(), llvm::AMDGPUSubtarget::has16BitInsts(), llvm::AMDGPUSubtarget::hasInv2PiInlineImm(), llvm::MachineOperand::isImm(), llvm::AMDGPU::isInlinableIntLiteral(), llvm::AMDGPU::isInlinableLiteral32(), llvm::AMDGPU::isInlinableLiteral64(), llvm::AMDGPU::isInlinableLiteralBF16(), llvm::AMDGPU::isInlinableLiteralFP16(), llvm::AMDGPU::isInlinableLiteralV2BF16(), llvm::AMDGPU::isInlinableLiteralV2F16(), llvm::AMDGPU::isInlinableLiteralV2I16(), llvm::MachineOperand::isReg(), llvm_unreachable, llvm::MCOI::OPERAND_GENERIC_0, llvm::MCOI::OPERAND_GENERIC_1, llvm::MCOI::OPERAND_GENERIC_2, llvm::MCOI::OPERAND_GENERIC_3, llvm::MCOI::OPERAND_GENERIC_4, llvm::MCOI::OPERAND_GENERIC_5, llvm::MCOI::OPERAND_IMMEDIATE, llvm::AMDGPU::OPERAND_INLINE_SPLIT_BARRIER_INT32, llvm::AMDGPU::OPERAND_INPUT_MODS, llvm::AMDGPU::OPERAND_KIMM16, llvm::AMDGPU::OPERAND_KIMM32, llvm::MCOI::OPERAND_PCREL, llvm::AMDGPU::OPERAND_REG_IMM_BF16, llvm::AMDGPU::OPERAND_REG_IMM_BF16_DEFERRED, llvm::AMDGPU::OPERAND_REG_IMM_FP16, llvm::AMDGPU::OPERAND_REG_IMM_FP16_DEFERRED, llvm::AMDGPU::OPERAND_REG_IMM_FP32, llvm::AMDGPU::OPERAND_REG_IMM_FP32_DEFERRED, llvm::AMDGPU::OPERAND_REG_IMM_FP64, llvm::AMDGPU::OPERAND_REG_IMM_INT16, llvm::AMDGPU::OPERAND_REG_IMM_INT32, llvm::AMDGPU::OPERAND_REG_IMM_INT64, llvm::AMDGPU::OPERAND_REG_IMM_V2BF16, llvm::AMDGPU::OPERAND_REG_IMM_V2FP16, llvm::AMDGPU::OPERAND_REG_IMM_V2FP32, llvm::AMDGPU::OPERAND_REG_IMM_V2INT16, llvm::AMDGPU::OPERAND_REG_IMM_V2INT32, llvm::AMDGPU::OPERAND_REG_INLINE_AC_BF16, llvm::AMDGPU::OPERAND_REG_INLINE_AC_FP16, llvm::AMDGPU::OPERAND_REG_INLINE_AC_FP32, llvm::AMDGPU::OPERAND_REG_INLINE_AC_FP64, llvm::AMDGPU::OPERAND_REG_INLINE_AC_INT16, llvm::AMDGPU::OPERAND_REG_INLINE_AC_INT32, llvm::AMDGPU::OPERAND_REG_INLINE_AC_V2BF16, llvm::AMDGPU::OPERAND_REG_INLINE_AC_V2FP16, llvm::AMDGPU::OPERAND_REG_INLINE_AC_V2INT16, llvm::AMDGPU::OPERAND_REG_INLINE_C_BF16, llvm::AMDGPU::OPERAND_REG_INLINE_C_FP16, llvm::AMDGPU::OPERAND_REG_INLINE_C_FP32, llvm::AMDGPU::OPERAND_REG_INLINE_C_FP64, llvm::AMDGPU::OPERAND_REG_INLINE_C_INT16, llvm::AMDGPU::OPERAND_REG_INLINE_C_INT32, llvm::AMDGPU::OPERAND_REG_INLINE_C_INT64, llvm::AMDGPU::OPERAND_REG_INLINE_C_V2BF16, llvm::AMDGPU::OPERAND_REG_INLINE_C_V2FP16, llvm::AMDGPU::OPERAND_REG_INLINE_C_V2FP32, llvm::AMDGPU::OPERAND_REG_INLINE_C_V2INT16, llvm::AMDGPU::OPERAND_REG_INLINE_C_V2INT32, llvm::MCOI::OPERAND_REGISTER, and llvm::MCOI::OPERAND_UNKNOWN.

◆ isKillTerminator()

bool SIInstrInfo::isKillTerminator ( unsigned  Opcode)
static

Definition at line 8986 of file SIInstrInfo.cpp.

◆ isLDSDIR() [1/2]

static bool llvm::SIInstrInfo::isLDSDIR ( const MachineInstr MI)
inlinestatic

Definition at line 833 of file SIInstrInfo.h.

References llvm::SIInstrFlags::LDSDIR, and MI.

◆ isLDSDIR() [2/2]

bool llvm::SIInstrInfo::isLDSDIR ( uint16_t  Opcode) const
inline

Definition at line 837 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::LDSDIR.

◆ isLDSDMA() [1/2]

static bool llvm::SIInstrInfo::isLDSDMA ( const MachineInstr MI)
inlinestatic

Definition at line 562 of file SIInstrInfo.h.

References isFLAT(), isMUBUF(), isVALU(), and MI.

Referenced by areMemAccessesTriviallyDisjoint(), and mayWriteLDSThroughDMA().

◆ isLDSDMA() [2/2]

bool llvm::SIInstrInfo::isLDSDMA ( uint16_t  Opcode)
inline

Definition at line 566 of file SIInstrInfo.h.

References isFLAT(), isMUBUF(), and isVALU().

◆ isLegalFLATOffset()

bool SIInstrInfo::isLegalFLATOffset ( int64_t  Offset,
unsigned  AddrSpace,
uint64_t  FlatVariant 
) const

◆ isLegalMUBUFImmOffset()

bool SIInstrInfo::isLegalMUBUFImmOffset ( unsigned  Imm) const

Definition at line 9007 of file SIInstrInfo.cpp.

References getMaxMUBUFImmOffset().

◆ isLegalRegOperand()

bool SIInstrInfo::isLegalRegOperand ( const MachineRegisterInfo MRI,
const MCOperandInfo OpInfo,
const MachineOperand MO 
) const

◆ isLegalVSrcOperand()

bool SIInstrInfo::isLegalVSrcOperand ( const MachineRegisterInfo MRI,
const MCOperandInfo OpInfo,
const MachineOperand MO 
) const

Check if MO would be a valid operand for the given operand definition OpInfo.

Note this does not attempt to validate constant bus restrictions (e.g. literal constant usage).

Definition at line 5726 of file SIInstrInfo.cpp.

References assert(), llvm::MachineOperand::isFI(), llvm::MachineOperand::isGlobal(), llvm::MachineOperand::isImm(), isLegalRegOperand(), llvm::MachineOperand::isReg(), llvm::MachineOperand::isTargetIndex(), and MRI.

◆ isLoadFromStackSlot()

Register SIInstrInfo::isLoadFromStackSlot ( const MachineInstr MI,
int &  FrameIndex 
) const
override

◆ isLowLatencyInstruction()

bool SIInstrInfo::isLowLatencyInstruction ( const MachineInstr MI) const

Definition at line 8624 of file SIInstrInfo.cpp.

References isSMRD(), and MI.

Referenced by llvm::SIScheduleDAGMI::schedule().

◆ isMAI() [1/2]

static bool llvm::SIInstrInfo::isMAI ( const MachineInstr MI)
inlinestatic

◆ isMAI() [2/2]

bool llvm::SIInstrInfo::isMAI ( uint16_t  Opcode) const
inline

Definition at line 796 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::IsMAI.

◆ isMFMA()

static bool llvm::SIInstrInfo::isMFMA ( const MachineInstr MI)
inlinestatic

Definition at line 800 of file SIInstrInfo.h.

References isMAI(), and MI.

Referenced by isMFMAorWMMA(), and llvm::GCNHazardRecognizer::ShouldPreferAnother().

◆ isMFMAorWMMA()

static bool llvm::SIInstrInfo::isMFMAorWMMA ( const MachineInstr MI)
inlinestatic

Definition at line 817 of file SIInstrInfo.h.

References isMFMA(), isSWMMAC(), isWMMA(), and MI.

◆ isMIMG() [1/2]

static bool llvm::SIInstrInfo::isMIMG ( const MachineInstr MI)
inlinestatic

◆ isMIMG() [2/2]

bool llvm::SIInstrInfo::isMIMG ( uint16_t  Opcode) const
inline

Definition at line 584 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::MIMG.

◆ isMTBUF() [1/2]

static bool llvm::SIInstrInfo::isMTBUF ( const MachineInstr MI)
inlinestatic

◆ isMTBUF() [2/2]

bool llvm::SIInstrInfo::isMTBUF ( uint16_t  Opcode) const
inline

Definition at line 540 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::MTBUF.

◆ isMUBUF() [1/2]

static bool llvm::SIInstrInfo::isMUBUF ( const MachineInstr MI)
inlinestatic

◆ isMUBUF() [2/2]

bool llvm::SIInstrInfo::isMUBUF ( uint16_t  Opcode) const
inline

Definition at line 532 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::MUBUF.

◆ isNeverUniform()

static bool llvm::SIInstrInfo::isNeverUniform ( const MachineInstr MI)
inlinestatic

Definition at line 924 of file SIInstrInfo.h.

References llvm::SIInstrFlags::IsNeverUniform, and MI.

Referenced by getInstructionUniformity().

◆ isNonUniformBranchInstr()

bool SIInstrInfo::isNonUniformBranchInstr ( MachineInstr Instr) const

Definition at line 8771 of file SIInstrInfo.cpp.

◆ isOperandLegal()

bool SIInstrInfo::isOperandLegal ( const MachineInstr MI,
unsigned  OpIdx,
const MachineOperand MO = nullptr 
) const

Check if MO is a legal operand if it was the OpIdx Operand for MI.

Definition at line 5737 of file SIInstrInfo.cpp.

References assert(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::count(), llvm::GCNSubtarget::getConstantBusLimit(), llvm::MachineOperand::getImm(), llvm::AMDGPU::getNamedOperandIdx(), llvm::MachineOperand::getReg(), llvm::SIRegisterInfo::getRegClass(), llvm::MachineFunction::getRegInfo(), llvm::MachineOperand::getSubReg(), llvm::GCNSubtarget::hasGFX90AInsts(), llvm::AMDGPUSubtarget::hasInv2PiInlineImm(), llvm::GCNSubtarget::hasMAIInsts(), llvm::GCNSubtarget::hasVOP3Literal(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::insert(), llvm::SIRegisterInfo::isAGPR(), isDS(), llvm::MachineOperand::isFI(), llvm::MachineOperand::isGlobal(), llvm::MachineOperand::isImm(), isImmOperandLegal(), llvm::AMDGPU::isInlinableLiteral64(), isInlineConstant(), isLegalRegOperand(), isMIMG(), llvm::MachineOperand::isReg(), llvm::SIRegisterInfo::isSGPRReg(), llvm::AMDGPU::isSISrcOperand(), llvm::MachineOperand::isTargetIndex(), llvm::AMDGPU::isValid32BitLiteral(), isVALU(), isVOP3(), MI, MRI, llvm::AMDGPU::OPERAND_REG_IMM_FP64, llvm::AMDGPU::OPERAND_REG_IMM_INT64, llvm::AMDGPU::OPERAND_REG_IMM_V2FP32, llvm::AMDGPU::OPERAND_REG_IMM_V2INT32, llvm::MCOI::OPERAND_UNKNOWN, llvm::MCInstrDesc::operands(), llvm::MCOperandInfo::OperandType, llvm::MCOperandInfo::RegClass, and usesConstantBus().

Referenced by commuteInstructionImpl(), convertToThreeAddress(), and legalizeOperandsVOP3().

◆ isPacked() [1/2]

static bool llvm::SIInstrInfo::isPacked ( const MachineInstr MI)
inlinestatic

Definition at line 480 of file SIInstrInfo.h.

References llvm::SIInstrFlags::IsPacked, and MI.

◆ isPacked() [2/2]

bool llvm::SIInstrInfo::isPacked ( uint16_t  Opcode) const
inline

Definition at line 484 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::IsPacked.

◆ isReallyTriviallyReMaterializable()

bool SIInstrInfo::isReallyTriviallyReMaterializable ( const MachineInstr MI) const
override

◆ isSafeToSink()

bool SIInstrInfo::isSafeToSink ( MachineInstr MI,
MachineBasicBlock SuccToSinkTo,
MachineCycleInfo CI 
) const
override

◆ isSALU() [1/2]

static bool llvm::SIInstrInfo::isSALU ( const MachineInstr MI)
inlinestatic

Definition at line 408 of file SIInstrInfo.h.

References MI, and llvm::SIInstrFlags::SALU.

Referenced by canRemat(), getInstSizeInBytes(), isSGPRSpill(), mayReadEXEC(), and shouldReadExec().

◆ isSALU() [2/2]

bool llvm::SIInstrInfo::isSALU ( uint16_t  Opcode) const
inline

Definition at line 412 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::SALU.

◆ isScalarStore() [1/2]

static bool llvm::SIInstrInfo::isScalarStore ( const MachineInstr MI)
inlinestatic
Returns
true if this is an s_store_dword* instruction. This is more specific than isSMEM && mayStore.

Definition at line 872 of file SIInstrInfo.h.

References MI, and llvm::SIInstrFlags::SCALAR_STORE.

◆ isScalarStore() [2/2]

bool llvm::SIInstrInfo::isScalarStore ( uint16_t  Opcode) const
inline

Definition at line 876 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::SCALAR_STORE.

◆ isScalarUnit()

static bool llvm::SIInstrInfo::isScalarUnit ( const MachineInstr MI)
inlinestatic

Definition at line 849 of file SIInstrInfo.h.

References MI, llvm::SIInstrFlags::SALU, and llvm::SIInstrFlags::SMRD.

◆ isSchedulingBoundary()

bool SIInstrInfo::isSchedulingBoundary ( const MachineInstr MI,
const MachineBasicBlock MBB,
const MachineFunction MF 
) const
override

Definition at line 4079 of file SIInstrInfo.cpp.

References changesVGPRIndexingMode(), and MI.

◆ isSDWA() [1/2]

static bool llvm::SIInstrInfo::isSDWA ( const MachineInstr MI)
inlinestatic

Definition at line 512 of file SIInstrInfo.h.

References MI, and llvm::SIInstrFlags::SDWA.

Referenced by canRemat(), and verifyInstruction().

◆ isSDWA() [2/2]

bool llvm::SIInstrInfo::isSDWA ( uint16_t  Opcode) const
inline

Definition at line 516 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::SDWA.

◆ isSegmentSpecificFLAT() [1/2]

static bool llvm::SIInstrInfo::isSegmentSpecificFLAT ( const MachineInstr MI)
inlinestatic

◆ isSegmentSpecificFLAT() [2/2]

bool llvm::SIInstrInfo::isSegmentSpecificFLAT ( uint16_t  Opcode) const
inline

◆ isSGPRSpill() [1/2]

static bool llvm::SIInstrInfo::isSGPRSpill ( const MachineInstr MI)
inlinestatic

Definition at line 728 of file SIInstrInfo.h.

References isSALU(), isSpill(), and MI.

Referenced by isLoadFromStackSlot(), and isStoreToStackSlot().

◆ isSGPRSpill() [2/2]

bool llvm::SIInstrInfo::isSGPRSpill ( uint16_t  Opcode) const
inline

Definition at line 734 of file SIInstrInfo.h.

References isSALU(), and isSpill().

◆ isSGPRStackAccess()

unsigned SIInstrInfo::isSGPRStackAccess ( const MachineInstr MI,
int &  FrameIndex 
) const

◆ isSMRD() [1/2]

static bool llvm::SIInstrInfo::isSMRD ( const MachineInstr MI)
inlinestatic

◆ isSMRD() [2/2]

bool llvm::SIInstrInfo::isSMRD ( uint16_t  Opcode) const
inline

Definition at line 548 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::SMRD.

◆ isSOP1() [1/2]

static bool llvm::SIInstrInfo::isSOP1 ( const MachineInstr MI)
inlinestatic

Definition at line 440 of file SIInstrInfo.h.

References MI, and llvm::SIInstrFlags::SOP1.

◆ isSOP1() [2/2]

bool llvm::SIInstrInfo::isSOP1 ( uint16_t  Opcode) const
inline

Definition at line 444 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::SOP1.

◆ isSOP2() [1/2]

static bool llvm::SIInstrInfo::isSOP2 ( const MachineInstr MI)
inlinestatic

Definition at line 448 of file SIInstrInfo.h.

References MI, and llvm::SIInstrFlags::SOP2.

Referenced by verifyInstruction().

◆ isSOP2() [2/2]

bool llvm::SIInstrInfo::isSOP2 ( uint16_t  Opcode) const
inline

Definition at line 452 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::SOP2.

◆ isSOPC() [1/2]

static bool llvm::SIInstrInfo::isSOPC ( const MachineInstr MI)
inlinestatic

Definition at line 456 of file SIInstrInfo.h.

References MI, and llvm::SIInstrFlags::SOPC.

Referenced by verifyInstruction().

◆ isSOPC() [2/2]

bool llvm::SIInstrInfo::isSOPC ( uint16_t  Opcode) const
inline

Definition at line 460 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::SOPC.

◆ isSOPK() [1/2]

static bool llvm::SIInstrInfo::isSOPK ( const MachineInstr MI)
inlinestatic

Definition at line 464 of file SIInstrInfo.h.

References MI, and llvm::SIInstrFlags::SOPK.

Referenced by verifyInstruction().

◆ isSOPK() [2/2]

bool llvm::SIInstrInfo::isSOPK ( uint16_t  Opcode) const
inline

Definition at line 468 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::SOPK.

◆ isSOPP() [1/2]

static bool llvm::SIInstrInfo::isSOPP ( const MachineInstr MI)
inlinestatic

Definition at line 472 of file SIInstrInfo.h.

References MI, and llvm::SIInstrFlags::SOPP.

◆ isSOPP() [2/2]

bool llvm::SIInstrInfo::isSOPP ( uint16_t  Opcode) const
inline

Definition at line 476 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::SOPP.

◆ isSpill() [1/2]

static bool llvm::SIInstrInfo::isSpill ( const MachineInstr MI)
inlinestatic

Definition at line 744 of file SIInstrInfo.h.

References MI, and llvm::SIInstrFlags::Spill.

◆ isSpill() [2/2]

bool llvm::SIInstrInfo::isSpill ( uint16_t  Opcode) const
inline

Definition at line 740 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::Spill.

Referenced by isBasicBlockPrologue(), isSGPRSpill(), and isVGPRSpill().

◆ isStackAccess()

unsigned SIInstrInfo::isStackAccess ( const MachineInstr MI,
int &  FrameIndex 
) const

◆ isStoreToStackSlot()

Register SIInstrInfo::isStoreToStackSlot ( const MachineInstr MI,
int &  FrameIndex 
) const
override

◆ isSWMMAC() [1/2]

static bool llvm::SIInstrInfo::isSWMMAC ( const MachineInstr MI)
inlinestatic

Definition at line 821 of file SIInstrInfo.h.

References llvm::SIInstrFlags::IsSWMMAC, and MI.

Referenced by isMFMAorWMMA().

◆ isSWMMAC() [2/2]

bool llvm::SIInstrInfo::isSWMMAC ( uint16_t  Opcode) const
inline

Definition at line 825 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::IsSWMMAC.

◆ isTRANS() [1/2]

static bool llvm::SIInstrInfo::isTRANS ( const MachineInstr MI)
inlinestatic

Definition at line 768 of file SIInstrInfo.h.

References MI, and llvm::SIInstrFlags::TRANS.

◆ isTRANS() [2/2]

bool llvm::SIInstrInfo::isTRANS ( uint16_t  Opcode) const
inline

Definition at line 772 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::TRANS.

◆ isVALU() [1/2]

static bool llvm::SIInstrInfo::isVALU ( const MachineInstr MI)
inlinestatic

◆ isVALU() [2/2]

bool llvm::SIInstrInfo::isVALU ( uint16_t  Opcode) const
inline

Definition at line 420 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::VALU.

◆ isVGPRCopy()

bool llvm::SIInstrInfo::isVGPRCopy ( const MachineInstr MI) const
inline

◆ isVGPRSpill() [1/2]

static bool llvm::SIInstrInfo::isVGPRSpill ( const MachineInstr MI)
inlinestatic

Definition at line 716 of file SIInstrInfo.h.

References isSpill(), isVALU(), and MI.

Referenced by isLoadFromStackSlot(), isStoreToStackSlot(), and verifyInstruction().

◆ isVGPRSpill() [2/2]

bool llvm::SIInstrInfo::isVGPRSpill ( uint16_t  Opcode) const
inline

Definition at line 722 of file SIInstrInfo.h.

References isSpill(), and isVALU().

◆ isVIMAGE() [1/2]

static bool llvm::SIInstrInfo::isVIMAGE ( const MachineInstr MI)
inlinestatic

Definition at line 588 of file SIInstrInfo.h.

References MI, and llvm::SIInstrFlags::VIMAGE.

Referenced by isImage(), and legalizeOperands().

◆ isVIMAGE() [2/2]

bool llvm::SIInstrInfo::isVIMAGE ( uint16_t  Opcode) const
inline

Definition at line 592 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::VIMAGE.

◆ isVINTERP() [1/2]

static bool llvm::SIInstrInfo::isVINTERP ( const MachineInstr MI)
inlinestatic

Definition at line 841 of file SIInstrInfo.h.

References MI, and llvm::SIInstrFlags::VINTERP.

◆ isVINTERP() [2/2]

bool llvm::SIInstrInfo::isVINTERP ( uint16_t  Opcode) const
inline

Definition at line 845 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::VINTERP.

◆ isVINTRP() [1/2]

static bool llvm::SIInstrInfo::isVINTRP ( const MachineInstr MI)
inlinestatic

◆ isVINTRP() [2/2]

bool llvm::SIInstrInfo::isVINTRP ( uint16_t  Opcode) const
inline

Definition at line 788 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::VINTRP.

◆ isVMEM() [1/2]

static bool llvm::SIInstrInfo::isVMEM ( const MachineInstr MI)
inlinestatic

◆ isVMEM() [2/2]

bool llvm::SIInstrInfo::isVMEM ( uint16_t  Opcode) const
inline

Definition at line 436 of file SIInstrInfo.h.

References isImage(), isMTBUF(), and isMUBUF().

◆ isVOP1() [1/2]

static bool llvm::SIInstrInfo::isVOP1 ( const MachineInstr MI)
inlinestatic

Definition at line 488 of file SIInstrInfo.h.

References MI, and llvm::SIInstrFlags::VOP1.

Referenced by canRemat().

◆ isVOP1() [2/2]

bool llvm::SIInstrInfo::isVOP1 ( uint16_t  Opcode) const
inline

Definition at line 492 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::VOP1.

◆ isVOP2() [1/2]

static bool llvm::SIInstrInfo::isVOP2 ( const MachineInstr MI)
inlinestatic

Definition at line 496 of file SIInstrInfo.h.

References MI, and llvm::SIInstrFlags::VOP2.

Referenced by canRemat(), legalizeOperands(), and verifyInstruction().

◆ isVOP2() [2/2]

bool llvm::SIInstrInfo::isVOP2 ( uint16_t  Opcode) const
inline

Definition at line 500 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::VOP2.

◆ isVOP3() [1/2]

static bool llvm::SIInstrInfo::isVOP3 ( const MachineInstr MI)
inlinestatic

◆ isVOP3() [2/2]

bool llvm::SIInstrInfo::isVOP3 ( uint16_t  Opcode) const
inline

Definition at line 508 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::VOP3.

◆ isVOP3P() [1/2]

static bool llvm::SIInstrInfo::isVOP3P ( const MachineInstr MI)
inlinestatic

Definition at line 776 of file SIInstrInfo.h.

References MI, and llvm::SIInstrFlags::VOP3P.

◆ isVOP3P() [2/2]

bool llvm::SIInstrInfo::isVOP3P ( uint16_t  Opcode) const
inline

Definition at line 780 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::VOP3P.

◆ isVOPC() [1/2]

static bool llvm::SIInstrInfo::isVOPC ( const MachineInstr MI)
inlinestatic

Definition at line 520 of file SIInstrInfo.h.

References MI, and llvm::SIInstrFlags::VOPC.

Referenced by legalizeOperands(), and verifyInstruction().

◆ isVOPC() [2/2]

bool llvm::SIInstrInfo::isVOPC ( uint16_t  Opcode) const
inline

Definition at line 524 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::VOPC.

◆ isVSAMPLE() [1/2]

static bool llvm::SIInstrInfo::isVSAMPLE ( const MachineInstr MI)
inlinestatic

Definition at line 596 of file SIInstrInfo.h.

References MI, and llvm::SIInstrFlags::VSAMPLE.

Referenced by isImage(), legalizeOperands(), and verifyInstruction().

◆ isVSAMPLE() [2/2]

bool llvm::SIInstrInfo::isVSAMPLE ( uint16_t  Opcode) const
inline

Definition at line 600 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::VSAMPLE.

◆ isWaitcnt()

bool llvm::SIInstrInfo::isWaitcnt ( unsigned  Opcode) const
inline

Definition at line 980 of file SIInstrInfo.h.

References getNonSoftWaitcntOpcode().

◆ isWave32()

bool llvm::SIInstrInfo::isWave32 ( ) const

Definition at line 9498 of file SIInstrInfo.cpp.

References llvm::GCNSubtarget::isWave32().

Referenced by restoreExec().

◆ isWMMA() [1/2]

static bool llvm::SIInstrInfo::isWMMA ( const MachineInstr MI)
inlinestatic

Definition at line 809 of file SIInstrInfo.h.

References llvm::SIInstrFlags::IsWMMA, and MI.

Referenced by convertToThreeAddress(), and isMFMAorWMMA().

◆ isWMMA() [2/2]

bool llvm::SIInstrInfo::isWMMA ( uint16_t  Opcode) const
inline

Definition at line 813 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::IsWMMA.

◆ isWQM() [1/2]

static bool llvm::SIInstrInfo::isWQM ( const MachineInstr MI)
inlinestatic

Definition at line 695 of file SIInstrInfo.h.

References MI, and llvm::SIInstrFlags::WQM.

◆ isWQM() [2/2]

bool llvm::SIInstrInfo::isWQM ( uint16_t  Opcode) const
inline

Definition at line 699 of file SIInstrInfo.h.

References llvm::get(), and llvm::SIInstrFlags::WQM.

◆ isWWMRegSpillOpcode()

static bool llvm::SIInstrInfo::isWWMRegSpillOpcode ( uint16_t  Opcode)
inlinestatic

Definition at line 748 of file SIInstrInfo.h.

◆ legalizeGenericOperand()

void SIInstrInfo::legalizeGenericOperand ( MachineBasicBlock InsertMBB,
MachineBasicBlock::iterator  I,
const TargetRegisterClass DstRC,
MachineOperand Op,
MachineRegisterInfo MRI,
const DebugLoc DL 
) const

◆ legalizeOperands()

MachineBasicBlock * SIInstrInfo::legalizeOperands ( MachineInstr MI,
MachineDominatorTree MDT = nullptr 
) const

Legalize all operands in this instruction.

This function may create new instructions and control-flow around MI. If present, MDT is updated.

Returns
A new basic block that contains MI if new blocks were created.

Definition at line 6558 of file SIInstrInfo.cpp.

References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addDef(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), llvm::MachineOperand::ChangeToRegister(), llvm::MachineInstrBuilder::cloneMemRefs(), llvm::RegState::Dead, DL, llvm::MachineBasicBlock::end(), End, extractRsrcPtr(), llvm::get(), llvm::AMDGPU::getAddr64Inst(), llvm::Function::getCallingConv(), llvm::MachineInstr::getDebugLoc(), llvm::SIRegisterInfo::getEquivalentAGPRClass(), llvm::SIRegisterInfo::getEquivalentVGPRClass(), llvm::MachineBasicBlock::getFirstTerminator(), llvm::MachineFunction::getFunction(), llvm::GCNSubtarget::getGeneration(), llvm::AMDGPU::getIfAddr64Inst(), getNamedImmOperand(), getNamedOperand(), llvm::AMDGPU::getNamedOperandIdx(), getOpRegClass(), llvm::MachineOperand::getReg(), llvm::SIRegisterInfo::getRegClass(), llvm::MachineFunction::getRegInfo(), llvm::GCNSubtarget::hasAddr64(), llvm::SIRegisterInfo::hasVectorRegisters(), llvm::SIRegisterInfo::hasVGPRs(), I, llvm::SIRegisterInfo::isAGPRClass(), isFLAT(), llvm::AMDGPU::isGraphics(), isImage(), isMIMG(), isMTBUF(), isMUBUF(), llvm::MachineOperand::isReg(), llvm::SIRegisterInfo::isSGPRClass(), isSMRD(), isVIMAGE(), llvm::Register::isVirtual(), isVOP2(), isVOP3(), isVOPC(), isVSAMPLE(), llvm::RegState::Kill, legalizeGenericOperand(), legalizeOperandsFLAT(), legalizeOperandsSMRD(), legalizeOperandsVOP2(), legalizeOperandsVOP3(), loadMBUFScalarOperandsFromVGPR(), MBB, MI, MRI, llvm::Offset, readlaneVGPRToSGPR(), llvm::MachineOperand::setReg(), and llvm::AMDGPUSubtarget::VOLCANIC_ISLANDS.

Referenced by foldImmediate(), and moveToVALUImpl().

◆ legalizeOperandsFLAT()

void SIInstrInfo::legalizeOperandsFLAT ( MachineRegisterInfo MRI,
MachineInstr MI 
) const

◆ legalizeOperandsSMRD()

void SIInstrInfo::legalizeOperandsSMRD ( MachineRegisterInfo MRI,
MachineInstr MI 
) const

◆ legalizeOperandsVOP2()

void SIInstrInfo::legalizeOperandsVOP2 ( MachineRegisterInfo MRI,
MachineInstr MI 
) const

◆ legalizeOperandsVOP3()

void SIInstrInfo::legalizeOperandsVOP3 ( MachineRegisterInfo MRI,
MachineInstr MI 
) const

◆ legalizeOpWithMove()

void SIInstrInfo::legalizeOpWithMove ( MachineInstr MI,
unsigned  OpIdx 
) const

Legalize the OpIndex operand of this instruction by inserting a MOV.

For example: ADD_I32_e32 VGPR0, 15 to MOV VGPR1, 15 ADD_I32_e32 VGPR0, VGPR1

If the operand being legalized is a register, then a COPY will be used instead of MOV.

Definition at line 5636 of file SIInstrInfo.cpp.

References llvm::MachineInstrBuilder::add(), llvm::BuildMI(), llvm::MachineOperand::ChangeToRegister(), DL, llvm::MachineBasicBlock::findDebugLoc(), llvm::get(), llvm::SIRegisterInfo::getEquivalentVGPRClass(), llvm::MachineBasicBlock::getParent(), llvm::SIRegisterInfo::getRegClass(), llvm::MachineFunction::getRegInfo(), I, llvm::MachineOperand::isReg(), llvm::SIRegisterInfo::isSGPRClass(), MBB, MI, MRI, and Size.

Referenced by legalizeOperandsVOP2(), and legalizeOperandsVOP3().

◆ loadRegFromStackSlot()

void SIInstrInfo::loadRegFromStackSlot ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
Register  DestReg,
int  FrameIndex,
const TargetRegisterClass RC,
const TargetRegisterInfo TRI,
Register  VReg 
) const
override

◆ materializeImmediate()

void SIInstrInfo::materializeImmediate ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
const DebugLoc DL,
Register  DestReg,
int64_t  Value 
) const

◆ mayAccessFlatAddressSpace()

bool SIInstrInfo::mayAccessFlatAddressSpace ( const MachineInstr MI) const

Definition at line 8757 of file SIInstrInfo.cpp.

References llvm::AMDGPUAS::FLAT_ADDRESS, isFLAT(), and MI.

◆ mayReadEXEC()

bool SIInstrInfo::mayReadEXEC ( const MachineRegisterInfo MRI,
const MachineInstr MI 
) const

Returns true if the instruction could potentially depend on the value of exec.

If false, exec dependencies may safely be ignored.

Definition at line 4167 of file SIInstrInfo.cpp.

References isSALU(), llvm::SIRegisterInfo::isSGPRReg(), llvm::isTargetSpecificOpcode(), MI, and MRI.

◆ mayWriteLDSThroughDMA()

static bool llvm::SIInstrInfo::mayWriteLDSThroughDMA ( const MachineInstr MI)
inlinestatic

Definition at line 691 of file SIInstrInfo.h.

References isLDSDMA(), and MI.

◆ modifiesModeRegister()

bool SIInstrInfo::modifiesModeRegister ( const MachineInstr MI)
static

Return true if the instruction modifies the mode register.q.

Definition at line 4114 of file SIInstrInfo.cpp.

References llvm::is_contained(), and MI.

Referenced by hasUnwantedEffectsWhenEXECEmpty().

◆ moveFlatAddrToVGPR()

bool SIInstrInfo::moveFlatAddrToVGPR ( MachineInstr Inst) const

◆ moveToVALU()

void SIInstrInfo::moveToVALU ( SIInstrWorklist Worklist,
MachineDominatorTree MDT 
) const

Replace the instructions opcode with the equivalent VALU opcode.

This function will also move the users of MachineInstruntions in the WorkList to the VALU if necessary. If present, MDT is updated.

Definition at line 6955 of file SIInstrInfo.cpp.

References assert(), llvm::SIInstrWorklist::empty(), llvm::SIInstrWorklist::erase_top(), llvm::SIInstrWorklist::getDeferredList(), llvm::SIInstrWorklist::isDeferred(), moveToVALUImpl(), and llvm::SIInstrWorklist::top().

◆ moveToVALUImpl()

void SIInstrInfo::moveToVALUImpl ( SIInstrWorklist Worklist,
MachineDominatorTree MDT,
MachineInstr Inst 
) const

Definition at line 6976 of file SIInstrInfo.cpp.

References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstr::addOperand(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BitWidth, llvm::BuildMI(), llvm::RegState::Define, DL, llvm::MachineInstr::eraseFromParent(), llvm::MachineInstr::explicit_operands(), llvm::MachineInstr::findRegisterDefOperandIdx(), fixImplicitOperands(), llvm::get(), llvm::MachineInstr::getDebugLoc(), llvm::SIRegisterInfo::getEquivalentVGPRClass(), llvm::MachineInstr::getFlags(), llvm::GCNSubtarget::getGeneration(), llvm::MachineOperand::getImm(), llvm::AMDGPU::getNamedOperandIdx(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::SIRegisterInfo::getRegClass(), llvm::SIRegisterInfo::getRegClassForReg(), llvm::MachineFunction::getRegInfo(), getVALUOp(), llvm::SIRegisterInfo::getVCC(), llvm::SIRegisterInfo::getWaveMaskRegClass(), llvm::AMDGPUSubtarget::GFX12, llvm::GCNSubtarget::hasDLInsts(), llvm::AMDGPU::hasNamedOperand(), llvm::GCNSubtarget::hasOnlyRevVALUShifts(), I, llvm::MachineInstr::implicit_operands(), llvm::MachineInstr::isCopy(), llvm::MachineOperand::isImm(), llvm::Register::isPhysical(), llvm::AMDGPU::isTrue16Inst(), llvm::SIRegisterInfo::isVGPR(), llvm::Register::isVirtual(), isVOP3(), llvm::GCNSubtarget::isWave32(), legalizeOperands(), llvm_unreachable, MBB, MRI, llvm::Offset, llvm::MachineInstr::removeOperand(), llvm::MachineInstr::setDesc(), llvm::MachineInstrBuilder::setMIFlags(), llvm::MachineOperand::setReg(), Size, and llvm::AMDGPUSubtarget::useRealTrue16Insts().

Referenced by moveToVALU().

◆ optimizeCompareInstr()

bool SIInstrInfo::optimizeCompareInstr ( MachineInstr CmpInstr,
Register  SrcReg,
Register  SrcReg2,
int64_t  CmpMask,
int64_t  CmpValue,
const MachineRegisterInfo MRI 
) const
override

◆ pseudoToMCOpcode()

int SIInstrInfo::pseudoToMCOpcode ( int  Opcode) const

◆ readlaneVGPRToSGPR()

Register SIInstrInfo::readlaneVGPRToSGPR ( Register  SrcReg,
MachineInstr UseMI,
MachineRegisterInfo MRI 
) const

Copy a value from a VGPR (SrcReg) to SGPR.

This function can only be used when it is know that the value in SrcReg is same across all threads in the wave.

Returns
The SGPR register that SrcReg was copied to.

Definition at line 6061 of file SIInstrInfo.cpp.

References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::get(), llvm::SIRegisterInfo::getEquivalentSGPRClass(), llvm::SIRegisterInfo::getEquivalentVGPRClass(), llvm::SIRegisterInfo::getSubRegFromChannel(), llvm::SIRegisterInfo::hasAGPRs(), MRI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and UseMI.

Referenced by legalizeOperands(), legalizeOperandsFLAT(), and legalizeOperandsSMRD().

◆ reMaterialize()

void SIInstrInfo::reMaterialize ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
Register  DestReg,
unsigned  SubIdx,
const MachineInstr Orig,
const TargetRegisterInfo TRI 
) const
override

◆ removeBranch()

unsigned SIInstrInfo::removeBranch ( MachineBasicBlock MBB,
int *  BytesRemoved = nullptr 
) const
override

◆ removeModOperands()

void SIInstrInfo::removeModOperands ( MachineInstr MI) const

Definition at line 3398 of file SIInstrInfo.cpp.

References llvm::AMDGPU::getNamedOperandIdx(), Idx, MI, ModifierOpNames, Name, and llvm::reverse().

Referenced by foldImmediate().

◆ restoreExec()

void SIInstrInfo::restoreExec ( MachineFunction MF,
MachineBasicBlock MBB,
MachineBasicBlock::iterator  MBBI,
const DebugLoc DL,
Register  Reg,
SlotIndexes Indexes = nullptr 
) const

◆ reverseBranchCondition()

bool SIInstrInfo::reverseBranchCondition ( SmallVectorImpl< MachineOperand > &  Cond) const
override

Definition at line 3207 of file SIInstrInfo.cpp.

References Cond, and isImm().

◆ shouldClusterMemOps()

bool SIInstrInfo::shouldClusterMemOps ( ArrayRef< const MachineOperand * >  BaseOps1,
int64_t  Offset1,
bool  OffsetIsScalable1,
ArrayRef< const MachineOperand * >  BaseOps2,
int64_t  Offset2,
bool  OffsetIsScalable2,
unsigned  ClusterSize,
unsigned  NumBytes 
) const
override

◆ shouldScheduleLoadsNear()

bool SIInstrInfo::shouldScheduleLoadsNear ( SDNode Load0,
SDNode Load1,
int64_t  Offset0,
int64_t  Offset1,
unsigned  NumLoads 
) const
override

Definition at line 594 of file SIInstrInfo.cpp.

References assert().

◆ sopkIsZext()

static bool llvm::SIInstrInfo::sopkIsZext ( unsigned  Opcode)
inlinestatic

Definition at line 863 of file SIInstrInfo.h.

Referenced by verifyInstruction().

◆ splitFlatOffset()

std::pair< int64_t, int64_t > SIInstrInfo::splitFlatOffset ( int64_t  COffsetVal,
unsigned  AddrSpace,
uint64_t  FlatVariant 
) const

Split COffsetVal into {immediate offset field, remainder offset} values.

Definition at line 9151 of file SIInstrInfo.cpp.

References allowNegativeFlatOffset(), assert(), D, llvm::SIInstrFlags::FlatScratch, llvm::AMDGPU::getNumFlatOffsetBits(), llvm::GCNSubtarget::hasNegativeUnalignedScratchOffsetBug(), and isLegalFLATOffset().

◆ splitMUBUFOffset()

bool SIInstrInfo::splitMUBUFOffset ( uint32_t  Imm,
uint32_t SOffset,
uint32_t ImmOffset,
Align  Alignment = Align(4) 
) const

◆ storeRegToStackSlot()

void SIInstrInfo::storeRegToStackSlot ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
Register  SrcReg,
bool  isKill,
int  FrameIndex,
const TargetRegisterClass RC,
const TargetRegisterInfo TRI,
Register  VReg 
) const
override

◆ swapSourceModifiers()

bool SIInstrInfo::swapSourceModifiers ( MachineInstr MI,
MachineOperand Src0,
unsigned  Src0OpName,
MachineOperand Src1,
unsigned  Src1OpName 
) const
protected

◆ usesConstantBus()

bool SIInstrInfo::usesConstantBus ( const MachineRegisterInfo MRI,
const MachineOperand MO,
const MCOperandInfo OpInfo 
) const

◆ usesFPDPRounding() [1/2]

static bool llvm::SIInstrInfo::usesFPDPRounding ( const MachineInstr MI)
inlinestatic

Definition at line 908 of file SIInstrInfo.h.

References llvm::SIInstrFlags::FPDPRounding, and MI.

◆ usesFPDPRounding() [2/2]

bool llvm::SIInstrInfo::usesFPDPRounding ( uint16_t  Opcode) const
inline

Definition at line 912 of file SIInstrInfo.h.

References llvm::SIInstrFlags::FPDPRounding, and llvm::get().

◆ usesLGKM_CNT()

static bool llvm::SIInstrInfo::usesLGKM_CNT ( const MachineInstr MI)
inlinestatic

Definition at line 857 of file SIInstrInfo.h.

References llvm::SIInstrFlags::LGKM_CNT, and MI.

◆ usesVM_CNT()

static bool llvm::SIInstrInfo::usesVM_CNT ( const MachineInstr MI)
inlinestatic

Definition at line 853 of file SIInstrInfo.h.

References MI, and llvm::SIInstrFlags::VM_CNT.

◆ verifyInstruction()

bool SIInstrInfo::verifyInstruction ( const MachineInstr MI,
StringRef ErrInfo 
) const
override

Definition at line 4618 of file SIInstrInfo.cpp.

References llvm::SISrcMods::ABS, llvm::all_of(), assert(), compareMachineOp(), llvm::TargetRegisterClass::contains(), llvm::Data, llvm::dbgs(), llvm::divideCeil(), findImplicitSGPRRead(), llvm::get(), llvm::AMDGPU::getAddrSizeMIMGOp(), llvm::AMDGPU::getBasicFromSDWAOp(), llvm::SIRegisterInfo::getChannelFromSubReg(), llvm::SIRegisterInfo::getCompatibleSubRegClass(), llvm::GCNSubtarget::getConstantBusLimit(), llvm::GCNSubtarget::getGeneration(), llvm::SIRegisterInfo::getHWRegIndex(), llvm::MachineOperand::getImm(), llvm::AMDGPU::getMIMGBaseOpcodeInfo(), llvm::AMDGPU::getMIMGDimInfoByEncoding(), llvm::AMDGPU::getMIMGInfo(), getNamedOperand(), llvm::AMDGPU::getNamedOperandIdx(), llvm::GCNSubtarget::getNSAMaxSize(), getOpRegClass(), getOpSize(), llvm::SrcOp::getReg(), llvm::MachineOperand::getReg(), llvm::SIRegisterInfo::getRegClass(), llvm::SIRegisterInfo::getRegClassForReg(), llvm::MachineFunction::getRegInfo(), llvm::MachineOperand::getSubReg(), llvm::AMDGPUSubtarget::GFX10, llvm::GCNSubtarget::hasA16(), llvm::GCNSubtarget::hasFlatInstOffsets(), llvm::GCNSubtarget::hasG16(), llvm::GCNSubtarget::hasGDS(), llvm::GCNSubtarget::hasGFX90AInsts(), llvm::GCNSubtarget::hasPartialNSAEncoding(), llvm::GCNSubtarget::hasR128A16(), llvm::AMDGPUSubtarget::hasSDWA(), llvm::GCNSubtarget::hasSDWAOmod(), llvm::GCNSubtarget::hasSDWAOutModsVOPC(), llvm::GCNSubtarget::hasSDWAScalar(), llvm::GCNSubtarget::hasSDWASdst(), llvm::GCNSubtarget::hasUnpackedD16VMem(), llvm::SIRegisterInfo::hasVectorRegisters(), llvm::SIRegisterInfo::hasVGPRs(), llvm::GCNSubtarget::hasVOP3Literal(), I, Info, llvm::is_contained(), llvm::SIRegisterInfo::isAGPR(), llvm::AMDGPU::isDPALU_DPP(), isDS(), llvm::MachineOperand::isFI(), isFLAT(), llvm::MachineOperand::isFPImm(), isGather4(), llvm::MachineOperand::isIdenticalTo(), isImage(), llvm::MachineOperand::isImm(), llvm::MachineOperand::isImplicit(), isInlineConstant(), llvm::AMDGPU::isLegalDPALU_DPPControl(), isMIMG(), llvm::Register::isPhysical(), llvm::SIRegisterInfo::isProperlyAlignedRC(), llvm::MachineOperand::isReg(), isRegOrFI(), isSDWA(), llvm::SIRegisterInfo::isSGPRReg(), isSMRD(), isSOP2(), isSOPC(), isSOPK(), isSubRegOf(), llvm::MachineOperand::isUse(), isVALU(), isVGPRSpill(), llvm::Register::isVirtual(), isVOP2(), isVOP3(), isVOPC(), isVSAMPLE(), LLVM_DEBUG, MI, llvm::InlineAsm::MIOp_FirstOperand, MRI, llvm::GCNSubtarget::needsAlignedVGPRs(), llvm::SISrcMods::NEG, llvm::Offset, llvm::MCOI::OPERAND_IMMEDIATE, llvm::AMDGPU::OPERAND_INLINE_SPLIT_BARRIER_INT32, llvm::AMDGPU::OPERAND_KIMM32, llvm::AMDGPU::OPERAND_REG_IMM_FP32, llvm::AMDGPU::OPERAND_REG_IMM_FP32_DEFERRED, llvm::AMDGPU::OPERAND_REG_IMM_INT32, llvm::AMDGPU::OPERAND_REG_IMM_V2FP32, llvm::AMDGPU::OPERAND_REG_INLINE_AC_FP16, llvm::AMDGPU::OPERAND_REG_INLINE_AC_FP32, llvm::AMDGPU::OPERAND_REG_INLINE_AC_FP64, llvm::AMDGPU::OPERAND_REG_INLINE_AC_INT16, llvm::AMDGPU::OPERAND_REG_INLINE_AC_INT32, llvm::AMDGPU::OPERAND_REG_INLINE_C_FP16, llvm::AMDGPU::OPERAND_REG_INLINE_C_FP32, llvm::AMDGPU::OPERAND_REG_INLINE_C_FP64, llvm::AMDGPU::OPERAND_REG_INLINE_C_INT16, llvm::AMDGPU::OPERAND_REG_INLINE_C_INT32, llvm::AMDGPU::OPERAND_REG_INLINE_C_INT64, llvm::MCOI::OPERAND_REGISTER, llvm::popcount(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SISrcMods::SEXT, shouldReadExec(), sopkIsZext(), llvm::AMDGPU::SDWA::UNUSED_PRESERVE, usesConstantBus(), and llvm::AMDGPUSubtarget::VOLCANIC_ISLANDS.

Referenced by llvm::AMDGPUAsmPrinter::emitInstruction().


The documentation for this class was generated from the following files: