21#define GET_INSTRINFO_CTOR_DTOR
22#include "SPIRVGenInstrInfo.inc"
29 switch (
MI.getOpcode()) {
30 case SPIRV::OpConstantTrue:
31 case SPIRV::OpConstantFalse:
32 case SPIRV::OpConstantI:
33 case SPIRV::OpConstantF:
34 case SPIRV::OpConstantComposite:
35 case SPIRV::OpConstantSampler:
36 case SPIRV::OpConstantNull:
37 case SPIRV::OpSpecConstantTrue:
38 case SPIRV::OpSpecConstantFalse:
39 case SPIRV::OpSpecConstant:
40 case SPIRV::OpSpecConstantComposite:
41 case SPIRV::OpSpecConstantOp:
43 case SPIRV::OpConstantFunctionPointerINTEL:
51 switch (
MI.getOpcode()) {
52 case SPIRV::OpSpecConstantTrue:
53 case SPIRV::OpSpecConstantFalse:
54 case SPIRV::OpSpecConstant:
55 case SPIRV::OpSpecConstantComposite:
56 case SPIRV::OpSpecConstantOp:
64 switch (
MI.getOpcode()) {
65 case SPIRV::OpAsmTargetINTEL:
66 case SPIRV::OpAsmINTEL:
74 auto &
MRI =
MI.getMF()->getRegInfo();
75 if (
MI.getNumDefs() >= 1 &&
MI.getOperand(0).isReg()) {
76 auto DefRegClass =
MRI.getRegClassOrNull(
MI.getOperand(0).getReg());
77 return DefRegClass && DefRegClass->getID() == SPIRV::TYPERegClass.getID();
79 return MI.getOpcode() == SPIRV::OpTypeForwardPointer;
84 switch (
MI.getOpcode()) {
85 case SPIRV::OpDecorate:
86 case SPIRV::OpDecorateId:
87 case SPIRV::OpDecorateString:
88 case SPIRV::OpMemberDecorate:
89 case SPIRV::OpMemberDecorateString:
97 switch (
MI.getOpcode()) {
98 case SPIRV::OpCapability:
99 case SPIRV::OpExtension:
100 case SPIRV::OpExtInstImport:
101 case SPIRV::OpMemoryModel:
102 case SPIRV::OpEntryPoint:
103 case SPIRV::OpExecutionMode:
104 case SPIRV::OpExecutionModeId:
105 case SPIRV::OpString:
106 case SPIRV::OpSourceExtension:
107 case SPIRV::OpSource:
108 case SPIRV::OpSourceContinued:
110 case SPIRV::OpMemberName:
111 case SPIRV::OpModuleProcessed:
119 switch (
MI.getOpcode()) {
138 switch (
MI.getOpcode()) {
145 case SPIRV::OpShiftLeftLogicalS:
146 case SPIRV::OpShiftLeftLogicalV:
147 case SPIRV::OpSNegate:
155 switch (
MI.getOpcode()) {
199 bool AllowModify)
const {
224 if (
I->getOpcode() == SPIRV::OpBranch) {
225 I->eraseFromParent();
260 bool RenamableDest,
bool RenamableSrc)
const {
265 assert(
I->isCopy() &&
"Copy instruction is expected");
266 auto DstOp =
I->getOperand(0);
267 auto SrcOp =
I->getOperand(1);
269 "Register operands are expected in COPY");
270 auto &
MRI =
I->getMF()->getRegInfo();
275 if (
MI.getOpcode() == SPIRV::GET_ID ||
MI.getOpcode() == SPIRV::GET_fID ||
276 MI.getOpcode() == SPIRV::GET_pID ||
MI.getOpcode() == SPIRV::GET_vfID ||
277 MI.getOpcode() == SPIRV::GET_vID ||
MI.getOpcode() == SPIRV::GET_vpID) {
278 auto &
MRI =
MI.getMF()->getRegInfo();
279 MRI.replaceRegWith(
MI.getOperand(0).getReg(),
MI.getOperand(1).getReg());
280 MI.eraseFromParent();
unsigned const MachineRegisterInfo * MRI
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
This file declares the MachineIRBuilder class.
const SmallVectorImpl< MachineOperand > MachineBasicBlock * TBB
const SmallVectorImpl< MachineOperand > & Cond
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallVector class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Wrapper class representing physical registers. Should be passed by value.
iterator getLastNonDebugInstr(bool SkipPseudoOp=true)
Returns an iterator to the last non-debug instruction in the basic block, or end().
const MachineInstrBuilder & addMBB(MachineBasicBlock *MBB, unsigned TargetFlags=0) const
Representation of each machine instruction.
bool isConstantInstr(const MachineInstr &MI) const
bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify=false) const override
bool isInlineAsmDefInstr(const MachineInstr &MI) const
bool isTypeDeclInstr(const MachineInstr &MI) const
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg, bool KillSrc, bool RenamableDest=false, bool RenamableSrc=false) const override
bool canUseFastMathFlags(const MachineInstr &MI) const
bool isDecorationInstr(const MachineInstr &MI) const
unsigned removeBranch(MachineBasicBlock &MBB, int *BytesRemoved=nullptr) const override
bool expandPostRAPseudo(MachineInstr &MI) const override
bool isHeaderInstr(const MachineInstr &MI) const
bool canUseNUW(const MachineInstr &MI) const
bool isSpecConstantInstr(const MachineInstr &MI) const
bool canUseNSW(const MachineInstr &MI) const
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef< MachineOperand > Cond, const DebugLoc &DL, int *BytesAdded=nullptr) const override
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is an optimization pass for GlobalISel generic memory operations.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)