14#ifndef LLVM_LIB_TARGET_AMDGPU_SIINSTRINFO_H
15#define LLVM_LIB_TARGET_AMDGPU_SIINSTRINFO_H
25#define GET_INSTRINFO_HEADER
26#include "AMDGPUGenInstrInfo.inc"
33class MachineDominatorTree;
34class MachineRegisterInfo;
36class SIMachineFunctionInfo;
37class TargetRegisterClass;
38class ScheduleHazardRecognizer;
73 const auto *iter = InstrList.begin();
78 const auto *iter = InstrList.begin();
79 InstrList.erase(iter);
82 bool empty()
const {
return InstrList.empty(); }
104 return MI.getDesc().TSFlags;
114 mutable std::unique_ptr<AMDGPUMIRFormatter> Formatter;
117 enum BranchPredicate {
130 static BranchPredicate getBranchPredicate(
unsigned Opcode);
146 bool NeedInversion)
const;
152 std::pair<bool, MachineBasicBlock *>
166 unsigned Opcode)
const;
169 unsigned Opcode)
const;
172 unsigned Opcode,
bool Swap =
false)
const;
207 getDestEquivalentVGPRClass(
const MachineInstr &Inst)
const;
209 bool checkInstOffsetsDoNotOverlap(
const MachineInstr &MIa,
226 std::optional<DestSourcePair>
231 AMDGPU::OpName Src1OpName)
const;
233 unsigned toIdx)
const;
236 unsigned OpIdx1)
const override;
284 int64_t &Offset1)
const override;
295 int64_t Offset1,
bool OffsetIsScalable1,
297 int64_t Offset2,
bool OffsetIsScalable2,
298 unsigned ClusterSize,
299 unsigned NumBytes)
const override;
302 int64_t Offset1,
unsigned NumLoads)
const override;
306 bool KillSrc,
bool RenamableDest =
false,
307 bool RenamableSrc =
false)
const override;
312 bool isKill,
int FrameIndex,
319 bool isKill,
int FrameIndex,
323 int64_t &ImmVal)
const override;
331 bool NeedsCFI)
const;
360 std::pair<MachineInstr*, MachineInstr*>
373 bool IsIndirectSrc)
const;
383 unsigned &SrcOpIdx1)
const override;
386 unsigned &SrcOpIdx1)
const;
389 int64_t BrOffset)
const override;
407 bool AllowModify)
const;
412 bool AllowModify =
false)
const override;
415 int *BytesRemoved =
nullptr)
const override;
420 int *BytesAdded =
nullptr)
const override;
428 int &TrueCycles,
int &FalseCycles)
const override;
436 Register &SrcReg2, int64_t &CmpMask,
437 int64_t &CmpValue)
const override;
440 Register SrcReg2, int64_t CmpMask, int64_t CmpValue,
462 unsigned SubRegIndex);
496 if (!AllowLDSDMA &&
isLDSDMA(Opcode))
741 case AMDGPU::SI_BLOCK_SPILL_V1024_SAVE:
742 case AMDGPU::SI_BLOCK_SPILL_V1024_CFI_SAVE:
743 case AMDGPU::SI_BLOCK_SPILL_V1024_RESTORE:
744 case AMDGPU::SCRATCH_STORE_BLOCK_SADDR:
745 case AMDGPU::SCRATCH_LOAD_BLOCK_SADDR:
746 case AMDGPU::SCRATCH_STORE_BLOCK_SVS:
747 case AMDGPU::SCRATCH_LOAD_BLOCK_SVS:
755 switch (
MI.getOpcode()) {
756 case AMDGPU::S_ABSDIFF_I32:
757 case AMDGPU::S_ABS_I32:
758 case AMDGPU::S_AND_B32:
759 case AMDGPU::S_AND_B64:
760 case AMDGPU::S_ANDN2_B32:
761 case AMDGPU::S_ANDN2_B64:
762 case AMDGPU::S_ASHR_I32:
763 case AMDGPU::S_ASHR_I64:
764 case AMDGPU::S_BCNT0_I32_B32:
765 case AMDGPU::S_BCNT0_I32_B64:
766 case AMDGPU::S_BCNT1_I32_B32:
767 case AMDGPU::S_BCNT1_I32_B64:
768 case AMDGPU::S_BFE_I32:
769 case AMDGPU::S_BFE_I64:
770 case AMDGPU::S_BFE_U32:
771 case AMDGPU::S_BFE_U64:
772 case AMDGPU::S_LSHL_B32:
773 case AMDGPU::S_LSHL_B64:
774 case AMDGPU::S_LSHR_B32:
775 case AMDGPU::S_LSHR_B64:
776 case AMDGPU::S_NAND_B32:
777 case AMDGPU::S_NAND_B64:
778 case AMDGPU::S_NOR_B32:
779 case AMDGPU::S_NOR_B64:
780 case AMDGPU::S_NOT_B32:
781 case AMDGPU::S_NOT_B64:
782 case AMDGPU::S_OR_B32:
783 case AMDGPU::S_OR_B64:
784 case AMDGPU::S_ORN2_B32:
785 case AMDGPU::S_ORN2_B64:
786 case AMDGPU::S_QUADMASK_B32:
787 case AMDGPU::S_QUADMASK_B64:
788 case AMDGPU::S_WQM_B32:
789 case AMDGPU::S_WQM_B64:
790 case AMDGPU::S_XNOR_B32:
791 case AMDGPU::S_XNOR_B64:
792 case AMDGPU::S_XOR_B32:
793 case AMDGPU::S_XOR_B64:
805 unsigned Target =
MI.getOperand(0).getImm();
837 unsigned Opc =
MI.getOpcode();
839 return isLDSDMA(
MI) &&
Opc != AMDGPU::BUFFER_STORE_LDS_DWORD &&
840 Opc != AMDGPU::TENSOR_STORE_FROM_LDS_d2 &&
841 Opc != AMDGPU::TENSOR_STORE_FROM_LDS_d4;
845 return Opcode == AMDGPU::S_BARRIER_LEAVE ||
846 Opcode == AMDGPU::S_BARRIER_SIGNAL_ISFIRST_IMM ||
847 Opcode == AMDGPU::S_BARRIER_SIGNAL_ISFIRST_M0;
851 unsigned Opc =
MI.getOpcode();
852 return (
Opc == AMDGPU::S_CBRANCH_VCCNZ ||
Opc == AMDGPU::S_CBRANCH_VCCZ) &&
853 !
MI.getOperand(1).isUndef();
874 return MI.getOpcode() != AMDGPU::SI_SPILL_S32_TO_VGPR &&
875 MI.getOpcode() != AMDGPU::SI_RESTORE_S32_FROM_VGPR &&
880 return Opcode != AMDGPU::SI_SPILL_S32_TO_VGPR &&
881 Opcode != AMDGPU::SI_RESTORE_S32_FROM_VGPR &&
886 return MI.getOpcode() == AMDGPU::SI_SPILL_S32_TO_VGPR ||
887 MI.getOpcode() == AMDGPU::SI_RESTORE_S32_FROM_VGPR ||
892 return Opcode == AMDGPU::SI_SPILL_S32_TO_VGPR ||
893 Opcode == AMDGPU::SI_RESTORE_S32_FROM_VGPR ||
908 return Opcode == AMDGPU::SI_SPILL_WWM_V32_SAVE ||
909 Opcode == AMDGPU::SI_SPILL_WWM_AV32_SAVE ||
910 Opcode == AMDGPU::SI_SPILL_WWM_V32_RESTORE ||
911 Opcode == AMDGPU::SI_SPILL_WWM_AV32_RESTORE;
915 return Opcode == AMDGPU::SI_CS_CHAIN_TC_W32 ||
916 Opcode == AMDGPU::SI_CS_CHAIN_TC_W64;
945 case AMDGPU::V_FMA_MIXHI_F16:
946 case AMDGPU::V_FMA_MIXLO_F16:
947 case AMDGPU::V_FMA_MIX_F32:
948 case AMDGPU::V_MAD_MIXHI_F16:
949 case AMDGPU::V_MAD_MIXLO_F16:
950 case AMDGPU::V_MAD_MIX_F32:
974 return isMAI(
MI) &&
MI.getOpcode() != AMDGPU::V_ACCVGPR_WRITE_B32_e64 &&
975 MI.getOpcode() != AMDGPU::V_ACCVGPR_READ_B32_e64;
979 return isMAI(Opcode) && Opcode != AMDGPU::V_ACCVGPR_WRITE_B32_e64 &&
980 Opcode != AMDGPU::V_ACCVGPR_READ_B32_e64;
1064 return Opcode == AMDGPU::S_CMPK_EQ_U32 || Opcode == AMDGPU::S_CMPK_LG_U32 ||
1065 Opcode == AMDGPU::S_CMPK_GT_U32 || Opcode == AMDGPU::S_CMPK_GE_U32 ||
1066 Opcode == AMDGPU::S_CMPK_LT_U32 || Opcode == AMDGPU::S_CMPK_LE_U32 ||
1067 Opcode == AMDGPU::S_GETREG_B32 ||
1068 Opcode == AMDGPU::S_GETREG_B32_const;
1133 return Opcode == AMDGPU::S_BARRIER ||
1134 Opcode == AMDGPU::S_BARRIER_SIGNAL_M0 ||
1135 Opcode == AMDGPU::S_BARRIER_SIGNAL_ISFIRST_M0 ||
1136 Opcode == AMDGPU::S_BARRIER_SIGNAL_IMM ||
1137 Opcode == AMDGPU::S_BARRIER_SIGNAL_ISFIRST_IMM;
1141 return isBarrierStart(Opcode) || Opcode == AMDGPU::S_BARRIER_WAIT ||
1142 Opcode == AMDGPU::S_BARRIER_INIT_M0 ||
1143 Opcode == AMDGPU::S_BARRIER_INIT_IMM ||
1144 Opcode == AMDGPU::S_BARRIER_JOIN_IMM ||
1145 Opcode == AMDGPU::S_BARRIER_LEAVE || Opcode == AMDGPU::DS_GWS_INIT ||
1146 Opcode == AMDGPU::DS_GWS_BARRIER;
1151 case AMDGPU::GLOBAL_LOAD_MONITOR_B32:
1152 case AMDGPU::GLOBAL_LOAD_MONITOR_B32_SADDR:
1153 case AMDGPU::GLOBAL_LOAD_MONITOR_B64:
1154 case AMDGPU::GLOBAL_LOAD_MONITOR_B64_SADDR:
1155 case AMDGPU::GLOBAL_LOAD_MONITOR_B128:
1156 case AMDGPU::GLOBAL_LOAD_MONITOR_B128_SADDR:
1157 case AMDGPU::FLAT_LOAD_MONITOR_B32:
1158 case AMDGPU::FLAT_LOAD_MONITOR_B64:
1159 case AMDGPU::FLAT_LOAD_MONITOR_B128:
1167 return Opc == AMDGPU::GLOBAL_INV ||
Opc == AMDGPU::GLOBAL_WB ||
1168 Opc == AMDGPU::GLOBAL_WBINV;
1172 return Opcode == AMDGPU::V_S_EXP_F16_e64 ||
1173 Opcode == AMDGPU::V_S_LOG_F16_e64 ||
1174 Opcode == AMDGPU::V_S_RCP_F16_e64 ||
1175 Opcode == AMDGPU::V_S_RSQ_F16_e64 ||
1176 Opcode == AMDGPU::V_S_SQRT_F16_e64;
1188 return Opcode == AMDGPU::SCHED_BARRIER ||
1189 Opcode == AMDGPU::SCHED_GROUP_BARRIER || Opcode == AMDGPU::IGLP_OPT;
1197 return Opcode == AMDGPU::SCHED_GROUP_BARRIER || Opcode == AMDGPU::IGLP_OPT;
1202 case AMDGPU::S_WAITCNT_soft:
1203 return AMDGPU::S_WAITCNT;
1204 case AMDGPU::S_WAITCNT_VSCNT_soft:
1205 return AMDGPU::S_WAITCNT_VSCNT;
1206 case AMDGPU::S_WAIT_LOADCNT_soft:
1207 return AMDGPU::S_WAIT_LOADCNT;
1208 case AMDGPU::S_WAIT_STORECNT_soft:
1209 return AMDGPU::S_WAIT_STORECNT;
1210 case AMDGPU::S_WAIT_SAMPLECNT_soft:
1211 return AMDGPU::S_WAIT_SAMPLECNT;
1212 case AMDGPU::S_WAIT_BVHCNT_soft:
1213 return AMDGPU::S_WAIT_BVHCNT;
1214 case AMDGPU::S_WAIT_DSCNT_soft:
1215 return AMDGPU::S_WAIT_DSCNT;
1216 case AMDGPU::S_WAIT_KMCNT_soft:
1217 return AMDGPU::S_WAIT_KMCNT;
1218 case AMDGPU::S_WAIT_XCNT_soft:
1219 return AMDGPU::S_WAIT_XCNT;
1227 case AMDGPU::S_WAITCNT:
1228 case AMDGPU::S_WAITCNT_VSCNT:
1229 case AMDGPU::S_WAITCNT_VMCNT:
1230 case AMDGPU::S_WAITCNT_EXPCNT:
1231 case AMDGPU::S_WAITCNT_LGKMCNT:
1232 case AMDGPU::S_WAIT_LOADCNT:
1233 case AMDGPU::S_WAIT_LOADCNT_DSCNT:
1234 case AMDGPU::S_WAIT_STORECNT:
1235 case AMDGPU::S_WAIT_STORECNT_DSCNT:
1236 case AMDGPU::S_WAIT_SAMPLECNT:
1237 case AMDGPU::S_WAIT_BVHCNT:
1238 case AMDGPU::S_WAIT_EXPCNT:
1239 case AMDGPU::S_WAIT_DSCNT:
1240 case AMDGPU::S_WAIT_KMCNT:
1241 case AMDGPU::S_WAIT_XCNT:
1242 case AMDGPU::S_WAIT_IDLE:
1254 return !RI.isSGPRReg(MRI, Dest);
1262 return MO.isReg() && RI.isVGPR(MRI, MO.getReg());});
1311 if (
OpIdx >=
MI.getDesc().NumOperands)
1325 int64_t ImmVal)
const {
1326 if (
OpIdx >=
MI.getDesc().NumOperands)
1329 if (isCopyInstr(
MI)) {
1357 int64_t ImmVal)
const;
1385 MI.getDesc().operands()[
OpIdx]);
1399 unsigned NewOpcode)
const;
1424 unsigned OpNo)
const;
1431 if (OpInfo.RegClass == -1) {
1437 return RI.getRegSizeInBits(*RI.getRegClass(getOpRegClassID(OpInfo))) / 8;
1446 return RI.getSubRegIdxSize(SubReg) / 8;
1560 unsigned Quantity)
const override;
1566 MachineBasicBlock &
MBB,
1578 AMDGPU::OpName OperandName)
const;
1582 AMDGPU::OpName OperandName)
const {
1588 AMDGPU::OpName OperandName)
const {
1589 int Idx = AMDGPU::getNamedOperandIdx(
MI.getOpcode(), OperandName);
1590 return MI.getOperand(Idx).getImm();
1611 int &FrameIndex)
const override {
1617 TypeSize &MemBytes)
const override;
1620 int &FrameIndex)
const override {
1626 TypeSize &MemBytes)
const override;
1635 std::pair<unsigned, unsigned>
1717 std::pair<int64_t, int64_t>
1743 unsigned *PredCost =
nullptr)
const override;
1782 return RC ==
TRI->getMatchingSuperRegClass(RC, &TRC,
P.SubReg);
1800 const MachineRegisterInfo &MRI);
1807 const MachineInstr &
DefMI,
1808 const MachineInstr &
UseMI);
1815 const MachineInstr &
DefMI);
MachineInstrBuilder & UseMI
MachineInstrBuilder MachineInstrBuilder & DefMI
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Provides AMDGPU specific target descriptions.
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
MachineBasicBlock MachineBasicBlock::iterator MBBI
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
Register const TargetRegisterInfo * TRI
Promote Memory to Register
MachineInstr unsigned OpIdx
uint64_t IntrinsicInst * II
const SmallVectorImpl< MachineOperand > MachineBasicBlock * TBB
const SmallVectorImpl< MachineOperand > & Cond
Interface definition for SIRegisterInfo.
This file implements a set that has insertion order iteration characteristics.
static unsigned getBranchOpcode(ISD::CondCode Cond)
Class for arbitrary precision integers.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Itinerary data supplied by a subtarget to be used by a target.
Describe properties that are true of each instruction in the target description file.
This holds information about one operand of a machine instruction, indicating the register class for ...
MachineInstrBundleIterator< MachineInstr > iterator
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Representation of each machine instruction.
Flags
Flags values. These may be or'd together.
MachineOperand class - Representation of each machine instruction operand.
unsigned getSubReg() const
LLVM_ABI unsigned getOperandNo() const
Returns the index of this operand in the instruction that it belongs to.
bool isReg() const
isReg - Tests if this is a MO_Register operand.
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
MachineInstr * getParent()
getParent - Return the instruction that this operand belongs to.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
const TargetRegisterClass * getRegClass(Register Reg) const
Return the register class of the specified virtual register.
const TargetRegisterInfo * getTargetRegisterInfo() const
Wrapper class representing virtual and physical registers.
Represents one node in the SelectionDAG.
bool usesFPDPRounding(uint32_t Opcode) const
static bool isCBranchVCCZRead(const MachineInstr &MI)
bool isLegalMUBUFImmOffset(unsigned Imm) const
bool isInlineConstant(const APInt &Imm) const
static bool isMAI(const MachineInstr &MI)
void legalizeOperandsVOP3(MachineRegisterInfo &MRI, MachineInstr &MI) const
Fix operands in MI to satisfy constant bus requirements.
bool canAddToBBProlog(const MachineInstr &MI) const
static bool isDS(const MachineInstr &MI)
static bool isVMEM(const MachineInstr &MI)
MachineBasicBlock * legalizeOperands(MachineInstr &MI, MachineDominatorTree *MDT=nullptr) const
Legalize all operands in this instruction.
bool areLoadsFromSameBasePtr(SDNode *Load0, SDNode *Load1, int64_t &Offset0, int64_t &Offset1) const override
bool isWQM(uint32_t Opcode) const
static bool isVOP3(const MachineInstr &MI)
bool isMTBUF(uint32_t Opcode) const
unsigned getLiveRangeSplitOpcode(Register Reg, const MachineFunction &MF) const override
bool getMemOperandsWithOffsetWidth(const MachineInstr &LdSt, SmallVectorImpl< const MachineOperand * > &BaseOps, int64_t &Offset, bool &OffsetIsScalable, LocationSize &Width, const TargetRegisterInfo *TRI) const final
unsigned getInstSizeInBytes(const MachineInstr &MI) const override
static bool isNeverUniform(const MachineInstr &MI)
bool isXDLWMMA(const MachineInstr &MI) const
bool isBasicBlockPrologue(const MachineInstr &MI, Register Reg=Register()) const override
bool isSpill(uint32_t Opcode) const
bool isMUBUF(uint32_t Opcode) const
uint64_t getDefaultRsrcDataFormat() const
static bool isSOPP(const MachineInstr &MI)
bool hasVGPRUses(const MachineInstr &MI) const
bool mayAccessScratch(const MachineInstr &MI) const
bool isIGLP(unsigned Opcode) const
static bool isFLATScratch(const MachineInstr &MI)
bool isLegalFLATOffset(int64_t Offset, unsigned AddrSpace, AMDGPU::FlatAddrSpace FlatVariant) const
Returns if Offset is legal for the subtarget as the offset to a FLAT encoded instruction with the giv...
const MCInstrDesc & getIndirectRegWriteMovRelPseudo(unsigned VecSize, unsigned EltSize, bool IsSGPR) const
static bool isSpill(const MachineInstr &MI)
MachineInstrBuilder getAddNoCarry(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, Register DestReg) const
Return a partially built integer add instruction without carry.
bool isVOP3PMix(uint16_t Opcode) const
bool mayAccessFlatAddressSpace(const MachineInstr &MI) const
bool shouldScheduleLoadsNear(SDNode *Load0, SDNode *Load1, int64_t Offset0, int64_t Offset1, unsigned NumLoads) const override
bool splitMUBUFOffset(uint32_t Imm, uint32_t &SOffset, uint32_t &ImmOffset, Align Alignment=Align(4)) const
ArrayRef< std::pair< unsigned, const char * > > getSerializableDirectMachineOperandTargetFlags() const override
void moveToVALU(SIInstrWorklist &Worklist, MachineDominatorTree *MDT) const
Replace the instructions opcode with the equivalent VALU opcode.
bool isDisableWQM(uint32_t Opcode) const
static bool isSMRD(const MachineInstr &MI)
void restoreExec(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, const DebugLoc &DL, Register Reg, SlotIndexes *Indexes=nullptr) const
void storeRegToStackSlotCFI(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, Register SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC) const
bool usesConstantBus(const MachineRegisterInfo &MRI, const MachineOperand &MO, const MCOperandInfo &OpInfo) const
Returns true if this operand uses the constant bus.
static unsigned getMaxMUBUFImmOffset(const GCNSubtarget &ST)
bool doesNotReadTiedSource(uint32_t Opcode) const
bool isSOPK(uint32_t Opcode) const
static unsigned getFoldableCopySrcIdx(const MachineInstr &MI)
unsigned getOpSize(uint32_t Opcode, unsigned OpNo) const
Return the size in bytes of the operand OpNo on the given.
bool isLDSDMA(uint32_t Opcode) const
static bool hasSameClamp(const MachineInstr &A, const MachineInstr &B)
void legalizeOperandsFLAT(MachineRegisterInfo &MRI, MachineInstr &MI) const
bool optimizeCompareInstr(MachineInstr &CmpInstr, Register SrcReg, Register SrcReg2, int64_t CmpMask, int64_t CmpValue, const MachineRegisterInfo *MRI) const override
bool usesConstantBus(const MachineRegisterInfo &MRI, const MachineInstr &MI, int OpIdx) const
bool isAtomicRet(uint32_t Opcode) const
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 reg...
Register isStoreToStackSlot(const MachineInstr &MI, int &FrameIndex) const override
bool isVINTRP(uint32_t Opcode) const
bool isSOP1(uint32_t Opcode) const
static bool isMTBUF(const MachineInstr &MI)
const MCInstrDesc & getIndirectGPRIDXPseudo(unsigned VecSize, bool IsIndirectSrc) const
static bool isDGEMM(unsigned Opcode)
static bool isEXP(const MachineInstr &MI)
static bool isSALU(const MachineInstr &MI)
static bool setsSCCIfResultIsNonZero(const MachineInstr &MI)
const MIRFormatter * getMIRFormatter() const override
bool isSGPRSpill(uint32_t Opcode) const
static bool isXcntDrain(const MachineInstr &MI)
True if MI implicitly drains XCNT.
void legalizeGenericOperand(MachineBasicBlock &InsertMBB, MachineBasicBlock::iterator I, const TargetRegisterClass *DstRC, MachineOperand &Op, MachineRegisterInfo &MRI, const DebugLoc &DL) const
MachineInstr * buildShrunkInst(MachineInstr &MI, unsigned NewOpcode) const
static bool isVOP2(const MachineInstr &MI)
bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify=false) const override
static bool isSDWA(const MachineInstr &MI)
const MCInstrDesc & getKillTerminatorFromPseudo(unsigned Opcode) const
static bool mayWriteLDSThroughDMA(const MachineInstr &MI)
void insertNoops(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned Quantity) const override
bool isDOT(uint32_t Opcode) const
static bool isVINTRP(const MachineInstr &MI)
bool isIGLPMutationOnly(unsigned Opcode) const
static bool isGather4(const MachineInstr &MI)
bool isDS(uint32_t Opcode) const
MachineInstr * getWholeWaveFunctionSetup(MachineFunction &MF) const
static bool isMFMAorWMMA(const MachineInstr &MI)
static bool isWQM(const MachineInstr &MI)
static bool doesNotReadTiedSource(const MachineInstr &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.
static bool isDOT(const MachineInstr &MI)
InstSizeVerifyMode getInstSizeVerifyMode(const MachineInstr &MI) const override
bool isGather4(uint32_t Opcode) const
static bool usesFPDPRounding(const MachineInstr &MI)
bool isVIMAGE(uint32_t Opcode) const
MachineInstr * createPHISourceCopy(MachineBasicBlock &MBB, MachineBasicBlock::iterator InsPt, const DebugLoc &DL, Register Src, unsigned SrcSubReg, Register Dst) const override
bool isImage(uint32_t Opcode) const
static bool usesTENSOR_CNT(const MachineInstr &MI)
bool isInlineConstant(const MachineOperand &MO) const
bool hasModifiers(unsigned Opcode) const
Return true if this instruction has any modifiers.
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
static bool isSWMMAC(const MachineInstr &MI)
ScheduleHazardRecognizer * CreateTargetMIHazardRecognizer(const InstrItineraryData *II, const ScheduleDAGMI *DAG) const override
bool isDPP(uint32_t Opcode) const
bool isHighLatencyDef(int Opc) const override
void legalizeOpWithMove(MachineInstr &MI, unsigned OpIdx) const
Legalize the OpIndex operand of this instruction by inserting a MOV.
bool reverseBranchCondition(SmallVectorImpl< MachineOperand > &Cond) const override
static bool isVOPC(const MachineInstr &MI)
void removeModOperands(MachineInstr &MI) const
bool hasFPClamp(uint32_t Opcode) const
bool isInlineConstant(const MachineInstr &MI, unsigned OpIdx, int64_t ImmVal) const
bool isGWS(uint32_t Opcode) const
unsigned getVectorRegSpillRestoreOpcode(Register Reg, const TargetRegisterClass *RC, unsigned Size, const SIMachineFunctionInfo &MFI) const
bool isXDL(const MachineInstr &MI) const
Register isStackAccess(const MachineInstr &MI, int &FrameIndex, TypeSize &MemBytes) const
static bool isVIMAGE(const MachineInstr &MI)
static bool isLDSDIR(const MachineInstr &MI)
void enforceOperandRCAlignment(MachineInstr &MI, AMDGPU::OpName OpName) const
static bool isSOP2(const MachineInstr &MI)
LLVM_READONLY const MachineOperand * getNamedOperand(const MachineInstr &MI, AMDGPU::OpName OperandName) const
static bool isGWS(const MachineInstr &MI)
bool hasRAWDependency(const MachineInstr &FirstMI, const MachineInstr &SecondMI) const
bool isLegalAV64PseudoImm(uint64_t Imm) const
Check if this immediate value can be used for AV_MOV_B64_IMM_PSEUDO.
bool isNeverCoissue(MachineInstr &MI) const
const TargetSchedModel & getSchedModel() const
static bool isBUF(const MachineInstr &MI)
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 isSOPC(uint32_t Opcode) const
bool isMAI(uint32_t Opcode) const
void handleCopyToPhysHelper(SIInstrWorklist &Worklist, Register DstReg, MachineInstr &Inst, MachineRegisterInfo &MRI, DenseMap< MachineInstr *, V2PhysSCopyInfo > &WaterFalls, DenseMap< MachineInstr *, bool > &V2SPhyCopiesToErase) const
bool hasModifiersSet(const MachineInstr &MI, AMDGPU::OpName OpName) const
bool isLegalToSwap(const MachineInstr &MI, unsigned fromIdx, unsigned toIdx) const
bool isFixedSize(uint32_t Opcode) const
static bool isFLATGlobal(const MachineInstr &MI)
unsigned getMachineCSELookAheadLimit() const override
MachineInstr * foldMemoryOperandImpl(MachineFunction &MF, MachineInstr &MI, ArrayRef< unsigned > Ops, int FrameIndex, MachineInstr *&CopyMI, LiveIntervals *LIS=nullptr, VirtRegMap *VRM=nullptr) const override
bool isGlobalMemoryObject(const MachineInstr *MI) const override
static bool isVSAMPLE(const MachineInstr &MI)
static bool isAtomicRet(const MachineInstr &MI)
bool isBufferSMRD(const MachineInstr &MI) const
static bool isKillTerminator(unsigned Opcode)
bool isVOPDAntidependencyAllowed(const MachineInstr &MI) const
If OpX is multicycle, anti-dependencies are not allowed.
bool findCommutedOpIndices(const MachineInstr &MI, unsigned &SrcOpIdx0, unsigned &SrcOpIdx1) const override
const GCNSubtarget & getSubtarget() const
void insertScratchExecCopy(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, const DebugLoc &DL, Register Reg, bool IsSCCLive, SlotIndexes *Indexes=nullptr) const
bool hasVALU32BitEncoding(unsigned Opcode) const
Return true if this 64-bit VALU instruction has a 32-bit encoding.
static bool isDisableWQM(const MachineInstr &MI)
bool isVOP3PMix(const MachineInstr &MI) const
unsigned getMovOpcode(const TargetRegisterClass *DstRC) const
Register isSGPRStackAccess(const MachineInstr &MI, int &FrameIndex, TypeSize &MemBytes) const
bool isMFMAorWMMA(uint32_t Opcode) const
unsigned buildExtractSubReg(MachineBasicBlock::iterator MI, MachineRegisterInfo &MRI, const MachineOperand &SuperReg, const TargetRegisterClass *SuperRC, unsigned SubIdx, const TargetRegisterClass *SubRC) const
void legalizeOperandsVOP2(MachineRegisterInfo &MRI, MachineInstr &MI) const
Legalize operands in MI by either commuting it or inserting a copy of src1.
bool isFLATGlobal(uint32_t Opcode) const
static bool isVALU(const MachineInstr &MI, bool AllowLDSDMA)
bool foldImmediate(MachineInstr &UseMI, MachineInstr &DefMI, Register Reg, MachineRegisterInfo *MRI) const final
static bool isTRANS(const MachineInstr &MI)
static bool isImage(const MachineInstr &MI)
static bool isSOPK(const MachineInstr &MI)
const TargetRegisterClass * getOpRegClass(const MachineInstr &MI, unsigned OpNo) const
Return the correct register class for OpNo.
MachineBasicBlock * insertSimulatedTrap(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,...
bool isMIMG(uint32_t Opcode) const
static unsigned getNonSoftWaitcntOpcode(unsigned Opcode)
bool isInlineConstant(const MachineInstr &MI, unsigned OpIdx) const
returns true if the operand OpIdx in MI is a valid inline immediate.
bool isVGPRSpill(uint32_t Opcode) const
static unsigned getDSShaderTypeValue(const MachineFunction &MF)
static bool isFoldableCopy(const MachineInstr &MI)
bool mayAccessLDSThroughFlat(const MachineInstr &MI) const
bool isAtomic(uint32_t Opcode) const
bool isIgnorableUse(const MachineOperand &MO) const override
static bool isVINTERP(const MachineInstr &MI)
static bool isMUBUF(const MachineInstr &MI)
bool expandPostRAPseudo(MachineInstr &MI) const override
bool analyzeCompare(const MachineInstr &MI, Register &SrcReg, Register &SrcReg2, int64_t &CmpMask, int64_t &CmpValue) const override
void createWaterFallForSiCall(MachineInstr *MI, MachineDominatorTree *MDT, ArrayRef< MachineOperand * > ScalarOps, ArrayRef< Register > PhySGPRs={}) const
Wrapper function for generating waterfall for instruction MI This function take into consideration of...
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
static bool hasFPClamp(const MachineInstr &MI)
bool isVOP2(uint32_t Opcode) const
static bool isGFX12CacheInvOrWBInst(unsigned Opc)
static bool isSegmentSpecificFLAT(const MachineInstr &MI)
static bool isWaitcnt(unsigned Opcode)
bool isReMaterializableImpl(const MachineInstr &MI) const override
bool isFLATScratch(uint32_t Opcode) const
static bool isVOP3(const MCInstrDesc &Desc)
unsigned getOpSize(const MachineInstr &MI, unsigned OpNo) const
This form should usually be preferred since it handles operands with unknown register classes.
bool isSegmentSpecificFLAT(uint32_t Opcode) const
Register isLoadFromStackSlot(const MachineInstr &MI, int &FrameIndex) const override
bool physRegUsesConstantBus(const MachineOperand &Reg) const
bool isInlineConstant(const MachineOperand &MO, const MCOperandInfo &OpInfo) const
static bool isF16PseudoScalarTrans(unsigned Opcode)
void insertSelect(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, Register DstReg, ArrayRef< MachineOperand > Cond, Register TrueReg, Register FalseReg) const override
bool mayAccessVMEMThroughFlat(const MachineInstr &MI) const
static bool isChainCallOpcode(uint64_t Opcode)
bool isVOPC(uint32_t Opcode) const
static bool isDPP(const MachineInstr &MI)
bool analyzeBranchImpl(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify) const
bool isPacked(uint32_t Opcode) const
static bool isMFMA(const MachineInstr &MI)
bool isLowLatencyInstruction(const MachineInstr &MI) const
bool isIGLP(const MachineInstr &MI) const
static bool isScalarStore(const MachineInstr &MI)
bool isFLAT(uint32_t Opcode) const
std::optional< DestSourcePair > isCopyInstrImpl(const MachineInstr &MI) const override
If the specific machine instruction is a instruction that moves/copies value from one register to ano...
bool isVALU(uint32_t Opcode, bool AllowLDSDMA) const
LDSDMA instructions act as both VALU and memory instructions, thus we also tag them as VALU.
void mutateAndCleanupImplicit(MachineInstr &MI, const MCInstrDesc &NewDesc) const
ValueUniformity getGenericValueUniformity(const MachineInstr &MI) const
static bool isMAI(const MCInstrDesc &Desc)
void reMaterialize(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, Register DestReg, unsigned SubIdx, const MachineInstr &Orig, LaneBitmask UsedLanes=LaneBitmask::getAll()) const override
static bool isFPAtomic(const MachineInstr &MI)
static bool usesLGKM_CNT(const MachineInstr &MI)
bool isFPAtomic(uint32_t Opcode) const
void legalizeOperandsVALUt16(MachineInstr &Inst, MachineRegisterInfo &MRI) const
Fix operands in Inst to fix 16bit SALU to VALU lowering.
bool isImmOperandLegal(const MCInstrDesc &InstDesc, unsigned OpNo, const MachineOperand &MO) const
static bool isPacked(const MachineInstr &MI)
bool canShrink(const MachineInstr &MI, const MachineRegisterInfo &MRI) const
const MachineOperand & getCalleeOperand(const MachineInstr &MI) const override
bool isAsmOnlyOpcode(int MCOp) const
Check if this instruction should only be used by assembler.
bool isAlwaysGDS(uint32_t Opcode) const
static bool isVGPRSpill(const MachineInstr &MI)
ScheduleHazardRecognizer * CreateTargetPostRAHazardRecognizer(const InstrItineraryData *II, const ScheduleDAG *DAG) const override
This is used by the post-RA scheduler (SchedulePostRAList.cpp).
bool verifyInstruction(const MachineInstr &MI, StringRef &ErrInfo) const override
static bool isSBarrierSCCWrite(unsigned Opcode)
unsigned getInstrLatency(const InstrItineraryData *ItinData, const MachineInstr &MI, unsigned *PredCost=nullptr) const override
bool isLegalGFX12PlusPackedMathFP32or64BitOperand(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 or 64 instructions.
unsigned getVectorRegSpillSaveOpcode(Register Reg, const TargetRegisterClass *RC, unsigned Size, const SIMachineFunctionInfo &MFI, bool NeedsCFI) const
int64_t getNamedImmOperand(const MachineInstr &MI, AMDGPU::OpName OperandName) const
Get required immediate operand.
bool isSOP2(uint32_t Opcode) const
ArrayRef< std::pair< int, const char * > > getSerializableTargetIndices() const override
bool isVGPRCopy(const MachineInstr &MI) const
bool isVOP1(uint32_t Opcode) const
bool isVINTERP(uint32_t Opcode) const
bool regUsesConstantBus(const MachineOperand &Reg, const MachineRegisterInfo &MRI) const
static bool isMIMG(const MachineInstr &MI)
MachineOperand buildExtractSubRegOrImm(MachineBasicBlock::iterator MI, MachineRegisterInfo &MRI, const MachineOperand &SuperReg, const TargetRegisterClass *SuperRC, unsigned SubIdx, const TargetRegisterClass *SubRC) const
bool isSchedulingBoundary(const MachineInstr &MI, const MachineBasicBlock *MBB, const MachineFunction &MF) const override
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 ind...
LLVM_READONLY int commuteOpcode(const MachineInstr &MI) const
static unsigned getNumWaitStates(const MachineInstr &MI)
Return the number of wait states that result from executing this instruction.
static bool isVOP3P(const MachineInstr &MI)
unsigned getVALUOp(const MachineInstr &MI) const
static bool modifiesModeRegister(const MachineInstr &MI)
Return true if the instruction modifies the mode register.q.
Register readlaneVGPRToSGPR(Register SrcReg, MachineInstr &UseMI, MachineRegisterInfo &MRI, const TargetRegisterClass *DstRC=nullptr) const
Copy a value from a VGPR (SrcReg) to SGPR.
bool hasDivergentBranch(const MachineBasicBlock *MBB) const
Return whether the block terminate with divergent branch.
bool isInlineConstant(const MachineOperand &MO, uint8_t OperandType) const
std::pair< int64_t, int64_t > splitFlatOffset(int64_t COffsetVal, unsigned AddrSpace, AMDGPU::FlatAddrSpace FlatVariant) const
Split COffsetVal into {immediate offset field, remainder offset} values.
unsigned removeBranch(MachineBasicBlock &MBB, int *BytesRemoved=nullptr) const override
bool isVOP3P(uint32_t Opcode) const
void fixImplicitOperands(MachineInstr &MI) const
bool moveFlatAddrToVGPR(MachineInstr &Inst) const
Change SADDR form of a FLAT Inst to its VADDR form if saddr operand was moved to VGPR.
bool isSWMMAC(uint32_t Opcode) const
static bool usesASYNC_CNT(const MachineInstr &MI)
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const DebugLoc &DL, Register DestReg, Register SrcReg, bool KillSrc, bool RenamableDest=false, bool RenamableSrc=false) const override
void createReadFirstLaneFromCopyToPhysReg(MachineRegisterInfo &MRI, Register DstReg, MachineInstr &Inst) const
bool swapSourceModifiers(MachineInstr &MI, MachineOperand &Src0, AMDGPU::OpName Src0OpName, MachineOperand &Src1, AMDGPU::OpName Src1OpName) const
MachineBasicBlock * getBranchDestBlock(const MachineInstr &MI) const override
static bool isDualSourceBlendEXP(const MachineInstr &MI)
bool hasUnwantedEffectsWhenEXECEmpty(const MachineInstr &MI) const
This function is used to determine if an instruction can be safely executed under EXEC = 0 without ha...
bool getConstValDefinedInReg(const MachineInstr &MI, const Register Reg, int64_t &ImmVal) const override
static bool isAtomic(const MachineInstr &MI)
bool canInsertSelect(const MachineBasicBlock &MBB, ArrayRef< MachineOperand > Cond, Register DstReg, Register TrueReg, Register FalseReg, int &CondCycles, int &TrueCycles, int &FalseCycles) const override
bool isLiteralOperandLegal(const MCInstrDesc &InstDesc, const MCOperandInfo &OpInfo) const
static bool isWWMRegSpillOpcode(uint32_t Opcode)
static bool sopkIsZext(unsigned Opcode)
static bool isSGPRSpill(const MachineInstr &MI)
static bool isWMMA(const MachineInstr &MI)
bool isMFMA(uint32_t Opcode) const
ArrayRef< std::pair< MachineMemOperand::Flags, const char * > > getSerializableMachineMemOperandTargetFlags() const override
MachineInstr * convertToThreeAddress(MachineInstr &MI, LiveVariables *LV, LiveIntervals *LIS) const override
bool mayReadEXEC(const MachineRegisterInfo &MRI, const MachineInstr &MI) const
Returns true if the instruction could potentially depend on the value of exec.
bool isSALU(uint32_t Opcode) const
bool isSMRD(uint32_t Opcode) const
bool isWMMA(uint32_t Opcode) const
void legalizeOperandsSMRD(MachineRegisterInfo &MRI, MachineInstr &MI) const
bool isVSAMPLE(uint32_t Opcode) const
bool isBranchOffsetInRange(unsigned BranchOpc, int64_t BrOffset) const override
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef< MachineOperand > Cond, const DebugLoc &DL, int *BytesAdded=nullptr) const override
void insertNoop(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const override
std::pair< MachineInstr *, MachineInstr * > expandMovDPP64(MachineInstr &MI) const
static bool isLoadMonitor(unsigned Opc)
static bool isSOP1(const MachineInstr &MI)
static bool isSOPC(const MachineInstr &MI)
bool isSOPP(uint32_t Opcode) const
static bool isFLAT(const MachineInstr &MI)
const SIRegisterInfo & getRegisterInfo() const
bool isLDSDIR(uint32_t Opcode) const
bool isBarrier(unsigned Opcode) const
bool isAtomicNoRet(uint32_t Opcode) const
MachineInstr * commuteInstructionImpl(MachineInstr &MI, bool NewMI, unsigned OpIdx0, unsigned OpIdx1) const override
bool isVOP3(uint32_t Opcode) const
static bool hasIntClamp(const MachineInstr &MI)
static bool isSpill(const MCInstrDesc &Desc)
int pseudoToMCOpcode(int Opcode) const
Return a target-specific opcode if Opcode is a pseudo instruction.
const MCInstrDesc & getMCOpcodeFromPseudo(unsigned Opcode) const
Return the descriptor of the target-specific machine instruction that corresponds to the specified ps...
bool isImmOperandLegal(const MachineInstr &MI, unsigned OpNo, const MachineOperand &MO) const
bool isEXP(uint32_t Opcode) const
bool isInlineConstant(const MachineInstr &MI, unsigned OpIdx, const MachineOperand &MO) const
static bool isScalarUnit(const MachineInstr &MI)
static bool usesVM_CNT(const MachineInstr &MI)
MachineInstr * createPHIDestinationCopy(MachineBasicBlock &MBB, MachineBasicBlock::iterator InsPt, const DebugLoc &DL, Register Src, Register Dst) const override
static bool isFixedSize(const MachineInstr &MI)
bool isSafeToSink(MachineInstr &MI, MachineBasicBlock *SuccToSinkTo, MachineCycleInfo *CI) const override
bool usesTENSOR_CNT(uint32_t Opcode) const
LLVM_READONLY int commuteOpcode(unsigned Opc) const
bool isScalarStore(uint32_t Opcode) const
static bool isBlockLoadStore(uint32_t Opcode)
ValueUniformity getValueUniformity(const MachineInstr &MI) const final
uint64_t getScratchRsrcWords23() const
bool usesASYNC_CNT(uint32_t Opcode) const
LLVM_READONLY MachineOperand * getNamedOperand(MachineInstr &MI, AMDGPU::OpName OperandName) const
Returns the operand named Op.
std::pair< unsigned, unsigned > decomposeMachineOperandsTargetFlags(unsigned TF) const override
bool isVMEM(uint32_t Opcode) const
bool areMemAccessesTriviallyDisjoint(const MachineInstr &MIa, const MachineInstr &MIb) const override
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.
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
bool allowNegativeFlatOffset(AMDGPU::FlatAddrSpace FlatVariant) const
Returns true if negative offsets are allowed for the given FlatVariant.
bool isBarrierStart(unsigned Opcode) const
std::optional< int64_t > getImmOrMaterializedImm(MachineOperand &Op) const
void moveToVALUImpl(SIInstrWorklist &Worklist, MachineDominatorTree *MDT, MachineInstr &Inst, DenseMap< MachineInstr *, V2PhysSCopyInfo > &WaterFalls, DenseMap< MachineInstr *, bool > &V2SPhyCopiesToErase) const
static bool isLDSDMA(const MachineInstr &MI)
static bool isAtomicNoRet(const MachineInstr &MI)
static bool isVOP1(const MachineInstr &MI)
SIInstrInfo(const GCNSubtarget &ST)
void insertIndirectBranch(MachineBasicBlock &MBB, MachineBasicBlock &NewDestBB, MachineBasicBlock &RestoreBB, const DebugLoc &DL, int64_t BrOffset, RegScavenger *RS) const override
bool isTRANS(uint32_t Opcode) const
bool isSDWA(uint32_t Opcode) const
bool hasAnyModifiersSet(const MachineInstr &MI) const
This class keeps track of the SPI_SP_INPUT_ADDR config register, which tells the hardware which inter...
ScheduleDAGMI is an implementation of ScheduleDAGInstrs that simply schedules machine instructions ac...
HazardRecognizer - This determines whether or not an instruction can be issued this cycle,...
A vector that has set insertion semantics.
A SetVector that performs no allocations if smaller than a certain size.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
Provide an instruction scheduling machine model to CodeGen passes.
Target - Wrapper for Target specific information.
static constexpr TypeSize getZero()
const uint64_t RSRC_DATA_FORMAT
LLVM_READONLY int32_t getSOPKOp(uint32_t Opcode)
LLVM_READONLY int32_t getCommuteRev(uint32_t Opcode)
LLVM_READONLY int32_t getCommuteOrig(uint32_t Opcode)
LLVM_READONLY int32_t getDPPOp32(uint32_t Opcode)
LLVM_READONLY int32_t getGlobalVaddrOp(uint32_t Opcode)
LLVM_READONLY int32_t getMFMAEarlyClobberOp(uint32_t Opcode)
const uint64_t RSRC_ELEMENT_SIZE_SHIFT
LLVM_READONLY int32_t getIfAddr64Inst(uint32_t Opcode)
Check if Opcode is an Addr64 opcode.
LLVM_READONLY int32_t getVCMPXNoSDstOp(uint32_t Opcode)
const uint64_t RSRC_TID_ENABLE
LLVM_READONLY int32_t getMFMASrcCVDstAGPROp(uint32_t Opcode)
LLVM_READONLY int32_t getVOPe32(uint32_t Opcode)
LLVM_READONLY int32_t getSDWAOp(uint32_t Opcode)
LLVM_READONLY int32_t getVCMPXOpFromVCMP(uint32_t Opcode)
LLVM_READONLY int32_t getGlobalSaddrOp(uint32_t Opcode)
LLVM_READONLY int32_t getAddr64Inst(uint32_t Opcode)
LLVM_READONLY int32_t getVOPe64(uint32_t Opcode)
LLVM_READONLY int32_t getDPPOp64(uint32_t Opcode)
@ OPERAND_REG_IMM_INT32
Operands with register, 32-bit, or 64-bit immediate.
LLVM_READONLY int32_t getBasicFromSDWAOp(uint32_t Opcode)
LLVM_READONLY int32_t getFlatScratchInstSSfromSV(uint32_t Opcode)
const uint64_t RSRC_INDEX_STRIDE_SHIFT
bool getMAIIsDGEMM(unsigned Opc)
Returns true if MAI operation is a double precision GEMM.
LLVM_READONLY int32_t getFlatScratchInstSVfromSVS(uint32_t Opcode)
LLVM_READONLY int32_t getFlatScratchInstSVfromSS(uint32_t Opcode)
LLVM_READONLY int32_t getFlatScratchInstSTfromSS(uint32_t Opcode)
constexpr bool isAtomicRet(const T &...O)
constexpr bool isVOPC(const T &...O)
constexpr bool isVOP3(const T &...O)
constexpr bool isScalarStore(const T &...O)
constexpr bool isVOP1(const T &...O)
constexpr bool isFPAtomic(const T &...O)
constexpr bool usesVM_CNT(const T &...O)
constexpr bool usesTENSOR_CNT(const T &...O)
constexpr bool isMAI(const T &...O)
constexpr bool isVOP2(const T &...O)
constexpr bool isSWMMAC(const T &...O)
constexpr bool isTRANS(const T &...O)
constexpr bool isSOP2(const T &...O)
constexpr bool isFLAT(const T &...O)
constexpr bool isVOP3P(const T &...O)
constexpr bool usesFPDPRounding(const T &...O)
constexpr bool isDisableWQM(const T &...O)
constexpr bool hasIntClamp(const T &...O)
constexpr bool isAtomicNoRet(const T &...O)
constexpr bool isMTBUF(const T &...O)
constexpr bool isVIMAGE(const T &...O)
constexpr bool isSMRD(const T &...O)
constexpr bool isFlatScratch(const T &...O)
constexpr bool isSpill(const T &...O)
constexpr bool isMIMG(const T &...O)
constexpr bool isVMEM(const T &...O)
constexpr bool hasFPClamp(const T &...O)
constexpr bool isNeverUniform(const T &...O)
constexpr bool isImage(const T &...O)
constexpr bool isWMMA(const T &...O)
constexpr bool isVALU(const T &...O)
constexpr bool isWQM(const T &...O)
constexpr bool hasClampLo(const T &...O)
constexpr bool isGWS(const T &...O)
constexpr bool isFlatGlobal(const T &...O)
constexpr bool usesASYNC_CNT(const T &...O)
constexpr bool isMUBUF(const T &...O)
constexpr bool isSDWA(const T &...O)
constexpr bool isTiedSourceNotRead(const T &...O)
constexpr bool isEXP(const T &...O)
constexpr bool usesLGKM_CNT(const T &...O)
constexpr bool isSOPK(const T &...O)
constexpr bool isSOPC(const T &...O)
constexpr bool isSOPP(const T &...O)
constexpr bool isDOT(const T &...O)
constexpr bool isVINTRP(const T &...O)
constexpr bool isVINTERP(const T &...O)
constexpr bool isVSAMPLE(const T &...O)
constexpr bool isDS(const T &...O)
constexpr bool isAtomic(const T &...O)
constexpr bool isLDSDIR(const T &...O)
constexpr bool isSALU(const T &...O)
constexpr bool isGather4(const T &...O)
constexpr bool isPacked(const T &...O)
constexpr bool hasClampHi(const T &...O)
constexpr bool isDPP(const T &...O)
constexpr bool isSOP1(const T &...O)
constexpr bool isSegmentSpecificFLAT(const T &...O)
constexpr bool isFixedSize(const T &...O)
This is an optimization pass for GlobalISel generic memory operations.
TargetInstrInfo::RegSubRegPair getRegSubRegPair(const MachineOperand &O)
Create RegSubRegPair from a register MachineOperand.
bool execMayBeModifiedBeforeUse(const MachineRegisterInfo &MRI, Register VReg, const MachineInstr &DefMI, const MachineInstr &UseMI)
Return false if EXEC is not changed between the def of VReg at DefMI and the use at UseMI.
uint64_t getTSFlags(const MachineInstr &MI)
TargetInstrInfo::RegSubRegPair getRegSequenceSubReg(MachineInstr &MI, unsigned SubReg)
Return the SubReg component from REG_SEQUENCE.
static const MachineMemOperand::Flags MONoClobber
Mark the MMO of a uniform load if there are no potentially clobbering stores on any path from the sta...
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
MachineInstr * getVRegSubRegDef(const TargetInstrInfo::RegSubRegPair &P, const MachineRegisterInfo &MRI)
Return the defining instruction for a given reg:subreg pair skipping copy like instructions and subre...
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
static const MachineMemOperand::Flags MOCooperative
Mark the MMO of cooperative load/store atomics.
DWARFExpression::Operation Op
constexpr unsigned DefaultMemoryClusterDWordsLimit
static const MachineMemOperand::Flags MOLastUse
Mark the MMO of a load as the last use.
bool isOfRegClass(const TargetInstrInfo::RegSubRegPair &P, const TargetRegisterClass &TRC, MachineRegisterInfo &MRI)
Returns true if a reg:subreg pair P has a TRC class.
ValueUniformity
Enum describing how values behave with respect to uniformity and divergence, to answer the question: ...
static const MachineMemOperand::Flags MOThreadPrivate
Mark the MMO of accesses to memory locations that are never written to by other threads.
bool execMayBeModifiedBeforeAnyUse(const MachineRegisterInfo &MRI, Register VReg, const MachineInstr &DefMI)
Return false if EXEC is not changed between the def of VReg at DefMI and all its uses.
Helper struct for the implementation of 3-address conversion to communicate updates made to instructi...
This struct is a compact representation of a valid (non-zero power of two) alignment.
static constexpr LaneBitmask getAll()
Utility to store machine instructions worklist.
MachineInstr * top() const
SIInstrWorklist()=default
bool isDeferred(MachineInstr *MI)
SetVector< MachineInstr * > & getDeferredList()
void insert(MachineInstr *MI)
A pair composed of a register and a sub-register index.
SmallVector< MachineOperand * > MOs
SmallVector< Register > SGPRs