LLVM 22.0.0git
llvm::SIInstrInfo Class Referencefinal

#include "Target/AMDGPU/SIInstrInfo.h"

Inheritance diagram for llvm::SIInstrInfo:
[legend]

Public Types

enum  TargetOperandFlags {
  MO_MASK = 0xf , MO_NONE = 0 , MO_GOTPCREL = 1 , MO_GOTPCREL32 = 2 ,
  MO_GOTPCREL32_LO = 2 , MO_GOTPCREL32_HI = 3 , MO_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
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, const TargetRegisterInfo *TRI, Register VReg, MachineInstr::MIFlag Flags=MachineInstr::NoFlags) const override
void loadRegFromStackSlot (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, Register DestReg, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI, Register VReg, 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, const TargetRegisterInfo &TRI) const override
std::pair< MachineInstr *, MachineInstr * > expandMovDPP64 (MachineInstr &MI) const
unsigned getMovOpcode (const TargetRegisterClass *DstRC) const
const MCInstrDescgetIndirectRegWriteMovRelPseudo (unsigned VecSize, unsigned EltSize, bool IsSGPR) const
const MCInstrDescgetIndirectGPRIDXPseudo (unsigned VecSize, bool IsIndirectSrc) const
LLVM_READONLY int commuteOpcode (unsigned Opc) const
LLVM_READONLY int commuteOpcode (const MachineInstr &MI) const
bool findCommutedOpIndices (const MachineInstr &MI, unsigned &SrcOpIdx0, unsigned &SrcOpIdx1) const override
bool findCommutedOpIndices (const MCInstrDesc &Desc, unsigned &SrcOpIdx0, unsigned &SrcOpIdx1) const
bool isBranchOffsetInRange (unsigned BranchOpc, int64_t BrOffset) const override
MachineBasicBlockgetBranchDestBlock (const MachineInstr &MI) const override
bool hasDivergentBranch (const MachineBasicBlock *MBB) const
 Return whether the block terminate with divergent branch.
void insertIndirectBranch (MachineBasicBlock &MBB, MachineBasicBlock &NewDestBB, MachineBasicBlock &RestoreBB, const DebugLoc &DL, int64_t BrOffset, RegScavenger *RS) const override
bool analyzeBranchImpl (MachineBasicBlock &MBB, MachineBasicBlock::iterator I, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify) const
bool analyzeBranch (MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify=false) const override
unsigned removeBranch (MachineBasicBlock &MBB, int *BytesRemoved=nullptr) const override
unsigned insertBranch (MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef< MachineOperand > Cond, const DebugLoc &DL, int *BytesAdded=nullptr) const override
bool reverseBranchCondition (SmallVectorImpl< MachineOperand > &Cond) const override
bool canInsertSelect (const MachineBasicBlock &MBB, ArrayRef< MachineOperand > Cond, Register DstReg, Register TrueReg, Register FalseReg, int &CondCycles, int &TrueCycles, int &FalseCycles) const override
void insertSelect (MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, Register DstReg, ArrayRef< MachineOperand > Cond, Register TrueReg, Register FalseReg) const override
void insertVectorSelect (MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, Register DstReg, ArrayRef< MachineOperand > Cond, Register TrueReg, Register FalseReg) const
bool analyzeCompare (const MachineInstr &MI, Register &SrcReg, Register &SrcReg2, int64_t &CmpMask, int64_t &CmpValue) const override
bool optimizeCompareInstr (MachineInstr &CmpInstr, Register SrcReg, Register SrcReg2, int64_t CmpMask, int64_t CmpValue, const MachineRegisterInfo *MRI) const override
bool areMemAccessesTriviallyDisjoint (const MachineInstr &MIa, const MachineInstr &MIb) const override
void removeModOperands (MachineInstr &MI) const
bool foldImmediate (MachineInstr &UseMI, MachineInstr &DefMI, Register Reg, MachineRegisterInfo *MRI) const final
unsigned getMachineCSELookAheadLimit () const override
MachineInstrconvertToThreeAddress (MachineInstr &MI, LiveVariables *LV, LiveIntervals *LIS) const override
bool isSchedulingBoundary (const MachineInstr &MI, const MachineBasicBlock *MBB, const MachineFunction &MF) const override
bool isSALU (uint16_t Opcode) const
bool isVALU (uint16_t Opcode) const
bool isImage (uint16_t Opcode) const
bool isVMEM (uint16_t Opcode) const
bool isSOP1 (uint16_t Opcode) const
bool isSOP2 (uint16_t Opcode) const
bool isSOPC (uint16_t Opcode) const
bool isSOPK (uint16_t Opcode) const
bool isSOPP (uint16_t Opcode) const
bool isPacked (uint16_t Opcode) const
bool isVOP1 (uint16_t Opcode) const
bool isVOP2 (uint16_t Opcode) const
bool isVOP3 (uint16_t Opcode) const
bool isSDWA (uint16_t Opcode) const
bool isVOPC (uint16_t Opcode) const
bool isMUBUF (uint16_t Opcode) const
bool isMTBUF (uint16_t Opcode) const
bool isSMRD (uint16_t Opcode) const
bool isBufferSMRD (const MachineInstr &MI) const
bool isDS (uint16_t Opcode) const
bool isLDSDMA (uint16_t Opcode)
bool isGWS (uint16_t Opcode) const
bool isAlwaysGDS (uint16_t Opcode) const
bool isMIMG (uint16_t Opcode) const
bool isVIMAGE (uint16_t Opcode) const
bool isVSAMPLE (uint16_t Opcode) const
bool isGather4 (uint16_t Opcode) const
bool isSegmentSpecificFLAT (uint16_t Opcode) const
bool isFLATGlobal (uint16_t Opcode) const
bool isFLATScratch (uint16_t Opcode) const
bool isFLAT (uint16_t Opcode) const
bool mayAccessScratchThroughFlat (const MachineInstr &MI) const
bool mayAccessVMEMThroughFlat (const MachineInstr &MI) const
bool mayAccessLDSThroughFlat (const MachineInstr &MI) const
bool isEXP (uint16_t Opcode) const
bool isAtomicNoRet (uint16_t Opcode) const
bool isAtomicRet (uint16_t Opcode) const
bool isAtomic (uint16_t Opcode) const
bool isWQM (uint16_t Opcode) const
bool isDisableWQM (uint16_t Opcode) const
bool isVGPRSpill (uint16_t Opcode) const
bool isSGPRSpill (uint16_t Opcode) const
bool isSpill (uint16_t Opcode) const
bool isDPP (uint16_t Opcode) const
bool isTRANS (uint16_t Opcode) const
bool isVOP3P (uint16_t Opcode) const
bool isVINTRP (uint16_t Opcode) const
bool isMAI (uint16_t Opcode) const
bool isWMMA (uint16_t Opcode) const
bool isSWMMAC (uint16_t Opcode) const
bool isDOT (uint16_t Opcode) const
bool isXDLWMMA (const MachineInstr &MI) const
bool isXDL (const MachineInstr &MI) const
bool isLDSDIR (uint16_t Opcode) const
bool isVINTERP (uint16_t Opcode) const
bool isScalarStore (uint16_t Opcode) const
bool isFixedSize (uint16_t Opcode) const
bool hasFPClamp (uint16_t Opcode) const
uint64_t getClampMask (const MachineInstr &MI) const
bool usesFPDPRounding (uint16_t Opcode) const
bool isFPAtomic (uint16_t Opcode) const
bool isBarrierStart (unsigned Opcode) const
bool isBarrier (unsigned Opcode) const
bool doesNotReadTiedSource (uint16_t Opcode) const
bool 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
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 (uint16_t Opcode, unsigned OpNo) const
 Return the size in bytes of the operand OpNo on the given.
unsigned getOpSize (const MachineInstr &MI, unsigned OpNo) const
 This form should usually be preferred since it handles operands with unknown register classes.
void legalizeOpWithMove (MachineInstr &MI, unsigned OpIdx) const
 Legalize the OpIndex operand of this instruction by inserting a MOV.
bool isOperandLegal (const MachineInstr &MI, unsigned OpIdx, const MachineOperand *MO=nullptr) const
 Check if MO is a legal operand if it was the OpIdx Operand for MI.
bool isLegalVSrcOperand (const MachineRegisterInfo &MRI, const MCOperandInfo &OpInfo, const MachineOperand &MO) const
 Check if MO would be a valid operand for the given operand definition OpInfo.
bool isLegalRegOperand (const MachineRegisterInfo &MRI, const MCOperandInfo &OpInfo, const MachineOperand &MO) const
 Check if MO (a register operand) is a legal register for the given operand description 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) const override
 This is the hazard recognizer used at -O0 by the PostRAHazardRecognizer pass.
ScheduleHazardRecognizerCreateTargetMIHazardRecognizer (const InstrItineraryData *II, const ScheduleDAGMI *DAG) const override
unsigned getLiveRangeSplitOpcode (Register Reg, const MachineFunction &MF) const override
bool isBasicBlockPrologue (const MachineInstr &MI, Register Reg=Register()) const override
MachineInstrcreatePHIDestinationCopy (MachineBasicBlock &MBB, MachineBasicBlock::iterator InsPt, const DebugLoc &DL, Register Src, Register Dst) const override
MachineInstrcreatePHISourceCopy (MachineBasicBlock &MBB, MachineBasicBlock::iterator InsPt, const DebugLoc &DL, Register Src, unsigned SrcSubReg, Register Dst) const override
bool isWave32 () const
MachineInstrBuilder getAddNoCarry (MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, Register DestReg) const
 Return a partially built integer add instruction without carry.
MachineInstrBuilder getAddNoCarry (MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, Register DestReg, RegScavenger &RS) const
const MCInstrDescgetKillTerminatorFromPseudo (unsigned Opcode) const
bool isLegalMUBUFImmOffset (unsigned Imm) const
bool splitMUBUFOffset (uint32_t Imm, uint32_t &SOffset, uint32_t &ImmOffset, Align Alignment=Align(4)) const
bool isLegalFLATOffset (int64_t Offset, unsigned AddrSpace, uint64_t FlatVariant) const
 Returns if Offset is legal for the subtarget as the offset to a FLAT encoded instruction 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.
const TargetRegisterClassgetRegClass (const MCInstrDesc &TID, unsigned OpNum, const TargetRegisterInfo *TRI) const override
void fixImplicitOperands (MachineInstr &MI) const
MachineInstrfoldMemoryOperandImpl (MachineFunction &MF, MachineInstr &MI, ArrayRef< unsigned > Ops, MachineBasicBlock::iterator InsertPt, int FrameIndex, LiveIntervals *LIS=nullptr, VirtRegMap *VRM=nullptr) const override
unsigned getInstrLatency (const InstrItineraryData *ItinData, const MachineInstr &MI, unsigned *PredCost=nullptr) const override
InstructionUniformity getInstructionUniformity (const MachineInstr &MI) const override final
InstructionUniformity getGenericInstructionUniformity (const MachineInstr &MI) const
const MIRFormattergetMIRFormatter () const override
const TargetSchedModelgetSchedModel () const
void enforceOperandRCAlignment (MachineInstr &MI, AMDGPU::OpName OpName) const

Static Public Member Functions

static bool isFoldableCopy (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 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 (uint16_t Opcode)
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 (uint16_t Opcode)
static bool isChainCallOpcode (uint64_t Opcode)
static bool isDPP (const MachineInstr &MI)
static bool isTRANS (const MachineInstr &MI)
static bool isVOP3P (const MachineInstr &MI)
static bool isVINTRP (const MachineInstr &MI)
static bool isMAI (const 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 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 90 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 210 of file SIInstrInfo.h.

Constructor & Destructor Documentation

◆ SIInstrInfo()

SIInstrInfo::SIInstrInfo ( const GCNSubtarget & ST)
explicit

Definition at line 65 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 9932 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 3127 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 3090 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 10525 of file SIInstrInfo.cpp.

References MI, and Register.

◆ areLoadsFromSameBasePtr()

◆ areMemAccessesTriviallyDisjoint()

◆ buildExtractSubReg()

◆ buildExtractSubRegOrImm()

◆ buildShrunkInst()

◆ canInsertSelect()

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

Definition at line 3264 of file SIInstrInfo.cpp.

References Cond, llvm::getImm(), llvm::AMDGPU::getRegBitWidth(), MBB, and MRI.

◆ canShrink()

◆ commuteInstructionImpl()

◆ commuteOpcode() [1/2]

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

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

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

◆ CreateTargetPostRAHazardRecognizer() [2/2]

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

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

Definition at line 9609 of file SIInstrInfo.cpp.

◆ decomposeMachineOperandsTargetFlags()

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

Definition at line 9628 of file SIInstrInfo.cpp.

References MO_MASK.

◆ doesNotReadTiedSource() [1/2]

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

Definition at line 1044 of file SIInstrInfo.h.

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

◆ doesNotReadTiedSource() [2/2]

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

Definition at line 1048 of file SIInstrInfo.h.

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

◆ enforceOperandRCAlignment()

◆ expandMovDPP64()

◆ expandPostRAPseudo()

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

Definition at line 2033 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::MachineInstrBuilder::copyImplicitOps(), llvm::MachineOperand::CreateImm(), llvm::RegState::Define, DL, llvm::AMDGPU::VGPRIndexMode::DST_ENABLE, 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(), llvm::MachineFunction::getSubtarget(), llvm::Hi, llvm::RegState::Implicit, llvm::MCInstrDesc::implicit_uses(), llvm::RegState::ImplicitDefine, llvm::SIRegisterInfo::isAGPRClass(), llvm::MachineOperand::isGlobal(), isInlineConstant(), llvm::isUInt(), llvm::Lo, MBB, MI, llvm::AMDGPU::LaneMaskConstants::MovOpc, 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, SubReg, llvm::MachineInstr::tieOperands(), TRI, llvm::RegState::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 3452 of file SIInstrInfo.cpp.

References llvm_unreachable, and llvm::SignExtend64().

Referenced by foldImmediate().

◆ findCommutedOpIndices() [1/2]

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

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

References Opc.

◆ fixImplicitOperands()

void SIInstrInfo::fixImplicitOperands ( MachineInstr & MI) const

Definition at line 9768 of file SIInstrInfo.cpp.

References MI.

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

◆ foldImmediate()

◆ foldMemoryOperandImpl()

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

◆ getAddNoCarry() [1/2]

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

Return a partially built integer add instruction without carry.

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

Definition at line 9698 of file SIInstrInfo.cpp.

References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::RegState::Dead, llvm::RegState::Define, DL, llvm::get(), I, MBB, and MRI.

◆ getAddNoCarry() [2/2]

◆ getBranchDestBlock()

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

Definition at line 2894 of file SIInstrInfo.cpp.

References MI.

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

◆ getGenericInstructionUniformity()

◆ getIndirectGPRIDXPseudo()

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

Definition at line 1395 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 9468 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 10322 of file SIInstrInfo.cpp.

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

◆ getInstructionUniformity()

◆ getInstSizeInBytes()

◆ getKillTerminatorFromPseudo()

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

Definition at line 9746 of file SIInstrInfo.cpp.

References llvm::get(), and llvm_unreachable.

◆ getLiveRangeSplitOpcode()

◆ getMachineCSELookAheadLimit()

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

Definition at line 435 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 1457 of file SIInstrInfo.h.

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

Referenced by getInstSizeInBytes().

◆ getMemOperandsWithOffsetWidth()

◆ getMIRFormatter()

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

Definition at line 1587 of file SIInstrInfo.h.

◆ getMovOpcode()

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

Definition at line 1376 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 1443 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 1437 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 1065 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 2019 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 6054 of file SIInstrInfo.cpp.

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

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

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

◆ getOpSize() [2/2]

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

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

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

References Size.

◆ getRegClass()

◆ getRegisterInfo()

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

Definition at line 239 of file SIInstrInfo.h.

◆ getSchedModel()

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

Definition at line 1595 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 243 of file SIInstrInfo.h.

Referenced by shouldScheduleVOPDAdjacent().

◆ getVALUOp()

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

Definition at line 5731 of file SIInstrInfo.cpp.

References llvm_unreachable, MI, and MRI.

Referenced by moveToVALUImpl().

◆ getVectorRegSpillRestoreOpcode()

◆ getVectorRegSpillSaveOpcode()

◆ getWholeWaveFunctionSetup()

◆ hasAnyModifiersSet()

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

Definition at line 4699 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 2898 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 971 of file SIInstrInfo.h.

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

◆ hasFPClamp() [2/2]

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

Definition at line 975 of file SIInstrInfo.h.

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

◆ hasIntClamp()

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

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

References llvm::AMDGPU::hasNamedOperand().

◆ hasModifiersSet()

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

Definition at line 4693 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 4407 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 4674 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 1121 of file SIInstrInfo.h.

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

◆ insertBranch()

◆ insertEQ()

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

◆ insertIndirectBranch()

◆ insertNE()

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

◆ insertNoop()

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

Definition at line 1926 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 1931 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 ( uint16_t Opcode) const

Definition at line 4312 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 9961 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 ( uint16_t Opcode) const
inline

◆ isAtomicNoRet() [1/2]

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

Definition at line 727 of file SIInstrInfo.h.

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

◆ isAtomicNoRet() [2/2]

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

Definition at line 731 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 735 of file SIInstrInfo.h.

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

◆ isAtomicRet() [2/2]

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

Definition at line 739 of file SIInstrInfo.h.

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

◆ isBarrier()

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

Definition at line 1022 of file SIInstrInfo.h.

References isBarrierStart().

Referenced by hasUnwantedEffectsWhenEXECEmpty().

◆ isBarrierStart()

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

Definition at line 1014 of file SIInstrInfo.h.

Referenced by isBarrier().

◆ isBasicBlockPrologue()

◆ isBlockLoadStore()

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

Definition at line 697 of file SIInstrInfo.h.

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

◆ isBranchOffsetInRange()

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

Definition at line 2877 of file SIInstrInfo.cpp.

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

◆ isBufferSMRD()

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

Definition at line 9781 of file SIInstrInfo.cpp.

References isSMRD(), and MI.

◆ isCBranchVCCZRead()

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

Definition at line 763 of file SIInstrInfo.h.

References MI, and Opc.

◆ isChainCallOpcode()

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

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

References MI.

◆ isDGEMM()

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

Definition at line 913 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 777 of file SIInstrInfo.h.

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

◆ isDisableWQM() [2/2]

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

Definition at line 781 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 881 of file SIInstrInfo.h.

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

Referenced by isNeverCoissue(), and isXDL().

◆ isDOT() [2/2]

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

Definition at line 905 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 ( uint16_t Opcode) const
inline

Definition at line 840 of file SIInstrInfo.h.

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

◆ isDS() [1/2]

◆ isDS() [2/2]

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

Definition at line 594 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 ( uint16_t Opcode) const
inline

Definition at line 723 of file SIInstrInfo.h.

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

◆ isF16PseudoScalarTrans()

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

Definition at line 1036 of file SIInstrInfo.h.

Referenced by isOperandLegal().

◆ isFixedSize() [1/2]

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

Definition at line 963 of file SIInstrInfo.h.

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

Referenced by getInstSizeInBytes().

◆ isFixedSize() [2/2]

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

Definition at line 967 of file SIInstrInfo.h.

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

◆ isFLAT() [1/2]

◆ isFLAT() [2/2]

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

Definition at line 681 of file SIInstrInfo.h.

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

◆ isFLATGlobal() [1/2]

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

◆ isFLATGlobal() [2/2]

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

Definition at line 668 of file SIInstrInfo.h.

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

◆ isFLATScratch() [1/2]

◆ isFLATScratch() [2/2]

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

Definition at line 676 of file SIInstrInfo.h.

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

◆ isFoldableCopy()

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

Definition at line 3413 of file SIInstrInfo.cpp.

References MI.

Referenced by getFoldableImm().

◆ isFPAtomic() [1/2]

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

Definition at line 999 of file SIInstrInfo.h.

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

◆ isFPAtomic() [2/2]

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

Definition at line 1003 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 640 of file SIInstrInfo.h.

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

Referenced by verifyInstruction().

◆ isGather4() [2/2]

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

Definition at line 644 of file SIInstrInfo.h.

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

◆ isGFX12CacheInvOrWBInst()

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

Definition at line 1031 of file SIInstrInfo.h.

References Opc.

◆ isGlobalMemoryObject()

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

Definition at line 10769 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 606 of file SIInstrInfo.h.

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

Referenced by isAlwaysGDS().

◆ isGWS() [2/2]

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

Definition at line 610 of file SIInstrInfo.h.

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

◆ isHighLatencyDef()

bool SIInstrInfo::isHighLatencyDef ( int Opc) const
override

Definition at line 9414 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 1057 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 1052 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 ( uint16_t Opcode) const
inline

Definition at line 464 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 1223 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 1170 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 1183 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 1205 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 1163 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 4517 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::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_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 9736 of file SIInstrInfo.cpp.

◆ isLDSDIR() [1/2]

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

Definition at line 915 of file SIInstrInfo.h.

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

◆ isLDSDIR() [2/2]

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

Definition at line 919 of file SIInstrInfo.h.

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

◆ isLDSDMA() [1/2]

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

Definition at line 598 of file SIInstrInfo.h.

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

Referenced by areMemAccessesTriviallyDisjoint(), and mayWriteLDSThroughDMA().

◆ isLDSDMA() [2/2]

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

Definition at line 602 of file SIInstrInfo.h.

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

◆ 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 4668 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 9877 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 6233 of file SIInstrInfo.cpp.

References AbstractManglingParser< Derived, Alloc >::NumOps, assert(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isReg(), MI, MRI, 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 9757 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 6139 of file SIInstrInfo.cpp.

References llvm::TargetRegisterClass::contains(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getParent(), llvm::MachineOperand::getReg(), llvm::MachineOperand::getSubReg(), llvm::MachineOperand::isReg(), and MRI.

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

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

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

References isSMRD(), MI, and Opc.

◆ isMAI() [1/3]

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

Definition at line 872 of file SIInstrInfo.h.

References isMAI(), and MI.

Referenced by isMAI().

◆ isMAI() [2/3]

◆ isMAI() [3/3]

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

Definition at line 874 of file SIInstrInfo.h.

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

Referenced by isMAI().

◆ isMFMA()

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

Definition at line 876 of file SIInstrInfo.h.

References isMAI(), and MI.

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

◆ isMFMAorWMMA()

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

Definition at line 893 of file SIInstrInfo.h.

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

◆ isMIMG() [1/2]

◆ isMIMG() [2/2]

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

Definition at line 620 of file SIInstrInfo.h.

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

◆ isMTBUF() [1/2]

◆ isMTBUF() [2/2]

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

Definition at line 576 of file SIInstrInfo.h.

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

◆ isMUBUF() [1/2]

◆ isMUBUF() [2/2]

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

Definition at line 568 of file SIInstrInfo.h.

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

◆ isNeverCoissue()

bool SIInstrInfo::isNeverCoissue ( MachineInstr & MI) const

Definition at line 6388 of file SIInstrInfo.cpp.

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

◆ isNeverUniform()

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

Definition at line 1007 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 516 of file SIInstrInfo.h.

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

◆ isPacked() [2/2]

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

Definition at line 520 of file SIInstrInfo.h.

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

◆ isReMaterializableImpl()

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

Definition at line 127 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 ( uint16_t Opcode) const
inline

Definition at line 448 of file SIInstrInfo.h.

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

◆ isSBarrierSCCWrite()

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

Definition at line 757 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 955 of file SIInstrInfo.h.

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

◆ isScalarStore() [2/2]

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

Definition at line 959 of file SIInstrInfo.h.

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

◆ isScalarUnit()

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

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

References changesVGPRIndexingMode(), MBB, and MI.

◆ isSDWA() [1/2]

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

Definition at line 548 of file SIInstrInfo.h.

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

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

◆ isSDWA() [2/2]

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

Definition at line 552 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 ( uint16_t Opcode) const
inline

◆ isSGPRSpill() [1/2]

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

Definition at line 802 of file SIInstrInfo.h.

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

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

◆ isSGPRSpill() [2/2]

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

Definition at line 808 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 ( uint16_t Opcode) const
inline

Definition at line 584 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 476 of file SIInstrInfo.h.

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

◆ isSOP1() [2/2]

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

Definition at line 480 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 484 of file SIInstrInfo.h.

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

Referenced by verifyInstruction().

◆ isSOP2() [2/2]

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

Definition at line 488 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 492 of file SIInstrInfo.h.

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

Referenced by verifyInstruction().

◆ isSOPC() [2/2]

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

Definition at line 496 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 500 of file SIInstrInfo.h.

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

Referenced by isBranchOffsetInRange(), and verifyInstruction().

◆ isSOPK() [2/2]

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

Definition at line 504 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 508 of file SIInstrInfo.h.

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

Referenced by isBranchOffsetInRange().

◆ isSOPP() [2/2]

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

Definition at line 512 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 822 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 818 of file SIInstrInfo.h.

References llvm::SIInstrFlags::Spill.

◆ isSpill() [3/3]

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

Definition at line 814 of file SIInstrInfo.h.

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

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

◆ 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 ( uint16_t Opcode) const
inline

Definition at line 901 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 844 of file SIInstrInfo.h.

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

Referenced by isCoexecutableVALUInst(), and isNeverCoissue().

◆ isTRANS() [2/2]

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

Definition at line 848 of file SIInstrInfo.h.

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

◆ isVALU() [1/2]

◆ isVALU() [2/2]

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

Definition at line 456 of file SIInstrInfo.h.

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

◆ isVGPRCopy()

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

Definition at line 1113 of file SIInstrInfo.h.

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

◆ isVGPRSpill() [1/2]

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

Definition at line 790 of file SIInstrInfo.h.

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

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

◆ isVGPRSpill() [2/2]

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

Definition at line 796 of file SIInstrInfo.h.

References isSpill(), and isVALU().

◆ isVIMAGE() [1/2]

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

Definition at line 624 of file SIInstrInfo.h.

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

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

◆ isVIMAGE() [2/2]

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

Definition at line 628 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 923 of file SIInstrInfo.h.

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

◆ isVINTERP() [2/2]

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

Definition at line 927 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 860 of file SIInstrInfo.h.

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

◆ isVINTRP() [2/2]

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

Definition at line 864 of file SIInstrInfo.h.

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

◆ isVMEM() [1/2]

◆ isVMEM() [2/2]

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

Definition at line 472 of file SIInstrInfo.h.

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

◆ isVOP1() [1/2]

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

Definition at line 524 of file SIInstrInfo.h.

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

Referenced by canRemat().

◆ isVOP1() [2/2]

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

Definition at line 528 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 532 of file SIInstrInfo.h.

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

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

◆ isVOP2() [2/2]

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

Definition at line 536 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 544 of file SIInstrInfo.h.

References isVOP3(), and MI.

Referenced by isVOP3().

◆ isVOP3() [2/3]

◆ isVOP3() [3/3]

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

Definition at line 546 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 852 of file SIInstrInfo.h.

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

◆ isVOP3P() [2/2]

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

Definition at line 856 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 556 of file SIInstrInfo.h.

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

Referenced by legalizeOperands(), and verifyInstruction().

◆ isVOPC() [2/2]

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

Definition at line 560 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 632 of file SIInstrInfo.h.

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

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

◆ isVSAMPLE() [2/2]

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

Definition at line 636 of file SIInstrInfo.h.

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

◆ isWaitcnt()

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

Definition at line 1090 of file SIInstrInfo.h.

References getNonSoftWaitcntOpcode().

◆ isWave32()

bool llvm::SIInstrInfo::isWave32 ( ) const

Definition at line 10282 of file SIInstrInfo.cpp.

◆ isWMMA() [1/2]

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

◆ isWMMA() [2/2]

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

Definition at line 889 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 769 of file SIInstrInfo.h.

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

◆ isWQM() [2/2]

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

Definition at line 773 of file SIInstrInfo.h.

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

◆ isWWMRegSpillOpcode()

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

Definition at line 824 of file SIInstrInfo.h.

Referenced by isBasicBlockPrologue().

◆ isXDL()

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

◆ isXDLWMMA()

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

Definition at line 10776 of file SIInstrInfo.cpp.

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

Referenced by isXDL().

◆ legalizeGenericOperand()

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

◆ legalizeOperands()

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

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

References legalizeOperandsVALUt16(), MI, MRI, and OpIdx.

Referenced by legalizeOperandsVALUt16(), and moveToVALUImpl().

◆ legalizeOperandsVALUt16() [2/2]

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

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

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

Referenced by legalizeOperandsVOP2(), and legalizeOperandsVOP3().

◆ loadRegFromStackSlot()

◆ mayAccessFlatAddressSpace()

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

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

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

◆ mayAccessScratchThroughFlat()

bool SIInstrInfo::mayAccessScratchThroughFlat ( const MachineInstr & MI) const
Returns
true for SCRATCH_ instructions, or FLAT_ instructions with SCRATCH_ memory operands. Conservatively correct; will return true if MI cannot be proven to not hit scratch.

Definition at line 4318 of file SIInstrInfo.cpp.

References llvm::any_of(), 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 4347 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 4453 of file SIInstrInfo.cpp.

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

◆ mayWriteLDSThroughDMA()

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

Definition at line 753 of file SIInstrInfo.h.

References isLDSDMA(), and MI.

◆ modifiesModeRegister()

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

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

Definition at line 4400 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 7621 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()

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

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

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

◆ regUsesConstantBus()

bool SIInstrInfo::regUsesConstantBus ( const MachineOperand & Reg,
const MachineRegisterInfo & MRI ) const

◆ reMaterialize()

◆ removeBranch()

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

Definition at line 3172 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 3443 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 3250 of file SIInstrInfo.cpp.

References Cond, and llvm::getImm().

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

References assert().

◆ sopkIsZext()

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

Definition at line 945 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 9901 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

◆ usesConstantBus() [1/2]

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

Definition at line 1246 of file SIInstrInfo.h.

References MI, MRI, 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 991 of file SIInstrInfo.h.

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

◆ usesFPDPRounding() [2/2]

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

Definition at line 995 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 939 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 935 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 4934 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(), isSDWA(), isSMRD(), isSOP2(), isSOPC(), isSOPK(), isSubRegOf(), llvm::isUInt(), llvm::MachineOperand::isUse(), isVALU(), isVGPRSpill(), llvm::Register::isVirtual(), isVOP2(), isVOP3(), isVOPC(), isVSAMPLE(), LLVM_DEBUG, MI, llvm::InlineAsm::MIOp_FirstOperand, MRI, 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_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: