LLVM 23.0.0git
llvm::SIInstrInfo Class Referencefinal

#include "Target/AMDGPU/SIInstrInfo.h"

Inheritance diagram for llvm::SIInstrInfo:
[legend]

Classes

struct  ThreeAddressUpdates
 Helper struct for the implementation of 3-address conversion to communicate updates made to instruction operands. More...

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_GOTPCREL64 = 4 , MO_REL32 = 5 ,
  MO_REL32_LO = 5 , MO_REL32_HI = 6 , MO_REL64 = 7 , MO_FAR_BRANCH_OFFSET = 8 ,
  MO_ABS32_LO = 9 , MO_ABS32_HI = 10 , MO_ABS64 = 11
}

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 isReMaterializableImpl (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 isGlobalMemoryObject (const MachineInstr *MI) 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, Register DestReg, Register SrcReg, bool KillSrc, bool RenamableDest=false, bool RenamableSrc=false) const override
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
bool getConstValDefinedInReg (const MachineInstr &MI, const Register Reg, int64_t &ImmVal) const override
std::optional< int64_t > getImmOrMaterializedImm (MachineOperand &Op) const
unsigned getVectorRegSpillSaveOpcode (Register Reg, const TargetRegisterClass *RC, unsigned Size, const SIMachineFunctionInfo &MFI) const
unsigned getVectorRegSpillRestoreOpcode (Register Reg, const TargetRegisterClass *RC, unsigned Size, const SIMachineFunctionInfo &MFI) const
void storeRegToStackSlot (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, Register SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, Register VReg, MachineInstr::MIFlag Flags=MachineInstr::NoFlags) const override
void loadRegFromStackSlot (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, Register DestReg, int FrameIndex, const TargetRegisterClass *RC, Register VReg, unsigned SubReg=0, MachineInstr::MIFlag Flags=MachineInstr::NoFlags) const override
bool expandPostRAPseudo (MachineInstr &MI) const override
void reMaterialize (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, Register DestReg, unsigned SubIdx, const MachineInstr &Orig, LaneBitmask UsedLanes=LaneBitmask::getAll()) 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
void mutateAndCleanupImplicit (MachineInstr &MI, const MCInstrDesc &NewDesc) 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 (uint32_t Opcode) const
bool isVALU (uint32_t Opcode) const
bool isImage (uint32_t Opcode) const
bool isVMEM (uint32_t Opcode) const
bool isSOP1 (uint32_t Opcode) const
bool isSOP2 (uint32_t Opcode) const
bool isSOPC (uint32_t Opcode) const
bool isSOPK (uint32_t Opcode) const
bool isSOPP (uint32_t Opcode) const
bool isPacked (uint32_t Opcode) const
bool isVOP1 (uint32_t Opcode) const
bool isVOP2 (uint32_t Opcode) const
bool isVOP3 (uint32_t Opcode) const
bool isSDWA (uint32_t Opcode) const
bool isVOPC (uint32_t Opcode) const
bool isMUBUF (uint32_t Opcode) const
bool isMTBUF (uint32_t Opcode) const
bool isSMRD (uint32_t Opcode) const
bool isBufferSMRD (const MachineInstr &MI) const
bool isDS (uint32_t Opcode) const
bool isLDSDMA (uint32_t Opcode)
bool isGWS (uint32_t Opcode) const
bool isAlwaysGDS (uint32_t Opcode) const
bool isMIMG (uint32_t Opcode) const
bool isVIMAGE (uint32_t Opcode) const
bool isVSAMPLE (uint32_t Opcode) const
bool isGather4 (uint32_t Opcode) const
bool isSegmentSpecificFLAT (uint32_t Opcode) const
bool isFLATGlobal (uint32_t Opcode) const
bool isFLATScratch (uint32_t Opcode) const
bool isFLAT (uint32_t Opcode) const
bool mayAccessScratch (const MachineInstr &MI) const
bool mayAccessVMEMThroughFlat (const MachineInstr &MI) const
bool mayAccessLDSThroughFlat (const MachineInstr &MI) const
bool isEXP (uint32_t Opcode) const
bool isAtomicNoRet (uint32_t Opcode) const
bool isAtomicRet (uint32_t Opcode) const
bool isAtomic (uint32_t Opcode) const
bool isWQM (uint32_t Opcode) const
bool isDisableWQM (uint32_t Opcode) const
bool isVGPRSpill (uint32_t Opcode) const
bool isSGPRSpill (uint32_t Opcode) const
bool isSpill (uint32_t Opcode) const
bool isDPP (uint32_t Opcode) const
bool isTRANS (uint32_t Opcode) const
bool isVOP3P (uint32_t Opcode) const
bool isVINTRP (uint32_t Opcode) const
bool isMAI (uint32_t Opcode) const
bool isMFMA (uint32_t Opcode) const
bool isWMMA (uint32_t Opcode) const
bool isMFMAorWMMA (uint32_t Opcode) const
bool isSWMMAC (uint32_t Opcode) const
bool isDOT (uint32_t Opcode) const
bool isXDLWMMA (const MachineInstr &MI) const
bool isXDL (const MachineInstr &MI) const
bool isLDSDIR (uint32_t Opcode) const
bool isVINTERP (uint32_t Opcode) const
bool usesASYNC_CNT (uint32_t Opcode) const
bool isScalarStore (uint32_t Opcode) const
bool isFixedSize (uint32_t Opcode) const
bool hasFPClamp (uint32_t Opcode) const
uint64_t getClampMask (const MachineInstr &MI) const
bool usesFPDPRounding (uint32_t Opcode) const
bool isFPAtomic (uint32_t Opcode) const
bool isBarrierStart (unsigned Opcode) const
bool isBarrier (unsigned Opcode) const
bool doesNotReadTiedSource (uint32_t Opcode) const
bool isIGLP (unsigned Opcode) const
bool isIGLP (const MachineInstr &MI) const
bool isIGLPMutationOnly (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 (int64_t ImmVal, 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, int64_t ImmVal) const
bool isInlineConstant (const MachineInstr &MI, unsigned OpIdx, const MachineOperand &MO) const
bool isInlineConstant (const MachineOperand &MO) const
bool isImmOperandLegal (const MCInstrDesc &InstDesc, unsigned OpNo, const MachineOperand &MO) const
bool isLiteralOperandLegal (const MCInstrDesc &InstDesc, const MCOperandInfo &OpInfo) const
bool isImmOperandLegal (const MCInstrDesc &InstDesc, unsigned OpNo, int64_t ImmVal) const
bool isImmOperandLegal (const MachineInstr &MI, unsigned OpNo, const MachineOperand &MO) const
bool isNeverCoissue (MachineInstr &MI) const
bool isLegalAV64PseudoImm (uint64_t Imm) const
 Check if this immediate value can be used for AV_MOV_B64_IMM_PSEUDO.
bool hasVALU32BitEncoding (unsigned Opcode) const
 Return true if this 64-bit VALU instruction has a 32-bit encoding.
bool physRegUsesConstantBus (const MachineOperand &Reg) const
bool regUsesConstantBus (const MachineOperand &Reg, const MachineRegisterInfo &MRI) const
bool usesConstantBus (const MachineRegisterInfo &MRI, const MachineOperand &MO, const MCOperandInfo &OpInfo) const
 Returns true if this operand uses the constant bus.
bool usesConstantBus (const MachineRegisterInfo &MRI, const MachineInstr &MI, int OpIdx) const
bool hasModifiers (unsigned Opcode) const
 Return true if this instruction has any modifiers.
bool hasModifiersSet (const MachineInstr &MI, AMDGPU::OpName 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
unsigned getVALUOp (unsigned Opc) 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
MachineInstrgetWholeWaveFunctionSetup (MachineFunction &MF) const
const TargetRegisterClassgetOpRegClass (const MachineInstr &MI, unsigned OpNo) const
 Return the correct register class for OpNo.
unsigned getOpSize (uint32_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 or operand index.
bool isLegalRegOperand (const MachineInstr &MI, unsigned OpIdx, const MachineOperand &MO) const
bool isLegalGFX12PlusPackedMathFP32Operand (const MachineRegisterInfo &MRI, const MachineInstr &MI, unsigned SrcN, const MachineOperand *MO=nullptr) const
 Check if MO would be a legal operand for gfx12+ packed math FP32 instructions.
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 TargetRegisterClass *DstRC=nullptr) 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 legalizeOperandsVALUt16 (MachineInstr &Inst, MachineRegisterInfo &MRI) const
 Fix operands in Inst to fix 16bit SALU to VALU lowering.
void legalizeOperandsVALUt16 (MachineInstr &Inst, unsigned OpIdx, MachineRegisterInfo &MRI) const
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, AMDGPU::OpName OperandName) const
 Returns the operand named Op.
LLVM_READONLY const MachineOperandgetNamedOperand (const MachineInstr &MI, AMDGPU::OpName OperandName) const
int64_t getNamedImmOperand (const MachineInstr &MI, AMDGPU::OpName OperandName) 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.
Register isStackAccess (const MachineInstr &MI, int &FrameIndex) const
Register 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
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, MachineLoopInfo *MLI) 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
bool canAddToBBProlog (const MachineInstr &MI) const
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 with the given FlatVariant.
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.
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
const MachineOperandgetCalleeOperand (const MachineInstr &MI) const override
InstructionUniformity getInstructionUniformity (const MachineInstr &MI) const final
InstructionUniformity getGenericInstructionUniformity (const MachineInstr &MI) const
const MIRFormattergetMIRFormatter () const override
const TargetSchedModelgetSchedModel () const
void enforceOperandRCAlignment (MachineInstr &MI, AMDGPU::OpName OpName) const

Static Public Member Functions

static bool isFoldableCopy (const MachineInstr &MI)
static unsigned getFoldableCopySrcIdx (const MachineInstr &MI)
static std::optional< int64_t > extractSubregFromImm (int64_t ImmVal, unsigned SubRegIndex)
 Return the extracted immediate value in a subregister use from a constant materialized in a super register.
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 MCInstrDesc &Desc)
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 isBUF (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 isBlockLoadStore (uint32_t Opcode)
static bool setsSCCIfResultIsNonZero (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 isSBarrierSCCWrite (unsigned Opcode)
static bool isCBranchVCCZRead (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 MCInstrDesc &Desc)
static bool isSpill (const MachineInstr &MI)
static bool isWWMRegSpillOpcode (uint32_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 MCInstrDesc &Desc)
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 isDGEMM (unsigned Opcode)
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 usesASYNC_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 isGFX12CacheInvOrWBInst (unsigned Opc)
static bool isF16PseudoScalarTrans (unsigned Opcode)
static bool doesNotReadTiedSource (const MachineInstr &MI)
static unsigned getNonSoftWaitcntOpcode (unsigned Opcode)
static bool isWaitcnt (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, AMDGPU::OpName Src0OpName, MachineOperand &Src1, AMDGPU::OpName Src1OpName) const
bool isLegalToSwap (const MachineInstr &MI, unsigned fromIdx, unsigned toIdx) const
MachineInstrcommuteInstructionImpl (MachineInstr &MI, bool NewMI, unsigned OpIdx0, unsigned OpIdx1) const override

Detailed Description

Definition at line 95 of file SIInstrInfo.h.

Member Enumeration Documentation

◆ TargetOperandFlags

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

Definition at line 227 of file SIInstrInfo.h.

Constructor & Destructor Documentation

◆ SIInstrInfo()

SIInstrInfo::SIInstrInfo ( const GCNSubtarget & ST)
explicit

Definition at line 66 of file SIInstrInfo.cpp.

Referenced by insertScratchExecCopy().

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 10296 of file SIInstrInfo.cpp.

References llvm::SIInstrFlags::FLAT, llvm::SIInstrFlags::FlatScratch, 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

Definition at line 3241 of file SIInstrInfo.cpp.

References analyzeBranchImpl(), Cond, I, llvm_unreachable, MBB, and TBB.

◆ analyzeBranchImpl()

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

Definition at line 3204 of file SIInstrInfo.cpp.

References Cond, llvm::MachineOperand::CreateImm(), 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 10910 of file SIInstrInfo.cpp.

References MI, and Register.

◆ areLoadsFromSameBasePtr()

◆ areMemAccessesTriviallyDisjoint()

◆ buildExtractSubReg()

◆ buildExtractSubRegOrImm()

◆ buildShrunkInst()

◆ canAddToBBProlog()

◆ 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()

◆ commuteInstructionImpl()

◆ commuteOpcode() [1/2]

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

Definition at line 363 of file SIInstrInfo.h.

References commuteOpcode(), and MI.

◆ commuteOpcode() [2/2]

int SIInstrInfo::commuteOpcode ( unsigned Opc) const

◆ convertToThreeAddress()

◆ copyPhysReg()

◆ createPHIDestinationCopy()

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

◆ createPHISourceCopy()

◆ 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 9940 of file SIInstrInfo.cpp.

References II, and llvm::ScheduleDAG::MF.

◆ CreateTargetPostRAHazardRecognizer() [2/2]

ScheduleHazardRecognizer * SIInstrInfo::CreateTargetPostRAHazardRecognizer ( const MachineFunction & MF,
MachineLoopInfo * MLI ) const
override

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

Definition at line 9948 of file SIInstrInfo.cpp.

◆ decomposeMachineOperandsTargetFlags()

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

Definition at line 9968 of file SIInstrInfo.cpp.

References MO_MASK.

◆ doesNotReadTiedSource() [1/2]

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

Definition at line 1140 of file SIInstrInfo.h.

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

◆ doesNotReadTiedSource() [2/2]

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

Definition at line 1144 of file SIInstrInfo.h.

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

◆ enforceOperandRCAlignment()

◆ expandMovDPP64()

◆ expandPostRAPseudo()

bool SIInstrInfo::expandPostRAPseudo ( MachineInstr & MI) const
override

Definition at line 2067 of file SIInstrInfo.cpp.

References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addDef(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::MIBundleBuilder::append(), assert(), llvm::MIBundleBuilder::begin(), llvm::BuildMI(), llvm::TargetRegisterClass::contains(), llvm::MachineInstrBuilder::copyImplicitOps(), llvm::MachineOperand::CreateImm(), llvm::Define, DL, llvm::AMDGPU::VGPRIndexMode::DST_ENABLE, llvm::AMDGPU::EncodingFields< HwregId, HwregOffset, HwregSize >::encode(), llvm::AMDGPU::LaneMaskConstants::ExecReg, expandMovDPP64(), llvm::TargetInstrInfo::expandPostRAPseudo(), llvm::finalizeBundle(), llvm::AMDGPU::LaneMaskConstants::get(), llvm::get(), llvm::SrcOp::getImm(), llvm::ilist_node_impl< OptionsT >::getIterator(), getNamedOperand(), llvm::MCInstrDesc::getNumOperands(), llvm::MachineOperand::getOffset(), llvm::MachineInstr::getOperand(), getOpRegClass(), llvm::SrcOp::getReg(), getRegClass(), llvm::SIMachineFunctionInfo::getScratchReservedForDynamicVGPRs(), llvm::MachineFunction::getSubtarget(), llvm::getUndefRegState(), llvm::Hi, llvm::AMDGPU::Hwreg::ID_HW_ID2, llvm::Implicit, llvm::MCInstrDesc::implicit_uses(), llvm::ImplicitDefine, llvm::SIRegisterInfo::isAGPRClass(), llvm::MachineOperand::isGlobal(), isInlineConstant(), llvm::isUInt(), llvm::Lo, MBB, MI, llvm::AMDGPU::LaneMaskConstants::MovOpc, llvm::AMDGPU::Hwreg::OFFSET_ME_ID, llvm::SISrcMods::OP_SEL_0, llvm::SISrcMods::OP_SEL_1, Opc, llvm::AMDGPU::LaneMaskConstants::OrSaveExecOpc, llvm::MachineOperand::setIsUndef(), llvm::MachineOperand::setOffset(), llvm::SignExtend64(), llvm::AMDGPU::VGPRIndexMode::SRC0_ENABLE, llvm::MachineInstr::tieOperands(), TRI, llvm::Undef, and llvm::AMDGPU::LaneMaskConstants::WQMOpc.

◆ extractSubregFromImm()

std::optional< int64_t > SIInstrInfo::extractSubregFromImm ( int64_t ImmVal,
unsigned SubRegIndex )
static

Return the extracted immediate value in a subregister use from a constant materialized in a super register.

e.g. imm = S_MOV_B64 K[0:63] USE imm.sub1 This will return K[32:63]

Definition at line 3605 of file SIInstrInfo.cpp.

References llvm_unreachable, and llvm::SignExtend64().

Referenced by foldImmediate(), and getImmOrMaterializedImm().

◆ findCommutedOpIndices() [1/2]

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

Definition at line 2967 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 2973 of file SIInstrInfo.cpp.

References Opc.

◆ fixImplicitOperands()

void SIInstrInfo::fixImplicitOperands ( MachineInstr & MI) const

Definition at line 10129 of file SIInstrInfo.cpp.

References MI.

Referenced by buildShrunkInst(), insertBranch(), insertSelect(), legalizeOperandsVOP2(), and moveToVALUImpl().

◆ foldImmediate()

◆ foldMemoryOperandImpl()

◆ 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 10059 of file SIInstrInfo.cpp.

References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::Dead, llvm::Define, DL, llvm::get(), I, MBB, and llvm::MachineRegisterInfo::setRegAllocationHint().

◆ getAddNoCarry() [2/2]

◆ getBranchDestBlock()

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

Definition at line 3008 of file SIInstrInfo.cpp.

References MI.

◆ getCalleeOperand()

const MachineOperand & SIInstrInfo::getCalleeOperand ( const MachineInstr & MI) const
override

◆ getClampMask()

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

◆ getConstValDefinedInReg()

bool SIInstrInfo::getConstValDefinedInReg ( const MachineInstr & MI,
const Register Reg,
int64_t & ImmVal ) const
override

◆ getDefaultRsrcDataFormat()

◆ getDSShaderTypeValue()

◆ getFoldableCopySrcIdx()

unsigned SIInstrInfo::getFoldableCopySrcIdx ( const MachineInstr & MI)
static

Definition at line 3550 of file SIInstrInfo.cpp.

References llvm_unreachable, and MI.

◆ getGenericInstructionUniformity()

◆ getImmOrMaterializedImm()

std::optional< int64_t > SIInstrInfo::getImmOrMaterializedImm ( MachineOperand & Op) const

◆ getIndirectGPRIDXPseudo()

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

Definition at line 1417 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 9800 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 10693 of file SIInstrInfo.cpp.

References llvm::Count, E(), I, and MI.

◆ getInstructionUniformity()

◆ getInstSizeInBytes()

◆ getKillTerminatorFromPseudo()

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

Definition at line 10107 of file SIInstrInfo.cpp.

References llvm::get(), and llvm_unreachable.

◆ getLiveRangeSplitOpcode()

◆ getMachineCSELookAheadLimit()

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

Definition at line 457 of file SIInstrInfo.h.

◆ getMaxMUBUFImmOffset()

◆ 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 1554 of file SIInstrInfo.h.

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

Referenced by getInstSizeInBytes().

◆ getMemOperandsWithOffsetWidth()

◆ getMIRFormatter()

const MIRFormatter * SIInstrInfo::getMIRFormatter ( ) const
override

Definition at line 10793 of file SIInstrInfo.cpp.

◆ getMovOpcode()

unsigned SIInstrInfo::getMovOpcode ( const TargetRegisterClass * DstRC) const

Definition at line 1398 of file SIInstrInfo.cpp.

◆ getNamedImmOperand()

int64_t llvm::SIInstrInfo::getNamedImmOperand ( const MachineInstr & MI,
AMDGPU::OpName OperandName ) const
inline

Get required immediate operand.

Definition at line 1540 of file SIInstrInfo.h.

References MI.

Referenced by legalizeOperands().

◆ getNamedOperand() [1/2]

LLVM_READONLY const MachineOperand * llvm::SIInstrInfo::getNamedOperand ( const MachineInstr & MI,
AMDGPU::OpName OperandName ) const
inline

Definition at line 1534 of file SIInstrInfo.h.

References getNamedOperand(), and MI.

◆ getNamedOperand() [2/2]

MachineOperand * SIInstrInfo::getNamedOperand ( MachineInstr & MI,
AMDGPU::OpName OperandName ) const

◆ getNonSoftWaitcntOpcode()

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

Definition at line 1161 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 2053 of file SIInstrInfo.cpp.

References MI.

Referenced by getWaitStatesSince(), and getWaitStatesSince().

◆ 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 6274 of file SIInstrInfo.cpp.

References llvm::get(), llvm::MachineRegisterInfo::getRegClass(), and MI.

Referenced by expandPostRAPseudo(), getMemOperandsWithOffsetWidth(), getOpSize(), legalizeOperands(), moveToVALUImpl(), 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 1402 of file SIInstrInfo.h.

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

◆ getOpSize() [2/2]

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

Return the size in bytes of the operand OpNo on the given.

Definition at line 1388 of file SIInstrInfo.h.

References assert(), llvm::get(), and llvm::MCOI::OPERAND_IMMEDIATE.

Referenced by enforceOperandRCAlignment(), getMemOperandsWithOffsetWidth(), isInlineConstant(), and verifyInstruction().

◆ getPreferredSelectRegClass()

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

Definition at line 1181 of file SIInstrInfo.cpp.

References Size.

◆ getRegisterInfo()

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

Definition at line 256 of file SIInstrInfo.h.

◆ getSchedModel()

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

Definition at line 1689 of file SIInstrInfo.h.

◆ getScratchRsrcWords23()

◆ getSerializableDirectMachineOperandTargetFlags()

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

◆ getSerializableMachineMemOperandTargetFlags()

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

◆ getSerializableTargetIndices()

◆ getSubtarget()

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

Definition at line 260 of file SIInstrInfo.h.

Referenced by shouldScheduleVOPDAdjacent().

◆ getVALUOp() [1/2]

unsigned SIInstrInfo::getVALUOp ( const MachineInstr & MI) const

Definition at line 5988 of file SIInstrInfo.cpp.

References getVALUOp(), and MI.

Referenced by getVALUOp(), and moveToVALUImpl().

◆ getVALUOp() [2/2]

unsigned SIInstrInfo::getVALUOp ( unsigned Opc) const

Definition at line 6001 of file SIInstrInfo.cpp.

References llvm_unreachable, and Opc.

◆ getVectorRegSpillRestoreOpcode()

◆ getVectorRegSpillSaveOpcode()

◆ getWholeWaveFunctionSetup()

◆ hasAnyModifiersSet()

bool SIInstrInfo::hasAnyModifiersSet ( const MachineInstr & MI) const

Definition at line 4945 of file SIInstrInfo.cpp.

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

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 3012 of file SIInstrInfo.cpp.

References MBB, and MI.

Referenced by isSafeToSink().

◆ hasFPClamp() [1/2]

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

Definition at line 1067 of file SIInstrInfo.h.

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

◆ hasFPClamp() [2/2]

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

Definition at line 1071 of file SIInstrInfo.h.

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

◆ hasIntClamp()

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

Definition at line 1075 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 4932 of file SIInstrInfo.cpp.

References llvm::AMDGPU::hasNamedOperand().

◆ hasModifiersSet()

bool SIInstrInfo::hasModifiersSet ( const MachineInstr & MI,
AMDGPU::OpName OpName ) const

Definition at line 4939 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 4650 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 4920 of file SIInstrInfo.cpp.

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

Referenced by canShrink().

◆ hasVGPRUses()

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

Definition at line 1217 of file SIInstrInfo.h.

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

◆ insertBranch()

◆ insertEQ()

◆ insertIndirectBranch()

◆ insertNE()

◆ insertNoop()

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

Definition at line 1962 of file SIInstrInfo.cpp.

References insertNoops(), MBB, and MI.

◆ insertNoops()

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

Definition at line 1967 of file SIInstrInfo.cpp.

References llvm::MachineInstrBuilder::addImm(), llvm::BuildMI(), DL, llvm::get(), MBB, and MI.

Referenced by insertNoop().

◆ insertReturn()

void SIInstrInfo::insertReturn ( MachineBasicBlock & MBB) const

◆ insertScratchExecCopy()

◆ insertSelect()

◆ insertSimulatedTrap()

◆ insertVectorSelect()

◆ isAlwaysGDS()

bool SIInstrInfo::isAlwaysGDS ( uint32_t Opcode) const

Definition at line 4553 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 10328 of file SIInstrInfo.cpp.

Referenced by pseudoToMCOpcode().

◆ isAtomic() [1/2]

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

◆ isAtomic() [2/2]

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

◆ isAtomicNoRet() [1/2]

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

Definition at line 802 of file SIInstrInfo.h.

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

◆ isAtomicNoRet() [2/2]

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

Definition at line 806 of file SIInstrInfo.h.

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

◆ isAtomicRet() [1/2]

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

Definition at line 810 of file SIInstrInfo.h.

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

◆ isAtomicRet() [2/2]

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

Definition at line 814 of file SIInstrInfo.h.

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

◆ isBarrier()

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

Definition at line 1118 of file SIInstrInfo.h.

References isBarrierStart().

Referenced by hasUnwantedEffectsWhenEXECEmpty().

◆ isBarrierStart()

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

Definition at line 1110 of file SIInstrInfo.h.

Referenced by isBarrier().

◆ isBasicBlockPrologue()

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

Definition at line 10037 of file SIInstrInfo.cpp.

References canAddToBBProlog(), llvm::MachineFunction::getRegInfo(), and MI.

◆ isBlockLoadStore()

bool llvm::SIInstrInfo::isBlockLoadStore ( uint32_t Opcode)
inlinestatic

Definition at line 726 of file SIInstrInfo.h.

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

◆ isBranchOffsetInRange()

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

Definition at line 2991 of file SIInstrInfo.cpp.

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

◆ isBUF()

bool llvm::SIInstrInfo::isBUF ( const MachineInstr & MI)
inlinestatic

Definition at line 603 of file SIInstrInfo.h.

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

Referenced by mayAccessScratch().

◆ isBufferSMRD()

bool SIInstrInfo::isBufferSMRD ( const MachineInstr & MI) const

Definition at line 10145 of file SIInstrInfo.cpp.

References isSMRD(), and MI.

◆ isCBranchVCCZRead()

bool llvm::SIInstrInfo::isCBranchVCCZRead ( const MachineInstr & MI)
inlinestatic

Definition at line 842 of file SIInstrInfo.h.

References MI, and Opc.

◆ isChainCallOpcode()

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

Definition at line 910 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 2798 of file SIInstrInfo.cpp.

References MI.

◆ isDGEMM()

bool llvm::SIInstrInfo::isDGEMM ( unsigned Opcode)
inlinestatic

Definition at line 1001 of file SIInstrInfo.h.

References llvm::AMDGPU::getMAIIsDGEMM().

Referenced by isXDL().

◆ isDisableWQM() [1/2]

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

Definition at line 856 of file SIInstrInfo.h.

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

◆ isDisableWQM() [2/2]

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

Definition at line 860 of file SIInstrInfo.h.

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

◆ isDOT() [1/2]

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

Definition at line 965 of file SIInstrInfo.h.

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

Referenced by isNeverCoissue(), and isXDL().

◆ isDOT() [2/2]

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

Definition at line 993 of file SIInstrInfo.h.

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

◆ isDPP() [1/2]

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

◆ isDPP() [2/2]

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

Definition at line 919 of file SIInstrInfo.h.

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

◆ isDS() [1/2]

◆ isDS() [2/2]

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

Definition at line 621 of file SIInstrInfo.h.

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

◆ isDualSourceBlendEXP()

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

◆ isEXP() [1/2]

◆ isEXP() [2/2]

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

Definition at line 798 of file SIInstrInfo.h.

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

◆ isF16PseudoScalarTrans()

bool llvm::SIInstrInfo::isF16PseudoScalarTrans ( unsigned Opcode)
inlinestatic

Definition at line 1132 of file SIInstrInfo.h.

Referenced by isOperandLegal().

◆ isFixedSize() [1/2]

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

Definition at line 1059 of file SIInstrInfo.h.

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

Referenced by getInstSizeInBytes().

◆ isFixedSize() [2/2]

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

Definition at line 1063 of file SIInstrInfo.h.

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

◆ isFLAT() [1/2]

◆ isFLAT() [2/2]

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

Definition at line 710 of file SIInstrInfo.h.

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

◆ isFLATGlobal() [1/2]

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

Definition at line 693 of file SIInstrInfo.h.

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

Referenced by areMemAccessesTriviallyDisjoint(), and mayAccessScratch().

◆ isFLATGlobal() [2/2]

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

Definition at line 697 of file SIInstrInfo.h.

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

◆ isFLATScratch() [1/2]

◆ isFLATScratch() [2/2]

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

Definition at line 705 of file SIInstrInfo.h.

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

◆ isFoldableCopy()

bool SIInstrInfo::isFoldableCopy ( const MachineInstr & MI)
static

Definition at line 3525 of file SIInstrInfo.cpp.

References MI.

Referenced by getFoldableImm().

◆ isFPAtomic() [1/2]

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

Definition at line 1095 of file SIInstrInfo.h.

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

◆ isFPAtomic() [2/2]

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

Definition at line 1099 of file SIInstrInfo.h.

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

◆ isGather4() [1/2]

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

Definition at line 669 of file SIInstrInfo.h.

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

Referenced by verifyInstruction().

◆ isGather4() [2/2]

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

Definition at line 673 of file SIInstrInfo.h.

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

◆ isGFX12CacheInvOrWBInst()

bool llvm::SIInstrInfo::isGFX12CacheInvOrWBInst ( unsigned Opc)
inlinestatic

Definition at line 1127 of file SIInstrInfo.h.

References Opc.

◆ isGlobalMemoryObject()

bool SIInstrInfo::isGlobalMemoryObject ( const MachineInstr * MI) const
override

Definition at line 11343 of file SIInstrInfo.cpp.

References llvm::TargetInstrInfo::isGlobalMemoryObject(), isIGLP(), and MI.

◆ isGWS() [1/2]

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

Definition at line 635 of file SIInstrInfo.h.

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

Referenced by isAlwaysGDS().

◆ isGWS() [2/2]

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

Definition at line 639 of file SIInstrInfo.h.

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

◆ isHighLatencyDef()

bool SIInstrInfo::isHighLatencyDef ( int Opc) const
override

Definition at line 9746 of file SIInstrInfo.cpp.

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

◆ isIGLP() [1/2]

bool llvm::SIInstrInfo::isIGLP ( const MachineInstr & MI) const
inline

Definition at line 1153 of file SIInstrInfo.h.

References isIGLP(), and MI.

Referenced by isIGLP().

◆ isIGLP() [2/2]

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

Definition at line 1148 of file SIInstrInfo.h.

Referenced by isGlobalMemoryObject().

◆ isIGLPMutationOnly()

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

◆ isIgnorableUse()

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

◆ isImage() [1/2]

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

◆ isImage() [2/2]

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

Definition at line 486 of file SIInstrInfo.h.

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

◆ isImmOperandLegal() [1/3]

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

Definition at line 1319 of file SIInstrInfo.h.

References isImmOperandLegal(), and MI.

◆ isImmOperandLegal() [2/3]

◆ isImmOperandLegal() [3/3]

bool SIInstrInfo::isImmOperandLegal ( const MCInstrDesc & InstDesc,
unsigned OpNo,
int64_t ImmVal ) const

◆ isInlineConstant() [1/10]

◆ isInlineConstant() [2/10]

◆ isInlineConstant() [3/10]

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 1266 of file SIInstrInfo.h.

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

◆ isInlineConstant() [4/10]

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 1279 of file SIInstrInfo.h.

References isInlineConstant(), MI, and OpIdx.

◆ isInlineConstant() [5/10]

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

Definition at line 1301 of file SIInstrInfo.h.

References llvm::MachineOperand::getImm(), isInlineConstant(), MI, and OpIdx.

◆ isInlineConstant() [6/10]

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

◆ isInlineConstant() [7/10]

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

◆ isInlineConstant() [8/10]

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

Definition at line 1259 of file SIInstrInfo.h.

References isInlineConstant().

◆ isInlineConstant() [9/10]

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

◆ isInlineConstant() [10/10]

bool SIInstrInfo::isInlineConstant ( int64_t ImmVal,
uint8_t OperandType ) const

Definition at line 4761 of file SIInstrInfo.cpp.

References 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::isInt(), isLegalAV64PseudoImm(), llvm::AMDGPU::isPKFMACF16InlineConstant(), llvm::isUInt(), 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_C_AV64_PSEUDO, llvm::AMDGPU::OPERAND_INLINE_SPLIT_BARRIER_INT32, llvm::AMDGPU::OPERAND_INPUT_MODS, llvm::AMDGPU::OPERAND_KIMM16, llvm::AMDGPU::OPERAND_KIMM32, llvm::AMDGPU::OPERAND_KIMM64, llvm::MCOI::OPERAND_PCREL, llvm::AMDGPU::OPERAND_REG_IMM_BF16, llvm::AMDGPU::OPERAND_REG_IMM_FP16, llvm::AMDGPU::OPERAND_REG_IMM_FP32, 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_NOINLINE_V2FP16, llvm::AMDGPU::OPERAND_REG_IMM_V2BF16, llvm::AMDGPU::OPERAND_REG_IMM_V2FP16, llvm::AMDGPU::OPERAND_REG_IMM_V2FP16_SPLAT, llvm::AMDGPU::OPERAND_REG_IMM_V2FP32, llvm::AMDGPU::OPERAND_REG_IMM_V2INT16, llvm::AMDGPU::OPERAND_REG_IMM_V2INT32, llvm::AMDGPU::OPERAND_REG_INLINE_AC_FP32, llvm::AMDGPU::OPERAND_REG_INLINE_AC_FP64, llvm::AMDGPU::OPERAND_REG_INLINE_AC_INT32, 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_V2INT16, llvm::MCOI::OPERAND_REGISTER, and llvm::MCOI::OPERAND_UNKNOWN.

◆ isKillTerminator()

bool SIInstrInfo::isKillTerminator ( unsigned Opcode)
static

Definition at line 10097 of file SIInstrInfo.cpp.

◆ isLDSDIR() [1/2]

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

Definition at line 1003 of file SIInstrInfo.h.

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

◆ isLDSDIR() [2/2]

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

Definition at line 1007 of file SIInstrInfo.h.

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

◆ isLDSDMA() [1/2]

◆ isLDSDMA() [2/2]

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

Definition at line 630 of file SIInstrInfo.h.

References llvm::get(), isFLAT(), isMUBUF(), isVALU(), and llvm::SIInstrFlags::TENSOR_CNT.

◆ isLegalAV64PseudoImm()

bool SIInstrInfo::isLegalAV64PseudoImm ( uint64_t Imm) const

Check if this immediate value can be used for AV_MOV_B64_IMM_PSEUDO.

Definition at line 4914 of file SIInstrInfo.cpp.

References llvm::Hi_32(), llvm::AMDGPU::isInlinableLiteral32(), and llvm::Lo_32().

Referenced by isInlineConstant().

◆ isLegalFLATOffset()

bool SIInstrInfo::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 with the given FlatVariant.

Definition at line 10241 of file SIInstrInfo.cpp.

References allowNegativeFlatOffset(), llvm::SIInstrFlags::FLAT, llvm::AMDGPUAS::FLAT_ADDRESS, llvm::SIInstrFlags::FlatScratch, llvm::AMDGPU::getNumFlatOffsetBits(), llvm::AMDGPUAS::GLOBAL_ADDRESS, llvm::isIntN(), N, and llvm::Offset.

Referenced by splitFlatOffset().

◆ isLegalGFX12PlusPackedMathFP32Operand()

bool SIInstrInfo::isLegalGFX12PlusPackedMathFP32Operand ( const MachineRegisterInfo & MRI,
const MachineInstr & MI,
unsigned SrcN,
const MachineOperand * MO = nullptr ) const

Check if MO would be a legal operand for gfx12+ packed math FP32 instructions.

Packed math FP32 instructions typically accept SGPRs or VGPRs as source operands. On gfx12+, if a source operand uses SGPRs, the HW can only read the first SGPR and use it for both the low and high operations. SrcN can be 0, 1, or 2, representing src0, src1, and src2, respectively. If MO is nullptr, the operand corresponding to SrcN will be used.

Definition at line 6464 of file SIInstrInfo.cpp.

References AbstractManglingParser< Derived, Alloc >::NumOps, assert(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isReg(), MI, llvm::SISrcMods::OP_SEL_0, and llvm::SISrcMods::OP_SEL_1.

Referenced by isLegalRegOperand(), legalizeOperandsVOP3(), and verifyInstruction().

◆ isLegalMUBUFImmOffset()

bool SIInstrInfo::isLegalMUBUFImmOffset ( unsigned Imm) const

Definition at line 10118 of file SIInstrInfo.cpp.

References getMaxMUBUFImmOffset().

◆ isLegalRegOperand() [1/2]

◆ isLegalRegOperand() [2/2]

bool SIInstrInfo::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 or operand index.

The operand index version provide more legality checks

Definition at line 6358 of file SIInstrInfo.cpp.

References llvm::TargetRegisterClass::contains(), llvm::MachineInstr::getMF(), llvm::MachineOperand::getParent(), llvm::MachineOperand::getReg(), llvm::MachineRegisterInfo::getRegClass(), llvm::MachineOperand::getSubReg(), and llvm::MachineOperand::isReg().

Referenced by isLegalRegOperand(), isLegalToSwap(), isLegalVSrcOperand(), isOperandLegal(), and legalizeOperandsVOP2().

◆ isLegalToSwap()

◆ 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 6453 of file SIInstrInfo.cpp.

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

◆ isLiteralOperandLegal()

bool SIInstrInfo::isLiteralOperandLegal ( const MCInstrDesc & InstDesc,
const MCOperandInfo & OpInfo ) const

◆ isLoadFromStackSlot()

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

◆ isLowLatencyInstruction()

bool SIInstrInfo::isLowLatencyInstruction ( const MachineInstr & MI) const

Definition at line 9740 of file SIInstrInfo.cpp.

References isSMRD(), MI, and Opc.

◆ isMAI() [1/3]

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

Definition at line 951 of file SIInstrInfo.h.

References isMAI(), and MI.

Referenced by isMAI().

◆ isMAI() [2/3]

◆ isMAI() [3/3]

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

Definition at line 953 of file SIInstrInfo.h.

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

Referenced by isMAI().

◆ isMFMA() [1/2]

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

◆ isMFMA() [2/2]

bool llvm::SIInstrInfo::isMFMA ( uint32_t Opcode) const
inline

Definition at line 960 of file SIInstrInfo.h.

References isMAI().

◆ isMFMAorWMMA() [1/2]

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

Definition at line 977 of file SIInstrInfo.h.

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

◆ isMFMAorWMMA() [2/2]

bool llvm::SIInstrInfo::isMFMAorWMMA ( uint32_t Opcode) const
inline

Definition at line 981 of file SIInstrInfo.h.

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

◆ isMIMG() [1/2]

◆ isMIMG() [2/2]

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

Definition at line 649 of file SIInstrInfo.h.

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

◆ isMTBUF() [1/2]

◆ isMTBUF() [2/2]

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

Definition at line 599 of file SIInstrInfo.h.

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

◆ isMUBUF() [1/2]

◆ isMUBUF() [2/2]

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

Definition at line 591 of file SIInstrInfo.h.

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

◆ isNeverCoissue()

bool SIInstrInfo::isNeverCoissue ( MachineInstr & MI) const

Definition at line 6620 of file SIInstrInfo.cpp.

References isDOT(), isMFMA(), isTRANS(), isVALU(), and MI.

◆ isNeverUniform()

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

Definition at line 1103 of file SIInstrInfo.h.

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

Referenced by getInstructionUniformity().

◆ isOperandLegal()

◆ isPacked() [1/2]

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

Definition at line 539 of file SIInstrInfo.h.

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

◆ isPacked() [2/2]

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

Definition at line 543 of file SIInstrInfo.h.

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

◆ isReMaterializableImpl()

bool SIInstrInfo::isReMaterializableImpl ( const MachineInstr & MI) const
override

Definition at line 129 of file SIInstrInfo.cpp.

References canRemat(), llvm::TargetInstrInfo::isReMaterializableImpl(), and MI.

◆ isSafeToSink()

◆ isSALU() [1/2]

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

◆ isSALU() [2/2]

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

Definition at line 470 of file SIInstrInfo.h.

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

◆ isSBarrierSCCWrite()

bool llvm::SIInstrInfo::isSBarrierSCCWrite ( unsigned Opcode)
inlinestatic

Definition at line 836 of file SIInstrInfo.h.

◆ isScalarStore() [1/2]

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 1051 of file SIInstrInfo.h.

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

◆ isScalarStore() [2/2]

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

Definition at line 1055 of file SIInstrInfo.h.

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

◆ isScalarUnit()

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

Definition at line 1019 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 4521 of file SIInstrInfo.cpp.

References changesVGPRIndexingMode(), MBB, and MI.

◆ isSDWA() [1/2]

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

Definition at line 571 of file SIInstrInfo.h.

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

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

◆ isSDWA() [2/2]

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

Definition at line 575 of file SIInstrInfo.h.

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

◆ isSegmentSpecificFLAT() [1/2]

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

◆ isSegmentSpecificFLAT() [2/2]

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

◆ isSGPRSpill() [1/2]

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

Definition at line 881 of file SIInstrInfo.h.

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

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

◆ isSGPRSpill() [2/2]

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

Definition at line 887 of file SIInstrInfo.h.

References isSALU(), and isSpill().

◆ isSGPRStackAccess()

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

◆ isSMRD() [1/2]

◆ isSMRD() [2/2]

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

Definition at line 611 of file SIInstrInfo.h.

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

◆ isSOP1() [1/2]

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

Definition at line 499 of file SIInstrInfo.h.

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

◆ isSOP1() [2/2]

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

Definition at line 503 of file SIInstrInfo.h.

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

◆ isSOP2() [1/2]

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

Definition at line 507 of file SIInstrInfo.h.

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

Referenced by verifyInstruction().

◆ isSOP2() [2/2]

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

Definition at line 511 of file SIInstrInfo.h.

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

◆ isSOPC() [1/2]

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

Definition at line 515 of file SIInstrInfo.h.

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

Referenced by verifyInstruction().

◆ isSOPC() [2/2]

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

Definition at line 519 of file SIInstrInfo.h.

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

◆ isSOPK() [1/2]

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

Definition at line 523 of file SIInstrInfo.h.

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

Referenced by isBranchOffsetInRange(), and verifyInstruction().

◆ isSOPK() [2/2]

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

Definition at line 527 of file SIInstrInfo.h.

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

◆ isSOPP() [1/2]

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

Definition at line 531 of file SIInstrInfo.h.

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

Referenced by isBranchOffsetInRange().

◆ isSOPP() [2/2]

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

Definition at line 535 of file SIInstrInfo.h.

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

◆ isSpill() [1/3]

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

Definition at line 901 of file SIInstrInfo.h.

References isSpill(), and MI.

Referenced by isSpill().

◆ isSpill() [2/3]

bool llvm::SIInstrInfo::isSpill ( const MCInstrDesc & Desc)
inlinestatic

Definition at line 897 of file SIInstrInfo.h.

References llvm::SIInstrFlags::Spill.

◆ isSpill() [3/3]

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

◆ isStackAccess()

◆ isStoreToStackSlot()

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

◆ isSWMMAC() [1/2]

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

◆ isSWMMAC() [2/2]

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

Definition at line 989 of file SIInstrInfo.h.

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

◆ isTRANS() [1/2]

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

Definition at line 923 of file SIInstrInfo.h.

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

Referenced by isNeverCoissue().

◆ isTRANS() [2/2]

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

Definition at line 927 of file SIInstrInfo.h.

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

◆ isVALU() [1/2]

◆ isVALU() [2/2]

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

Definition at line 478 of file SIInstrInfo.h.

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

◆ isVGPRCopy()

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

Definition at line 1209 of file SIInstrInfo.h.

References assert(), llvm::MachineFunction::getRegInfo(), and MI.

◆ isVGPRSpill() [1/2]

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

Definition at line 869 of file SIInstrInfo.h.

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

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

◆ isVGPRSpill() [2/2]

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

Definition at line 875 of file SIInstrInfo.h.

References isSpill(), and isVALU().

◆ isVIMAGE() [1/2]

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

Definition at line 653 of file SIInstrInfo.h.

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

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

◆ isVIMAGE() [2/2]

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

Definition at line 657 of file SIInstrInfo.h.

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

◆ isVINTERP() [1/2]

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

Definition at line 1011 of file SIInstrInfo.h.

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

◆ isVINTERP() [2/2]

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

Definition at line 1015 of file SIInstrInfo.h.

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

◆ isVINTRP() [1/2]

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

Definition at line 939 of file SIInstrInfo.h.

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

◆ isVINTRP() [2/2]

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

Definition at line 943 of file SIInstrInfo.h.

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

◆ isVMEM() [1/2]

◆ isVMEM() [2/2]

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

Definition at line 494 of file SIInstrInfo.h.

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

◆ isVOP1() [1/2]

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

Definition at line 547 of file SIInstrInfo.h.

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

Referenced by canRemat().

◆ isVOP1() [2/2]

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

Definition at line 551 of file SIInstrInfo.h.

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

◆ isVOP2() [1/2]

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

Definition at line 555 of file SIInstrInfo.h.

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

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

◆ isVOP2() [2/2]

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

Definition at line 559 of file SIInstrInfo.h.

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

◆ isVOP3() [1/3]

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

Definition at line 567 of file SIInstrInfo.h.

References isVOP3(), and MI.

Referenced by isVOP3().

◆ isVOP3() [2/3]

◆ isVOP3() [3/3]

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

Definition at line 569 of file SIInstrInfo.h.

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

Referenced by isVOP3().

◆ isVOP3P() [1/2]

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

Definition at line 931 of file SIInstrInfo.h.

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

◆ isVOP3P() [2/2]

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

Definition at line 935 of file SIInstrInfo.h.

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

◆ isVOPC() [1/2]

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

Definition at line 579 of file SIInstrInfo.h.

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

Referenced by legalizeOperands(), and verifyInstruction().

◆ isVOPC() [2/2]

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

Definition at line 583 of file SIInstrInfo.h.

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

◆ isVSAMPLE() [1/2]

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

Definition at line 661 of file SIInstrInfo.h.

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

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

◆ isVSAMPLE() [2/2]

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

Definition at line 665 of file SIInstrInfo.h.

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

◆ isWaitcnt()

bool llvm::SIInstrInfo::isWaitcnt ( unsigned Opcode)
inlinestatic

Definition at line 1186 of file SIInstrInfo.h.

References getNonSoftWaitcntOpcode().

◆ isWave32()

bool llvm::SIInstrInfo::isWave32 ( ) const

Definition at line 10653 of file SIInstrInfo.cpp.

◆ isWMMA() [1/2]

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

◆ isWMMA() [2/2]

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

Definition at line 973 of file SIInstrInfo.h.

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

◆ isWQM() [1/2]

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

Definition at line 848 of file SIInstrInfo.h.

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

◆ isWQM() [2/2]

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

Definition at line 852 of file SIInstrInfo.h.

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

◆ isWWMRegSpillOpcode()

bool llvm::SIInstrInfo::isWWMRegSpillOpcode ( uint32_t Opcode)
inlinestatic

Definition at line 903 of file SIInstrInfo.h.

Referenced by canAddToBBProlog().

◆ isXDL()

bool SIInstrInfo::isXDL ( const MachineInstr & MI) const

◆ isXDLWMMA()

bool SIInstrInfo::isXDLWMMA ( const MachineInstr & MI) const

Definition at line 11350 of file SIInstrInfo.cpp.

References llvm::AMDGPU::getWMMAIsXDL(), isSWMMAC(), isWMMA(), and MI.

Referenced by isXDL().

◆ legalizeGenericOperand()

◆ 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 7393 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::MachineRegisterInfo::createVirtualRegister(), llvm::Dead, DL, extractRsrcPtr(), llvm::get(), llvm::AMDGPU::getAddr64Inst(), llvm::Function::getCallingConv(), llvm::MachineInstr::getDebugLoc(), llvm::MachineBasicBlock::getFirstTerminator(), llvm::MachineFunction::getFunction(), llvm::AMDGPU::getIfAddr64Inst(), getNamedImmOperand(), getNamedOperand(), getOpRegClass(), llvm::MachineOperand::getReg(), llvm::MachineRegisterInfo::getRegClass(), llvm::MachineFunction::getRegInfo(), I, isFLAT(), llvm::AMDGPU::isGraphics(), isImage(), isMIMG(), isMTBUF(), isMUBUF(), llvm::MachineOperand::isReg(), isSMRD(), isVIMAGE(), llvm::Register::isVirtual(), isVOP2(), isVOP3(), isVOPC(), isVSAMPLE(), llvm::Kill, legalizeGenericOperand(), legalizeOperandsFLAT(), legalizeOperandsSMRD(), legalizeOperandsVOP2(), legalizeOperandsVOP3(), loadScalarOperandsFromVGPR(), MBB, MI, llvm::Offset, readlaneVGPRToSGPR(), llvm::MachineOperand::setReg(), and llvm::AMDGPUSubtarget::VOLCANIC_ISLANDS.

Referenced by foldImmediate(), and moveToVALUImpl().

◆ legalizeOperandsFLAT()

◆ legalizeOperandsSMRD()

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

◆ legalizeOperandsVALUt16() [1/2]

void SIInstrInfo::legalizeOperandsVALUt16 ( MachineInstr & Inst,
MachineRegisterInfo & MRI ) const

Fix operands in Inst to fix 16bit SALU to VALU lowering.

Definition at line 7814 of file SIInstrInfo.cpp.

References legalizeOperandsVALUt16(), MI, and OpIdx.

Referenced by legalizeOperandsVALUt16(), and moveToVALUImpl().

◆ legalizeOperandsVALUt16() [2/2]

◆ legalizeOperandsVOP2()

◆ legalizeOperandsVOP3()

◆ 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 6292 of file SIInstrInfo.cpp.

References llvm::MachineInstrBuilder::add(), llvm::BuildMI(), llvm::MachineOperand::ChangeToRegister(), llvm::MachineRegisterInfo::createVirtualRegister(), DL, llvm::get(), I, llvm::MachineOperand::isReg(), MBB, MI, OpIdx, and Size.

Referenced by legalizeOperandsVOP2(), and legalizeOperandsVOP3().

◆ loadRegFromStackSlot()

◆ mayAccessFlatAddressSpace()

bool SIInstrInfo::mayAccessFlatAddressSpace ( const MachineInstr & MI) const

Definition at line 9912 of file SIInstrInfo.cpp.

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

◆ mayAccessLDSThroughFlat()

bool SIInstrInfo::mayAccessLDSThroughFlat ( const MachineInstr & MI) const
Returns
true for FLAT instructions that can access LDS.

Definition at line 4617 of file SIInstrInfo.cpp.

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

◆ mayAccessScratch()

bool SIInstrInfo::mayAccessScratch ( const MachineInstr & MI) const
Returns
true for SCRATCH_ instructions, or FLAT/BUF instructions unless the MMOs do not include scratch. Conservatively correct; will return true if MI cannot be proven to not hit scratch.

Definition at line 4559 of file SIInstrInfo.cpp.

References llvm::any_of(), isBUF(), isFLAT(), isFLATGlobal(), isFLATScratch(), MI, and llvm::AMDGPUAS::PRIVATE_ADDRESS.

◆ mayAccessVMEMThroughFlat()

bool SIInstrInfo::mayAccessVMEMThroughFlat ( const MachineInstr & MI) const
Returns
true for FLAT instructions that can access VMEM.

Definition at line 4590 of file SIInstrInfo.cpp.

References assert(), isFLAT(), llvm::AMDGPUAS::LOCAL_ADDRESS, MI, llvm::AMDGPUAS::REGION_ADDRESS, and usesVM_CNT().

◆ 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 4697 of file SIInstrInfo.cpp.

References isSALU(), llvm::isTargetSpecificOpcode(), and MI.

◆ mayWriteLDSThroughDMA()

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

Definition at line 828 of file SIInstrInfo.h.

References isLDSDMA(), MI, and Opc.

◆ modifiesModeRegister()

bool SIInstrInfo::modifiesModeRegister ( const MachineInstr & MI)
static

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

Definition at line 4643 of file SIInstrInfo.cpp.

References llvm::is_contained(), and MI.

Referenced by hasUnwantedEffectsWhenEXECEmpty().

◆ moveFlatAddrToVGPR()

◆ 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 7820 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 7841 of file SIInstrInfo.cpp.

References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::AMDGPU::LaneMaskConstants::AndOpc, assert(), llvm::BitWidth, llvm::BuildMI(), Changed, llvm::MachineRegisterInfo::clearKillFlags(), llvm::MachineRegisterInfo::constrainRegClass(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::Define, DL, llvm::MachineInstr::eraseFromParent(), llvm::AMDGPU::LaneMaskConstants::ExecReg, llvm::MachineInstr::explicit_operands(), llvm::MachineInstr::findRegisterDefOperandIdx(), fixImplicitOperands(), llvm::AMDGPU::LaneMaskConstants::get(), llvm::get(), llvm::MachineInstr::getDebugLoc(), llvm::MachineInstr::getFlags(), llvm::MachineOperand::getImm(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), getOpRegClass(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), getRegClass(), llvm::MachineRegisterInfo::getRegClass(), getVALUOp(), llvm::AMDGPUSubtarget::GFX12, llvm::AMDGPU::hasNamedOperand(), llvm::MachineInstr::implicit_operands(), llvm::MachineInstr::isCopy(), llvm::MachineOperand::isImm(), llvm::Register::isPhysical(), llvm::Register::isVirtual(), isVOP3(), legalizeOperands(), legalizeOperandsVALUt16(), llvm_unreachable, llvm::make_early_inc_range(), MBB, llvm::Offset, Opc, OpIdx, llvm::MachineInstr::removeOperand(), llvm::MachineRegisterInfo::replaceRegWith(), llvm::MachineInstrBuilder::setMIFlags(), llvm::MachineOperand::setReg(), llvm::MachineOperand::setSubReg(), Size, llvm::Undef, llvm::MachineRegisterInfo::use_operands(), UseMI, and llvm::AMDGPU::LaneMaskConstants::VccReg.

Referenced by moveToVALU().

◆ mutateAndCleanupImplicit()

void SIInstrInfo::mutateAndCleanupImplicit ( MachineInstr & MI,
const MCInstrDesc & NewDesc ) const

Definition at line 3590 of file SIInstrInfo.cpp.

References AbstractManglingParser< Derived, Alloc >::NumOps, I, and MI.

◆ optimizeCompareInstr()

◆ physRegUsesConstantBus()

bool SIInstrInfo::physRegUsesConstantBus ( const MachineOperand & Reg) const

◆ pseudoToMCOpcode()

◆ readlaneVGPRToSGPR()

Register SIInstrInfo::readlaneVGPRToSGPR ( Register SrcReg,
MachineInstr & UseMI,
MachineRegisterInfo & MRI,
const TargetRegisterClass * DstRC = nullptr ) const

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

The desired register class for the dst register (DstRC) can be optionally supplied. 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 6892 of file SIInstrInfo.cpp.

References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::get(), llvm::MachineRegisterInfo::getRegClass(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and UseMI.

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

◆ regUsesConstantBus()

◆ reMaterialize()

◆ removeBranch()

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

Definition at line 3286 of file SIInstrInfo.cpp.

References llvm::Count, getInstSizeInBytes(), llvm::make_early_inc_range(), MBB, and MI.

◆ removeModOperands()

void SIInstrInfo::removeModOperands ( MachineInstr & MI) const

Definition at line 3581 of file SIInstrInfo.cpp.

References MI, ModifierOpNames, Opc, and llvm::reverse().

Referenced by foldImmediate().

◆ restoreExec()

◆ reverseBranchCondition()

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

Definition at line 3364 of file SIInstrInfo.cpp.

References Cond, and llvm::getImm().

◆ setsSCCIfResultIsNonZero()

bool llvm::SIInstrInfo::setsSCCIfResultIsNonZero ( const MachineInstr & MI)
inlinestatic

Definition at line 740 of file SIInstrInfo.h.

References MI.

Referenced by optimizeCompareInstr().

◆ 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 619 of file SIInstrInfo.cpp.

References assert().

◆ sopkIsZext()

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

Definition at line 1041 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 10265 of file SIInstrInfo.cpp.

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

◆ splitMUBUFOffset()

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

◆ storeRegToStackSlot()

◆ swapSourceModifiers()

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

◆ usesASYNC_CNT() [1/2]

bool llvm::SIInstrInfo::usesASYNC_CNT ( const MachineInstr & MI)
inlinestatic

Definition at line 1031 of file SIInstrInfo.h.

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

◆ usesASYNC_CNT() [2/2]

bool llvm::SIInstrInfo::usesASYNC_CNT ( uint32_t Opcode) const
inline

Definition at line 1035 of file SIInstrInfo.h.

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

◆ usesConstantBus() [1/2]

bool llvm::SIInstrInfo::usesConstantBus ( const MachineRegisterInfo & MRI,
const MachineInstr & MI,
int OpIdx ) const
inline

Definition at line 1342 of file SIInstrInfo.h.

References MI, OpIdx, and usesConstantBus().

◆ usesConstantBus() [2/2]

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

◆ usesFPDPRounding() [1/2]

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

Definition at line 1087 of file SIInstrInfo.h.

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

◆ usesFPDPRounding() [2/2]

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

Definition at line 1091 of file SIInstrInfo.h.

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

◆ usesLGKM_CNT()

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

Definition at line 1027 of file SIInstrInfo.h.

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

Referenced by mayAccessLDSThroughFlat().

◆ usesVM_CNT()

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

Definition at line 1023 of file SIInstrInfo.h.

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

Referenced by mayAccessVMEMThroughFlat().

◆ verifyInstruction()

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

Definition at line 5180 of file SIInstrInfo.cpp.

References llvm::SISrcMods::ABS, llvm::all_of(), assert(), compareMachineOp(), llvm::TargetRegisterClass::contains(), llvm::Data, llvm::dbgs(), llvm::divideCeil(), llvm::AMDGPU::SDWA::DWORD, findImplicitSGPRRead(), llvm::get(), llvm::AMDGPU::getAddrSizeMIMGOp(), llvm::AMDGPU::getBasicFromSDWAOp(), llvm::getImm(), llvm::MachineOperand::getImm(), llvm::AMDGPU::getMIMGBaseOpcodeInfo(), llvm::AMDGPU::getMIMGDimInfoByEncoding(), llvm::AMDGPU::getMIMGInfo(), getNamedOperand(), getOpRegClass(), getOpSize(), llvm::MachineOperand::getReg(), llvm::SrcOp::getReg(), llvm::MachineFunction::getRegInfo(), llvm::MachineOperand::getSubReg(), llvm::AMDGPUSubtarget::GFX10, I, llvm::is_contained(), llvm::AMDGPU::isDPALU_DPP(), isDS(), llvm::MachineOperand::isFI(), isFLAT(), llvm::MachineOperand::isFPImm(), isGather4(), llvm::AMDGPU::isGFX12Plus(), llvm::MachineOperand::isIdenticalTo(), isImage(), llvm::MachineOperand::isImm(), llvm::MachineOperand::isImplicit(), isInlineConstant(), llvm::isInt(), llvm::AMDGPU::isLegalDPALU_DPPControl(), isLegalGFX12PlusPackedMathFP32Operand(), isMIMG(), llvm::AMDGPU::isPackedFP32Inst(), llvm::Register::isPhysical(), llvm::MachineOperand::isReg(), isRegOrFI(), isSALU(), isSDWA(), isSMRD(), isSOP2(), isSOPC(), isSOPK(), isSpill(), llvm::MachineRegisterInfo::isSSA(), isSubRegOf(), llvm::isUInt(), llvm::MachineOperand::isUse(), isVALU(), isVGPRSpill(), llvm::Register::isVirtual(), isVOP2(), isVOP3(), isVOPC(), isVSAMPLE(), LLVM_DEBUG, MI, llvm::InlineAsm::MIOp_FirstOperand, llvm::SISrcMods::NEG, llvm::Offset, llvm::MCOI::OPERAND_IMMEDIATE, llvm::AMDGPU::OPERAND_INLINE_C_AV64_PSEUDO, llvm::AMDGPU::OPERAND_INLINE_SPLIT_BARRIER_INT32, llvm::AMDGPU::OPERAND_INPUT_MODS, llvm::AMDGPU::OPERAND_KIMM16, llvm::AMDGPU::OPERAND_KIMM32, llvm::AMDGPU::OPERAND_KIMM64, llvm::MCOI::OPERAND_MEMORY, llvm::MCOI::OPERAND_PCREL, llvm::AMDGPU::OPERAND_REG_IMM_BF16, llvm::AMDGPU::OPERAND_REG_IMM_FP16, llvm::AMDGPU::OPERAND_REG_IMM_FP32, 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_NOINLINE_V2FP16, llvm::AMDGPU::OPERAND_REG_IMM_V2BF16, llvm::AMDGPU::OPERAND_REG_IMM_V2FP16, llvm::AMDGPU::OPERAND_REG_IMM_V2FP16_SPLAT, llvm::AMDGPU::OPERAND_REG_IMM_V2FP32, llvm::AMDGPU::OPERAND_REG_IMM_V2INT16, llvm::AMDGPU::OPERAND_REG_IMM_V2INT32, llvm::AMDGPU::OPERAND_REG_INLINE_AC_FP32, llvm::AMDGPU::OPERAND_REG_INLINE_AC_FP64, llvm::AMDGPU::OPERAND_REG_INLINE_AC_INT32, 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_V2INT16, llvm::MCOI::OPERAND_REGISTER, llvm::AMDGPU::OPERAND_SDWA_VOPC_DST, llvm::MCOI::OPERAND_UNKNOWN, OpIdx, llvm::popcount(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::AMDGPU::CPol::SCAL, llvm::SISrcMods::SEXT, shouldReadExec(), sopkIsZext(), llvm::AMDGPU::supportsScaleOffset(), 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: