20#define GET_INSTRINFO_CTOR_DTOR
21#include "SPIRVGenInstrInfo.inc"
28 switch (
MI.getOpcode()) {
29 case SPIRV::OpConstantTrue:
30 case SPIRV::OpConstantFalse:
31 case SPIRV::OpConstantI:
32 case SPIRV::OpConstantF:
33 case SPIRV::OpConstantComposite:
34 case SPIRV::OpConstantCompositeContinuedINTEL:
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::OpSpecConstantCompositeContinuedINTEL:
42 case SPIRV::OpSpecConstantOp:
44 case SPIRV::OpConstantFunctionPointerINTEL:
52 switch (
MI.getOpcode()) {
53 case SPIRV::OpSpecConstantTrue:
54 case SPIRV::OpSpecConstantFalse:
55 case SPIRV::OpSpecConstant:
56 case SPIRV::OpSpecConstantComposite:
57 case SPIRV::OpSpecConstantCompositeContinuedINTEL:
58 case SPIRV::OpSpecConstantOp:
66 switch (
MI.getOpcode()) {
67 case SPIRV::OpAsmTargetINTEL:
68 case SPIRV::OpAsmINTEL:
76 auto &
MRI =
MI.getMF()->getRegInfo();
77 if (
MI.getNumDefs() >= 1 &&
MI.getOperand(0).isReg()) {
78 auto DefRegClass =
MRI.getRegClassOrNull(
MI.getOperand(0).getReg());
79 return DefRegClass && DefRegClass->getID() == SPIRV::TYPERegClass.getID();
81 return MI.getOpcode() == SPIRV::OpTypeForwardPointer ||
82 MI.getOpcode() == SPIRV::OpTypeStructContinuedINTEL;
87 switch (
MI.getOpcode()) {
88 case SPIRV::OpDecorate:
89 case SPIRV::OpDecorateId:
90 case SPIRV::OpDecorateString:
91 case SPIRV::OpMemberDecorate:
92 case SPIRV::OpMemberDecorateString:
100 switch (
MI.getOpcode()) {
101 case SPIRV::OpAliasDomainDeclINTEL:
102 case SPIRV::OpAliasScopeDeclINTEL:
103 case SPIRV::OpAliasScopeListDeclINTEL:
111 switch (
MI.getOpcode()) {
112 case SPIRV::OpCapability:
113 case SPIRV::OpExtension:
114 case SPIRV::OpExtInstImport:
115 case SPIRV::OpMemoryModel:
116 case SPIRV::OpEntryPoint:
117 case SPIRV::OpExecutionMode:
118 case SPIRV::OpExecutionModeId:
119 case SPIRV::OpString:
120 case SPIRV::OpSourceExtension:
121 case SPIRV::OpSource:
122 case SPIRV::OpSourceContinued:
124 case SPIRV::OpMemberName:
125 case SPIRV::OpModuleProcessed:
134 switch (
MI.getOpcode()) {
153 switch (
MI.getOpcode()) {
160 case SPIRV::OpShiftLeftLogicalS:
161 case SPIRV::OpShiftLeftLogicalV:
162 case SPIRV::OpSNegate:
170 switch (
MI.getOpcode()) {
214 bool AllowModify)
const {
239 if (
I->getOpcode() == SPIRV::OpBranch) {
240 I->eraseFromParent();
275 bool RenamableDest,
bool RenamableSrc)
const {
280 assert(
I->isCopy() &&
"Copy instruction is expected");
281 auto DstOp =
I->getOperand(0);
282 auto SrcOp =
I->getOperand(1);
284 "Register operands are expected in COPY");
285 auto &
MRI =
I->getMF()->getRegInfo();
unsigned const MachineRegisterInfo * MRI
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
This file declares the MachineIRBuilder class.
const SmallVectorImpl< MachineOperand > MachineBasicBlock * TBB
const SmallVectorImpl< MachineOperand > & Cond
This file defines the SmallVector class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
LLVM_ABI 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.
Wrapper class representing virtual and physical registers.
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
bool canUseFastMathFlags(const MachineInstr &MI) const
bool isDecorationInstr(const MachineInstr &MI) const
unsigned removeBranch(MachineBasicBlock &MBB, int *BytesRemoved=nullptr) const override
bool isAliasingInstr(const MachineInstr &MI) const
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, Register DestReg, Register SrcReg, bool KillSrc, bool RenamableDest=false, bool RenamableSrc=false) 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)