Lines Matching refs:ResVReg
82 bool spvSelect(Register ResVReg, const SPIRVType *ResType,
85 bool selectGlobalValue(Register ResVReg, MachineInstr &I,
88 bool selectUnOpWithSrc(Register ResVReg, const SPIRVType *ResType,
91 bool selectUnOp(Register ResVReg, const SPIRVType *ResType, MachineInstr &I,
94 bool selectLoad(Register ResVReg, const SPIRVType *ResType,
98 bool selectMemOperation(Register ResVReg, MachineInstr &I) const;
100 bool selectAtomicRMW(Register ResVReg, const SPIRVType *ResType,
103 bool selectAtomicCmpXchg(Register ResVReg, const SPIRVType *ResType,
108 bool selectAddrSpaceCast(Register ResVReg, const SPIRVType *ResType,
111 bool selectBitreverse(Register ResVReg, const SPIRVType *ResType,
114 bool selectConstVector(Register ResVReg, const SPIRVType *ResType,
117 bool selectCmp(Register ResVReg, const SPIRVType *ResType,
120 bool selectICmp(Register ResVReg, const SPIRVType *ResType,
122 bool selectFCmp(Register ResVReg, const SPIRVType *ResType,
130 bool selectConst(Register ResVReg, const SPIRVType *ResType, const APInt &Imm,
133 bool selectSelect(Register ResVReg, const SPIRVType *ResType, MachineInstr &I,
135 bool selectIToF(Register ResVReg, const SPIRVType *ResType, MachineInstr &I,
137 bool selectExt(Register ResVReg, const SPIRVType *ResType, MachineInstr &I,
140 bool selectTrunc(Register ResVReg, const SPIRVType *ResType,
143 bool selectIntToBool(Register IntReg, Register ResVReg, MachineInstr &I,
146 bool selectOpUndef(Register ResVReg, const SPIRVType *ResType,
148 bool selectIntrinsic(Register ResVReg, const SPIRVType *ResType,
150 bool selectExtractVal(Register ResVReg, const SPIRVType *ResType,
152 bool selectInsertVal(Register ResVReg, const SPIRVType *ResType,
154 bool selectExtractElt(Register ResVReg, const SPIRVType *ResType,
156 bool selectInsertElt(Register ResVReg, const SPIRVType *ResType,
158 bool selectGEP(Register ResVReg, const SPIRVType *ResType,
161 bool selectFrameIndex(Register ResVReg, const SPIRVType *ResType,
167 bool selectPhi(Register ResVReg, const SPIRVType *ResType,
170 bool selectExtInst(Register ResVReg, const SPIRVType *ResType,
172 bool selectExtInst(Register ResVReg, const SPIRVType *ResType,
175 bool selectExtInst(Register ResVReg, const SPIRVType *ResType,
178 bool selectLog10(Register ResVReg, const SPIRVType *ResType,
256 Register ResVReg = HasDefs ? I.getOperand(0).getReg() : Register(0); in select() local
257 SPIRVType *ResType = HasDefs ? GR.getSPIRVTypeForVReg(ResVReg) : nullptr; in select()
259 if (spvSelect(ResVReg, ResType, I)) { in select()
261 MRI->setType(ResVReg, LLT::scalar(32)); in select()
268 bool SPIRVInstructionSelector::spvSelect(Register ResVReg, in spvSelect() argument
276 return selectConst(ResVReg, ResType, I.getOperand(1).getCImm()->getValue(), in spvSelect()
279 return selectGlobalValue(ResVReg, I); in spvSelect()
281 return selectOpUndef(ResVReg, ResType, I); in spvSelect()
285 return selectIntrinsic(ResVReg, ResType, I); in spvSelect()
287 return selectBitreverse(ResVReg, ResType, I); in spvSelect()
290 return selectConstVector(ResVReg, ResType, I); in spvSelect()
295 .addDef(ResVReg) in spvSelect()
306 return selectMemOperation(ResVReg, I); in spvSelect()
309 return selectICmp(ResVReg, ResType, I); in spvSelect()
311 return selectFCmp(ResVReg, ResType, I); in spvSelect()
314 return selectFrameIndex(ResVReg, ResType, I); in spvSelect()
317 return selectLoad(ResVReg, ResType, I); in spvSelect()
327 return selectPhi(ResVReg, ResType, I); in spvSelect()
330 return selectUnOp(ResVReg, ResType, I, SPIRV::OpConvertFToS); in spvSelect()
332 return selectUnOp(ResVReg, ResType, I, SPIRV::OpConvertFToU); in spvSelect()
335 return selectIToF(ResVReg, ResType, I, true, SPIRV::OpConvertSToF); in spvSelect()
337 return selectIToF(ResVReg, ResType, I, false, SPIRV::OpConvertUToF); in spvSelect()
340 return selectUnOp(ResVReg, ResType, I, SPIRV::OpBitCount); in spvSelect()
342 return selectExtInst(ResVReg, ResType, I, CL::s_min, GL::SMin); in spvSelect()
344 return selectExtInst(ResVReg, ResType, I, CL::u_min, GL::UMin); in spvSelect()
347 return selectExtInst(ResVReg, ResType, I, CL::s_max, GL::SMax); in spvSelect()
349 return selectExtInst(ResVReg, ResType, I, CL::u_max, GL::UMax); in spvSelect()
352 return selectExtInst(ResVReg, ResType, I, CL::fma, GL::Fma); in spvSelect()
355 return selectExtInst(ResVReg, ResType, I, CL::pow, GL::Pow); in spvSelect()
357 return selectExtInst(ResVReg, ResType, I, CL::pown); in spvSelect()
360 return selectExtInst(ResVReg, ResType, I, CL::exp, GL::Exp); in spvSelect()
362 return selectExtInst(ResVReg, ResType, I, CL::exp2, GL::Exp2); in spvSelect()
365 return selectExtInst(ResVReg, ResType, I, CL::log, GL::Log); in spvSelect()
367 return selectExtInst(ResVReg, ResType, I, CL::log2, GL::Log2); in spvSelect()
369 return selectLog10(ResVReg, ResType, I); in spvSelect()
372 return selectExtInst(ResVReg, ResType, I, CL::fabs, GL::FAbs); in spvSelect()
374 return selectExtInst(ResVReg, ResType, I, CL::s_abs, GL::SAbs); in spvSelect()
378 return selectExtInst(ResVReg, ResType, I, CL::fmin, GL::FMin); in spvSelect()
381 return selectExtInst(ResVReg, ResType, I, CL::fmax, GL::FMax); in spvSelect()
384 return selectExtInst(ResVReg, ResType, I, CL::copysign); in spvSelect()
387 return selectExtInst(ResVReg, ResType, I, CL::ceil, GL::Ceil); in spvSelect()
389 return selectExtInst(ResVReg, ResType, I, CL::floor, GL::Floor); in spvSelect()
392 return selectExtInst(ResVReg, ResType, I, CL::cos, GL::Cos); in spvSelect()
394 return selectExtInst(ResVReg, ResType, I, CL::sin, GL::Sin); in spvSelect()
397 return selectExtInst(ResVReg, ResType, I, CL::sqrt, GL::Sqrt); in spvSelect()
401 return selectExtInst(ResVReg, ResType, I, CL::ctz); in spvSelect()
404 return selectExtInst(ResVReg, ResType, I, CL::clz); in spvSelect()
407 return selectExtInst(ResVReg, ResType, I, CL::round, GL::Round); in spvSelect()
409 return selectExtInst(ResVReg, ResType, I, CL::rint, GL::RoundEven); in spvSelect()
411 return selectExtInst(ResVReg, ResType, I, CL::trunc, GL::Trunc); in spvSelect()
414 return selectExtInst(ResVReg, ResType, I, CL::rint, GL::RoundEven); in spvSelect()
417 return selectExtInst(ResVReg, ResType, I, CL::s_mul_hi); in spvSelect()
419 return selectExtInst(ResVReg, ResType, I, CL::u_mul_hi); in spvSelect()
422 return selectExt(ResVReg, ResType, I, true); in spvSelect()
425 return selectExt(ResVReg, ResType, I, false); in spvSelect()
427 return selectTrunc(ResVReg, ResType, I); in spvSelect()
430 return selectUnOp(ResVReg, ResType, I, SPIRV::OpFConvert); in spvSelect()
433 return selectUnOp(ResVReg, ResType, I, SPIRV::OpConvertPtrToU); in spvSelect()
435 return selectUnOp(ResVReg, ResType, I, SPIRV::OpConvertUToPtr); in spvSelect()
437 return selectUnOp(ResVReg, ResType, I, SPIRV::OpBitcast); in spvSelect()
439 return selectAddrSpaceCast(ResVReg, ResType, I); in spvSelect()
455 .addDef(ResVReg) in spvSelect()
466 return selectAtomicRMW(ResVReg, ResType, I, SPIRV::OpAtomicOr); in spvSelect()
468 return selectAtomicRMW(ResVReg, ResType, I, SPIRV::OpAtomicIAdd); in spvSelect()
470 return selectAtomicRMW(ResVReg, ResType, I, SPIRV::OpAtomicAnd); in spvSelect()
472 return selectAtomicRMW(ResVReg, ResType, I, SPIRV::OpAtomicSMax); in spvSelect()
474 return selectAtomicRMW(ResVReg, ResType, I, SPIRV::OpAtomicSMin); in spvSelect()
476 return selectAtomicRMW(ResVReg, ResType, I, SPIRV::OpAtomicISub); in spvSelect()
478 return selectAtomicRMW(ResVReg, ResType, I, SPIRV::OpAtomicXor); in spvSelect()
480 return selectAtomicRMW(ResVReg, ResType, I, SPIRV::OpAtomicUMax); in spvSelect()
482 return selectAtomicRMW(ResVReg, ResType, I, SPIRV::OpAtomicUMin); in spvSelect()
484 return selectAtomicRMW(ResVReg, ResType, I, SPIRV::OpAtomicExchange); in spvSelect()
486 return selectAtomicCmpXchg(ResVReg, ResType, I); in spvSelect()
496 bool SPIRVInstructionSelector::selectExtInst(Register ResVReg, in selectExtInst() argument
500 return selectExtInst(ResVReg, ResType, I, in selectExtInst()
504 bool SPIRVInstructionSelector::selectExtInst(Register ResVReg, in selectExtInst() argument
511 return selectExtInst(ResVReg, ResType, I, ExtInsts); in selectExtInst()
514 bool SPIRVInstructionSelector::selectExtInst(Register ResVReg, in selectExtInst() argument
525 .addDef(ResVReg) in selectExtInst()
538 bool SPIRVInstructionSelector::selectUnOpWithSrc(Register ResVReg, in selectUnOpWithSrc() argument
544 .addDef(ResVReg) in selectUnOpWithSrc()
550 bool SPIRVInstructionSelector::selectUnOp(Register ResVReg, in selectUnOp() argument
554 return selectUnOpWithSrc(ResVReg, ResType, I, I.getOperand(1).getReg(), in selectUnOp()
597 bool SPIRVInstructionSelector::selectLoad(Register ResVReg, in selectLoad() argument
603 .addDef(ResVReg) in selectLoad()
636 bool SPIRVInstructionSelector::selectMemOperation(Register ResVReg, in selectMemOperation() argument
676 if (ResVReg.isValid() && ResVReg != MIB->getOperand(0).getReg()) in selectMemOperation()
677 BuildMI(BB, I, I.getDebugLoc(), TII.get(TargetOpcode::COPY), ResVReg) in selectMemOperation()
682 bool SPIRVInstructionSelector::selectAtomicRMW(Register ResVReg, in selectAtomicRMW() argument
700 .addDef(ResVReg) in selectAtomicRMW()
723 bool SPIRVInstructionSelector::selectAtomicCmpXchg(Register ResVReg, in selectAtomicCmpXchg() argument
784 .addDef(ResVReg) in selectAtomicCmpXchg()
809 bool SPIRVInstructionSelector::selectAddrSpaceCast(Register ResVReg, in selectAddrSpaceCast() argument
814 auto UIs = MRI->use_instructions(ResVReg); in selectAddrSpaceCast()
826 .addDef(ResVReg) in selectAddrSpaceCast()
836 SPIRV::StorageClass::StorageClass DstSC = GR.getPointerStorageClass(ResVReg); in selectAddrSpaceCast()
840 return selectUnOp(ResVReg, ResType, I, SPIRV::OpPtrCastToGeneric); in selectAddrSpaceCast()
843 return selectUnOp(ResVReg, ResType, I, SPIRV::OpGenericCastToPtr); in selectAddrSpaceCast()
857 .addDef(ResVReg) in selectAddrSpaceCast()
864 return selectUnOp(ResVReg, ResType, I, SPIRV::OpBitcast); in selectAddrSpaceCast()
955 bool SPIRVInstructionSelector::selectBitreverse(Register ResVReg, in selectBitreverse() argument
960 .addDef(ResVReg) in selectBitreverse()
966 bool SPIRVInstructionSelector::selectConstVector(Register ResVReg, in selectConstVector() argument
988 .addDef(ResVReg) in selectConstVector()
995 bool SPIRVInstructionSelector::selectCmp(Register ResVReg, in selectCmp() argument
1005 .addDef(ResVReg) in selectCmp()
1012 bool SPIRVInstructionSelector::selectICmp(Register ResVReg, in selectICmp() argument
1025 return selectCmp(ResVReg, ResType, CmpOpc, I); in selectICmp()
1074 bool SPIRVInstructionSelector::selectFCmp(Register ResVReg, in selectFCmp() argument
1078 return selectCmp(ResVReg, ResType, CmpOp, I); in selectFCmp()
1099 bool SPIRVInstructionSelector::selectSelect(Register ResVReg, in selectSelect() argument
1111 .addDef(ResVReg) in selectSelect()
1119 bool SPIRVInstructionSelector::selectIToF(Register ResVReg, in selectIToF() argument
1136 return selectUnOpWithSrc(ResVReg, ResType, I, SrcReg, Opcode); in selectIToF()
1139 bool SPIRVInstructionSelector::selectExt(Register ResVReg, in selectExt() argument
1143 return selectSelect(ResVReg, ResType, I, IsSigned); in selectExt()
1145 return selectUnOp(ResVReg, ResType, I, Opcode); in selectExt()
1149 Register ResVReg, in selectIntToBool() argument
1167 .addDef(ResVReg) in selectIntToBool()
1174 bool SPIRVInstructionSelector::selectTrunc(Register ResVReg, in selectTrunc() argument
1177 if (GR.isScalarOrVectorOfType(ResVReg, SPIRV::OpTypeBool)) { in selectTrunc()
1180 return selectIntToBool(IntReg, ResVReg, I, ArgType, ResType); in selectTrunc()
1184 return selectUnOp(ResVReg, ResType, I, Opcode); in selectTrunc()
1187 bool SPIRVInstructionSelector::selectConst(Register ResVReg, in selectConst() argument
1197 .addDef(ResVReg) in selectConst()
1203 if (Reg == ResVReg) in selectConst()
1206 .addDef(ResVReg) in selectConst()
1211 .addDef(ResVReg) in selectConst()
1219 bool SPIRVInstructionSelector::selectOpUndef(Register ResVReg, in selectOpUndef() argument
1223 .addDef(ResVReg) in selectOpUndef()
1245 bool SPIRVInstructionSelector::selectInsertVal(Register ResVReg, in selectInsertVal() argument
1250 .addDef(ResVReg) in selectInsertVal()
1261 bool SPIRVInstructionSelector::selectExtractVal(Register ResVReg, in selectExtractVal() argument
1266 .addDef(ResVReg) in selectExtractVal()
1274 bool SPIRVInstructionSelector::selectInsertElt(Register ResVReg, in selectInsertElt() argument
1278 return selectInsertVal(ResVReg, ResType, I); in selectInsertElt()
1281 .addDef(ResVReg) in selectInsertElt()
1289 bool SPIRVInstructionSelector::selectExtractElt(Register ResVReg, in selectExtractElt() argument
1293 return selectExtractVal(ResVReg, ResType, I); in selectExtractElt()
1296 .addDef(ResVReg) in selectExtractElt()
1303 bool SPIRVInstructionSelector::selectGEP(Register ResVReg, in selectGEP() argument
1318 .addDef(ResVReg) in selectGEP()
1332 bool SPIRVInstructionSelector::selectIntrinsic(Register ResVReg, in selectIntrinsic() argument
1338 return selectLoad(ResVReg, ResType, I); in selectIntrinsic()
1342 return selectExtractVal(ResVReg, ResType, I); in selectIntrinsic()
1344 return selectInsertVal(ResVReg, ResType, I); in selectIntrinsic()
1346 return selectExtractElt(ResVReg, ResType, I); in selectIntrinsic()
1348 return selectInsertElt(ResVReg, ResType, I); in selectIntrinsic()
1350 return selectGEP(ResVReg, ResType, I); in selectIntrinsic()
1362 .addDef(ResVReg) in selectIntrinsic()
1372 .addDef(ResVReg) in selectIntrinsic()
1407 return selectAtomicCmpXchg(ResVReg, ResType, I); in selectIntrinsic()
1412 return selectFrameIndex(ResVReg, ResType, I); in selectIntrinsic()
1421 .addDef(ResVReg) in selectIntrinsic()
1432 bool SPIRVInstructionSelector::selectFrameIndex(Register ResVReg, in selectFrameIndex() argument
1436 .addDef(ResVReg) in selectFrameIndex()
1488 bool SPIRVInstructionSelector::selectPhi(Register ResVReg, in selectPhi() argument
1492 .addDef(ResVReg) in selectPhi()
1503 Register ResVReg, MachineInstr &I, const MachineInstr *Init) const { in selectGlobalValue() argument
1532 Register NewReg = ResVReg; in selectGlobalValue()
1539 assert(NewReg != ResVReg); in selectGlobalValue()
1541 .addDef(ResVReg) in selectGlobalValue()
1565 Register Reg = GR.buildGlobalVariable(ResVReg, ResType, GlobalIdent, GV, in selectGlobalValue()
1571 bool SPIRVInstructionSelector::selectLog10(Register ResVReg, in selectLog10() argument
1575 return selectExtInst(ResVReg, ResType, I, CL::log10); in selectLog10()
1613 .addDef(ResVReg) in selectLog10()