Lines Matching refs:ResVReg
74 bool spvSelect(Register ResVReg, const SPIRVType *ResType,
77 bool selectGlobalValue(Register ResVReg, MachineInstr &I,
80 bool selectUnOpWithSrc(Register ResVReg, const SPIRVType *ResType,
83 bool selectUnOp(Register ResVReg, const SPIRVType *ResType, MachineInstr &I,
86 bool selectLoad(Register ResVReg, const SPIRVType *ResType,
90 bool selectMemOperation(Register ResVReg, MachineInstr &I) const;
92 bool selectAtomicRMW(Register ResVReg, const SPIRVType *ResType,
95 bool selectAtomicCmpXchg(Register ResVReg, const SPIRVType *ResType,
100 bool selectAddrSpaceCast(Register ResVReg, const SPIRVType *ResType,
103 bool selectBitreverse(Register ResVReg, const SPIRVType *ResType,
106 bool selectConstVector(Register ResVReg, const SPIRVType *ResType,
109 bool selectCmp(Register ResVReg, const SPIRVType *ResType,
112 bool selectICmp(Register ResVReg, const SPIRVType *ResType,
114 bool selectFCmp(Register ResVReg, const SPIRVType *ResType,
122 bool selectConst(Register ResVReg, const SPIRVType *ResType, const APInt &Imm,
125 bool selectSelect(Register ResVReg, const SPIRVType *ResType, MachineInstr &I,
127 bool selectIToF(Register ResVReg, const SPIRVType *ResType, MachineInstr &I,
129 bool selectExt(Register ResVReg, const SPIRVType *ResType, MachineInstr &I,
132 bool selectTrunc(Register ResVReg, const SPIRVType *ResType,
135 bool selectIntToBool(Register IntReg, Register ResVReg,
139 bool selectOpUndef(Register ResVReg, const SPIRVType *ResType,
141 bool selectIntrinsic(Register ResVReg, const SPIRVType *ResType,
143 bool selectExtractVal(Register ResVReg, const SPIRVType *ResType,
145 bool selectInsertVal(Register ResVReg, const SPIRVType *ResType,
147 bool selectExtractElt(Register ResVReg, const SPIRVType *ResType,
149 bool selectInsertElt(Register ResVReg, const SPIRVType *ResType,
151 bool selectGEP(Register ResVReg, const SPIRVType *ResType,
154 bool selectFrameIndex(Register ResVReg, const SPIRVType *ResType,
160 bool selectPhi(Register ResVReg, const SPIRVType *ResType,
237 Register ResVReg = HasDefs ? I.getOperand(0).getReg() : Register(0); in select() local
238 SPIRVType *ResType = HasDefs ? GR.getSPIRVTypeForVReg(ResVReg) : nullptr; in select()
240 if (spvSelect(ResVReg, ResType, I)) { in select()
242 MRI->setType(ResVReg, LLT::scalar(32)); in select()
249 bool SPIRVInstructionSelector::spvSelect(Register ResVReg, in spvSelect() argument
257 return selectConst(ResVReg, ResType, I.getOperand(1).getCImm()->getValue(), in spvSelect()
260 return selectGlobalValue(ResVReg, I); in spvSelect()
262 return selectOpUndef(ResVReg, ResType, I); in spvSelect()
265 return selectIntrinsic(ResVReg, ResType, I); in spvSelect()
267 return selectBitreverse(ResVReg, ResType, I); in spvSelect()
270 return selectConstVector(ResVReg, ResType, I); in spvSelect()
275 .addDef(ResVReg) in spvSelect()
285 return selectMemOperation(ResVReg, I); in spvSelect()
288 return selectICmp(ResVReg, ResType, I); in spvSelect()
290 return selectFCmp(ResVReg, ResType, I); in spvSelect()
293 return selectFrameIndex(ResVReg, ResType, I); in spvSelect()
296 return selectLoad(ResVReg, ResType, I); in spvSelect()
306 return selectPhi(ResVReg, ResType, I); in spvSelect()
309 return selectUnOp(ResVReg, ResType, I, SPIRV::OpConvertFToS); in spvSelect()
311 return selectUnOp(ResVReg, ResType, I, SPIRV::OpConvertFToU); in spvSelect()
314 return selectIToF(ResVReg, ResType, I, true, SPIRV::OpConvertSToF); in spvSelect()
316 return selectIToF(ResVReg, ResType, I, false, SPIRV::OpConvertUToF); in spvSelect()
319 return selectUnOp(ResVReg, ResType, I, SPIRV::OpBitCount); in spvSelect()
322 return selectExt(ResVReg, ResType, I, true); in spvSelect()
325 return selectExt(ResVReg, ResType, I, false); in spvSelect()
327 return selectTrunc(ResVReg, ResType, I); in spvSelect()
330 return selectUnOp(ResVReg, ResType, I, SPIRV::OpFConvert); in spvSelect()
333 return selectUnOp(ResVReg, ResType, I, SPIRV::OpConvertPtrToU); in spvSelect()
335 return selectUnOp(ResVReg, ResType, I, SPIRV::OpConvertUToPtr); in spvSelect()
337 return selectUnOp(ResVReg, ResType, I, SPIRV::OpBitcast); in spvSelect()
339 return selectAddrSpaceCast(ResVReg, ResType, I); in spvSelect()
355 .addDef(ResVReg) in spvSelect()
366 return selectAtomicRMW(ResVReg, ResType, I, SPIRV::OpAtomicOr); in spvSelect()
368 return selectAtomicRMW(ResVReg, ResType, I, SPIRV::OpAtomicIAdd); in spvSelect()
370 return selectAtomicRMW(ResVReg, ResType, I, SPIRV::OpAtomicAnd); in spvSelect()
372 return selectAtomicRMW(ResVReg, ResType, I, SPIRV::OpAtomicSMax); in spvSelect()
374 return selectAtomicRMW(ResVReg, ResType, I, SPIRV::OpAtomicSMin); in spvSelect()
376 return selectAtomicRMW(ResVReg, ResType, I, SPIRV::OpAtomicISub); in spvSelect()
378 return selectAtomicRMW(ResVReg, ResType, I, SPIRV::OpAtomicXor); in spvSelect()
380 return selectAtomicRMW(ResVReg, ResType, I, SPIRV::OpAtomicUMax); in spvSelect()
382 return selectAtomicRMW(ResVReg, ResType, I, SPIRV::OpAtomicUMin); in spvSelect()
384 return selectAtomicRMW(ResVReg, ResType, I, SPIRV::OpAtomicExchange); in spvSelect()
386 return selectAtomicCmpXchg(ResVReg, ResType, I); in spvSelect()
396 bool SPIRVInstructionSelector::selectUnOpWithSrc(Register ResVReg, in selectUnOpWithSrc() argument
402 .addDef(ResVReg) in selectUnOpWithSrc()
408 bool SPIRVInstructionSelector::selectUnOp(Register ResVReg, in selectUnOp() argument
412 return selectUnOpWithSrc(ResVReg, ResType, I, I.getOperand(1).getReg(), in selectUnOp()
455 bool SPIRVInstructionSelector::selectLoad(Register ResVReg, in selectLoad() argument
462 .addDef(ResVReg) in selectLoad()
492 bool SPIRVInstructionSelector::selectMemOperation(Register ResVReg, in selectMemOperation() argument
502 if (ResVReg.isValid() && ResVReg != MIB->getOperand(0).getReg()) in selectMemOperation()
503 BuildMI(BB, I, I.getDebugLoc(), TII.get(TargetOpcode::COPY), ResVReg) in selectMemOperation()
508 bool SPIRVInstructionSelector::selectAtomicRMW(Register ResVReg, in selectAtomicRMW() argument
526 .addDef(ResVReg) in selectAtomicRMW()
549 bool SPIRVInstructionSelector::selectAtomicCmpXchg(Register ResVReg, in selectAtomicCmpXchg() argument
610 .addDef(ResVReg) in selectAtomicCmpXchg()
635 bool SPIRVInstructionSelector::selectAddrSpaceCast(Register ResVReg, in selectAddrSpaceCast() argument
640 auto UIs = MRI->use_instructions(ResVReg); in selectAddrSpaceCast()
652 .addDef(ResVReg) in selectAddrSpaceCast()
662 SPIRV::StorageClass DstSC = GR.getPointerStorageClass(ResVReg); in selectAddrSpaceCast()
666 return selectUnOp(ResVReg, ResType, I, SPIRV::OpPtrCastToGeneric); in selectAddrSpaceCast()
669 return selectUnOp(ResVReg, ResType, I, SPIRV::OpGenericCastToPtr); in selectAddrSpaceCast()
683 .addDef(ResVReg) in selectAddrSpaceCast()
690 return selectUnOp(ResVReg, ResType, I, SPIRV::OpBitcast); in selectAddrSpaceCast()
781 bool SPIRVInstructionSelector::selectBitreverse(Register ResVReg, in selectBitreverse() argument
786 .addDef(ResVReg) in selectBitreverse()
792 bool SPIRVInstructionSelector::selectConstVector(Register ResVReg, in selectConstVector() argument
814 .addDef(ResVReg) in selectConstVector()
821 bool SPIRVInstructionSelector::selectCmp(Register ResVReg, in selectCmp() argument
831 .addDef(ResVReg) in selectCmp()
838 bool SPIRVInstructionSelector::selectICmp(Register ResVReg, in selectICmp() argument
851 return selectCmp(ResVReg, ResType, CmpOpc, I); in selectICmp()
900 bool SPIRVInstructionSelector::selectFCmp(Register ResVReg, in selectFCmp() argument
904 return selectCmp(ResVReg, ResType, CmpOp, I); in selectFCmp()
925 bool SPIRVInstructionSelector::selectSelect(Register ResVReg, in selectSelect() argument
937 .addDef(ResVReg) in selectSelect()
945 bool SPIRVInstructionSelector::selectIToF(Register ResVReg, in selectIToF() argument
962 return selectUnOpWithSrc(ResVReg, ResType, I, SrcReg, Opcode); in selectIToF()
965 bool SPIRVInstructionSelector::selectExt(Register ResVReg, in selectExt() argument
969 return selectSelect(ResVReg, ResType, I, IsSigned); in selectExt()
971 return selectUnOp(ResVReg, ResType, I, Opcode); in selectExt()
975 Register ResVReg, in selectIntToBool() argument
993 .addDef(ResVReg) in selectIntToBool()
1000 bool SPIRVInstructionSelector::selectTrunc(Register ResVReg, in selectTrunc() argument
1003 if (GR.isScalarOrVectorOfType(ResVReg, SPIRV::OpTypeBool)) { in selectTrunc()
1006 return selectIntToBool(IntReg, ResVReg, ArgType, ResType, I); in selectTrunc()
1010 return selectUnOp(ResVReg, ResType, I, Opcode); in selectTrunc()
1013 bool SPIRVInstructionSelector::selectConst(Register ResVReg, in selectConst() argument
1023 .addDef(ResVReg) in selectConst()
1028 if (Reg == ResVReg) in selectConst()
1031 .addDef(ResVReg) in selectConst()
1036 .addDef(ResVReg) in selectConst()
1044 bool SPIRVInstructionSelector::selectOpUndef(Register ResVReg, in selectOpUndef() argument
1048 .addDef(ResVReg) in selectOpUndef()
1070 bool SPIRVInstructionSelector::selectInsertVal(Register ResVReg, in selectInsertVal() argument
1075 .addDef(ResVReg) in selectInsertVal()
1086 bool SPIRVInstructionSelector::selectExtractVal(Register ResVReg, in selectExtractVal() argument
1091 .addDef(ResVReg) in selectExtractVal()
1099 bool SPIRVInstructionSelector::selectInsertElt(Register ResVReg, in selectInsertElt() argument
1103 return selectInsertVal(ResVReg, ResType, I); in selectInsertElt()
1106 .addDef(ResVReg) in selectInsertElt()
1114 bool SPIRVInstructionSelector::selectExtractElt(Register ResVReg, in selectExtractElt() argument
1118 return selectExtractVal(ResVReg, ResType, I); in selectExtractElt()
1121 .addDef(ResVReg) in selectExtractElt()
1128 bool SPIRVInstructionSelector::selectGEP(Register ResVReg, in selectGEP() argument
1137 .addDef(ResVReg) in selectGEP()
1147 bool SPIRVInstructionSelector::selectIntrinsic(Register ResVReg, in selectIntrinsic() argument
1153 return selectLoad(ResVReg, ResType, I); in selectIntrinsic()
1159 return selectExtractVal(ResVReg, ResType, I); in selectIntrinsic()
1162 return selectInsertVal(ResVReg, ResType, I); in selectIntrinsic()
1165 return selectExtractElt(ResVReg, ResType, I); in selectIntrinsic()
1168 return selectInsertElt(ResVReg, ResType, I); in selectIntrinsic()
1171 return selectGEP(ResVReg, ResType, I); in selectIntrinsic()
1188 .addDef(ResVReg) in selectIntrinsic()
1223 return selectAtomicCmpXchg(ResVReg, ResType, I); in selectIntrinsic()
1231 bool SPIRVInstructionSelector::selectFrameIndex(Register ResVReg, in selectFrameIndex() argument
1235 .addDef(ResVReg) in selectFrameIndex()
1287 bool SPIRVInstructionSelector::selectPhi(Register ResVReg, in selectPhi() argument
1291 .addDef(ResVReg) in selectPhi()
1302 Register ResVReg, MachineInstr &I, const MachineInstr *Init) const { in selectGlobalValue() argument
1321 Register NewReg = ResVReg; in selectGlobalValue()
1328 assert(NewReg != ResVReg); in selectGlobalValue()
1330 .addDef(ResVReg) in selectGlobalValue()
1353 Register Reg = GR.buildGlobalVariable(ResVReg, ResType, GlobalIdent, GV, in selectGlobalValue()