76 bool EnableLateStructurizeCFG;
85 ~AMDGPUDAGToDAGISel()
override =
default;
97 void PostprocessISelDAG()
override;
100 void SelectBuildVector(
SDNode *
N,
unsigned RegClassID);
103 std::pair<SDValue, SDValue> foldFrameIndex(
SDValue N)
const;
105 bool isInlineImmediate(
const SDNode *
N)
const;
107 bool isUniformBr(
const SDNode *
N)
const;
115 unsigned OffsetBits)
const;
129 bool SelectMUBUFScratchOffen(
SDNode *Parent,
132 bool SelectMUBUFScratchOffset(
SDNode *Parent,
156 template <
bool IsSigned>
199 bool SelectVOP3PMadMixModsImpl(
SDValue In,
SDValue &Src,
unsigned &Mods)
const;
204 void SelectADD_SUB_I64(
SDNode *
N);
205 void SelectUADDO_USUBO(
SDNode *
N);
206 void SelectDIV_SCALE(
SDNode *
N);
207 void SelectMAD_64_32(
SDNode *
N);
208 void SelectFMA_W_CHAIN(
SDNode *
N);
209 void SelectFMUL_W_CHAIN(
SDNode *
N);
213 void SelectS_BFEFromShifts(
SDNode *
N);
215 bool isCBranchSCC(
const SDNode *
N)
const;
217 void SelectFMAD_FMA(
SDNode *
N);
218 void SelectATOMIC_CMP_SWAP(
SDNode *
N);
222 #include "AMDGPUGenDAGISel.inc" 225 class R600DAGToDAGISel :
public AMDGPUDAGToDAGISel {
229 bool isConstantLoad(
const MemSDNode *
N,
int cbID)
const;
230 bool SelectGlobalValueConstantOffset(
SDValue Addr,
SDValue& IntPtr);
231 bool SelectGlobalValueVariableOffset(
SDValue Addr,
SDValue &BaseReg,
235 AMDGPUDAGToDAGISel(TM, OptLevel) {
249 #include "R600GenDAGISel.inc" 255 "AMDGPU DAG->DAG Pattern Instruction Selection",
false,
false)
265 CodeGenOpt::
Level OptLevel) {
266 return new AMDGPUDAGToDAGISel(TM, OptLevel);
273 return new R600DAGToDAGISel(TM, OptLevel);
281 bool AMDGPUDAGToDAGISel::isNoNanSrc(
SDValue N)
const {
282 if (
TM.Options.NoNaNsFPMath)
289 return CurDAG->isKnownNeverNaN(N);
292 bool AMDGPUDAGToDAGISel::isInlineImmediate(
const SDNode *N)
const {
309 unsigned OpNo)
const {
337 return Subtarget->getRegisterInfo()->getRegClass(RegClass);
339 case AMDGPU::REG_SEQUENCE: {
340 unsigned RCID = cast<ConstantSDNode>(N->
getOperand(0))->getZExtValue();
342 Subtarget->getRegisterInfo()->getRegClass(RCID);
345 unsigned SubRegIdx = cast<ConstantSDNode>(SubRegOp)->getZExtValue();
346 return Subtarget->getRegisterInfo()->getSubClassWithSubReg(SuperRC,
352 SDNode *AMDGPUDAGToDAGISel::glueCopyToM0(
SDNode *N)
const {
353 if (cast<MemSDNode>(N)->getAddressSpace() != AMDGPUASI.LOCAL_ADDRESS ||
354 !Subtarget->ldsRequiresM0Init())
376 switch (NumVectorElts) {
378 return AMDGPU::SReg_32_XM0RegClassID;
380 return AMDGPU::SReg_64RegClassID;
382 return AMDGPU::SReg_128RegClassID;
384 return AMDGPU::SReg_256RegClassID;
386 return AMDGPU::SReg_512RegClassID;
394 Out =
C->getAPIntValue().getZExtValue();
399 Out =
C->getValueAPF().bitcastToAPInt().getZExtValue();
406 void AMDGPUDAGToDAGISel::SelectBuildVector(
SDNode *N,
unsigned RegClassID) {
411 SDValue RegClass = CurDAG->getTargetConstant(RegClassID, DL,
MVT::i32);
413 if (NumVectorElts == 1) {
414 CurDAG->SelectNodeTo(N, AMDGPU::COPY_TO_REGCLASS, EltVT, N->
getOperand(0),
419 assert(NumVectorElts <= 16 &&
"Vectors with more than 16 elements not " 426 RegSeqArgs[0] = CurDAG->getTargetConstant(RegClassID, DL,
MVT::i32);
427 bool IsRegSeq =
true;
429 for (
unsigned i = 0; i < NOps; i++) {
437 RegSeqArgs[1 + (2 * i) + 1] = CurDAG->getTargetConstant(Sub, DL,
MVT::i32);
439 if (NOps != NumVectorElts) {
442 MachineSDNode *ImpDef = CurDAG->getMachineNode(TargetOpcode::IMPLICIT_DEF,
444 for (
unsigned i = NOps; i < NumVectorElts; ++i) {
446 RegSeqArgs[1 + (2 * i)] =
SDValue(ImpDef, 0);
447 RegSeqArgs[1 + (2 * i) + 1] =
448 CurDAG->getTargetConstant(Sub, DL,
MVT::i32);
454 CurDAG->SelectNodeTo(N, AMDGPU::REG_SEQUENCE, N->
getVTList(), RegSeqArgs);
464 if (isa<AtomicSDNode>(N) ||
484 SelectADD_SUB_I64(N);
489 SelectUADDO_USUBO(N);
493 SelectFMUL_W_CHAIN(N);
497 SelectFMA_W_CHAIN(N);
510 uint32_t K = LHSVal | (RHSVal << 16);
511 CurDAG->SelectNodeTo(N, AMDGPU::S_MOV_B32, VT,
522 SelectBuildVector(N, RegClassID);
529 RC = CurDAG->getTargetConstant(AMDGPU::SReg_128RegClassID, DL,
MVT::i32);
530 SubReg0 = CurDAG->getTargetConstant(AMDGPU::sub0_sub1, DL,
MVT::i32);
531 SubReg1 = CurDAG->getTargetConstant(AMDGPU::sub2_sub3, DL,
MVT::i32);
533 RC = CurDAG->getTargetConstant(AMDGPU::SReg_64RegClassID, DL,
MVT::i32);
534 SubReg0 = CurDAG->getTargetConstant(AMDGPU::sub0, DL,
MVT::i32);
535 SubReg1 = CurDAG->getTargetConstant(AMDGPU::sub1, DL,
MVT::i32);
541 ReplaceNode(N, CurDAG->getMachineNode(TargetOpcode::REG_SEQUENCE, DL,
553 Imm = FP->getValueAPF().bitcastToAPInt().getZExtValue();
561 CurDAG->getConstant(Imm & 0xFFFFFFFF, DL,
564 CurDAG->getConstant(Imm >> 32, DL,
MVT::i32));
566 CurDAG->getTargetConstant(AMDGPU::SReg_64RegClassID, DL,
MVT::i32),
571 ReplaceNode(N, CurDAG->getMachineNode(TargetOpcode::REG_SEQUENCE, DL,
606 ReplaceNode(N, getS_BFE(Signed ? AMDGPU::S_BFE_I32 : AMDGPU::S_BFE_U32,
642 SelectATOMIC_CMP_SWAP(N);
649 bool AMDGPUDAGToDAGISel::isUniformBr(
const SDNode *N)
const {
650 const BasicBlock *BB = FuncInfo->MBB->getBasicBlock();
656 StringRef AMDGPUDAGToDAGISel::getPassName()
const {
657 return "AMDGPU DAG->DAG Pattern Instruction Selection";
669 bool AMDGPUDAGToDAGISel::SelectADDRIndirect(
SDValue Addr,
SDValue &Base,
674 if ((C = dyn_cast<ConstantSDNode>(Addr))) {
675 Base = CurDAG->getRegister(R600::INDIRECT_BASE_ADDR,
MVT::i32);
678 (C = dyn_cast<ConstantSDNode>(Addr.
getOperand(0)))) {
679 Base = CurDAG->getRegister(R600::INDIRECT_BASE_ADDR,
MVT::i32);
682 (C = dyn_cast<ConstantSDNode>(Addr.
getOperand(1)))) {
687 Offset = CurDAG->getTargetConstant(0, DL,
MVT::i32);
694 void AMDGPUDAGToDAGISel::SelectADD_SUB_I64(
SDNode *N) {
708 SDNode *Lo0 = CurDAG->getMachineNode(TargetOpcode::EXTRACT_SUBREG,
710 SDNode *Hi0 = CurDAG->getMachineNode(TargetOpcode::EXTRACT_SUBREG,
713 SDNode *Lo1 = CurDAG->getMachineNode(TargetOpcode::EXTRACT_SUBREG,
715 SDNode *Hi1 = CurDAG->getMachineNode(TargetOpcode::EXTRACT_SUBREG,
720 unsigned Opc = IsAdd ? AMDGPU::S_ADD_U32 : AMDGPU::S_SUB_U32;
721 unsigned CarryOpc = IsAdd ? AMDGPU::S_ADDC_U32 : AMDGPU::S_SUBB_U32;
726 AddLo = CurDAG->getMachineNode(Opc, DL, VTList, Args);
729 AddLo = CurDAG->getMachineNode(CarryOpc, DL, VTList, Args);
736 SDNode *AddHi = CurDAG->getMachineNode(CarryOpc, DL, VTList, AddHiArgs);
739 CurDAG->getTargetConstant(AMDGPU::SReg_64RegClassID, DL,
MVT::i32),
754 ReplaceNode(N, RegSequence);
757 void AMDGPUDAGToDAGISel::SelectUADDO_USUBO(
SDNode *N) {
762 AMDGPU::V_ADD_I32_e64 : AMDGPU::V_SUB_I32_e64;
764 CurDAG->SelectNodeTo(N, Opc, N->
getVTList(),
768 void AMDGPUDAGToDAGISel::SelectFMA_W_CHAIN(
SDNode *N) {
773 SelectVOP3Mods0(N->
getOperand(1), Ops[1], Ops[0], Ops[6], Ops[7]);
774 SelectVOP3Mods(N->
getOperand(2), Ops[3], Ops[2]);
775 SelectVOP3Mods(N->
getOperand(3), Ops[5], Ops[4]);
779 CurDAG->SelectNodeTo(N, AMDGPU::V_FMA_F32, N->
getVTList(), Ops);
782 void AMDGPUDAGToDAGISel::SelectFMUL_W_CHAIN(
SDNode *N) {
787 SelectVOP3Mods0(N->
getOperand(1), Ops[1], Ops[0], Ops[4], Ops[5]);
788 SelectVOP3Mods(N->
getOperand(2), Ops[3], Ops[2]);
792 CurDAG->SelectNodeTo(N, AMDGPU::V_MUL_F32_e64, N->
getVTList(), Ops);
797 void AMDGPUDAGToDAGISel::SelectDIV_SCALE(
SDNode *N) {
804 = (VT ==
MVT::f64) ? AMDGPU::V_DIV_SCALE_F64 : AMDGPU::V_DIV_SCALE_F32;
807 CurDAG->SelectNodeTo(N, Opc, N->
getVTList(), Ops);
812 void AMDGPUDAGToDAGISel::SelectMAD_64_32(
SDNode *N) {
815 unsigned Opc = Signed ? AMDGPU::V_MAD_I64_I32 : AMDGPU::V_MAD_U64_U32;
820 CurDAG->SelectNodeTo(N, Opc, N->
getVTList(), Ops);
823 bool AMDGPUDAGToDAGISel::isDSOffsetLegal(
const SDValue &Base,
unsigned Offset,
824 unsigned OffsetBits)
const {
825 if ((OffsetBits == 16 && !
isUInt<16>(Offset)) ||
830 Subtarget->unsafeDSOffsetFoldingEnabled())
835 return CurDAG->SignBitIsZero(Base);
838 bool AMDGPUDAGToDAGISel::SelectDS1Addr1Offset(
SDValue Addr,
SDValue &Base,
841 if (CurDAG->isBaseWithConstantOffset(Addr)) {
854 int64_t ByteOffset =
C->getSExtValue();
864 if (isDSOffsetLegal(Sub, ByteOffset, 16)) {
866 unsigned SubOp = Subtarget->hasAddNoCarry() ?
867 AMDGPU::V_SUB_U32_e64 : AMDGPU::V_SUB_I32_e32;
870 = CurDAG->getMachineNode(SubOp, DL,
MVT::i32,
874 Offset = CurDAG->getTargetConstant(ByteOffset, DL,
MVT::i16);
879 }
else if (
const ConstantSDNode *CAddr = dyn_cast<ConstantSDNode>(Addr)) {
889 MachineSDNode *MovZero = CurDAG->getMachineNode(AMDGPU::V_MOV_B32_e32,
892 Offset = CurDAG->getTargetConstant(CAddr->getZExtValue(), DL,
MVT::i16);
899 Offset = CurDAG->getTargetConstant(0,
SDLoc(Addr),
MVT::i16);
904 bool AMDGPUDAGToDAGISel::SelectDS64Bit4ByteAligned(
SDValue Addr,
SDValue &Base,
909 if (CurDAG->isBaseWithConstantOffset(Addr)) {
914 unsigned DWordOffset1 = DWordOffset0 + 1;
916 if (isDSOffsetLegal(N0, DWordOffset1, 8)) {
918 Offset0 = CurDAG->getTargetConstant(DWordOffset0, DL,
MVT::i8);
919 Offset1 = CurDAG->getTargetConstant(DWordOffset1, DL,
MVT::i8);
925 unsigned DWordOffset0 =
C->getZExtValue() / 4;
926 unsigned DWordOffset1 = DWordOffset0 + 1;
938 if (isDSOffsetLegal(Sub, DWordOffset1, 8)) {
939 unsigned SubOp = Subtarget->hasAddNoCarry() ?
940 AMDGPU::V_SUB_U32_e64 : AMDGPU::V_SUB_I32_e32;
943 = CurDAG->getMachineNode(SubOp, DL,
MVT::i32,
947 Offset0 = CurDAG->getTargetConstant(DWordOffset0, DL,
MVT::i8);
948 Offset1 = CurDAG->getTargetConstant(DWordOffset1, DL,
MVT::i8);
953 }
else if (
const ConstantSDNode *CAddr = dyn_cast<ConstantSDNode>(Addr)) {
954 unsigned DWordOffset0 = CAddr->getZExtValue() / 4;
955 unsigned DWordOffset1 = DWordOffset0 + 1;
956 assert(4 * DWordOffset0 == CAddr->getZExtValue());
961 = CurDAG->getMachineNode(AMDGPU::V_MOV_B32_e32,
964 Offset0 = CurDAG->getTargetConstant(DWordOffset0, DL,
MVT::i8);
965 Offset1 = CurDAG->getTargetConstant(DWordOffset1, DL,
MVT::i8);
975 Offset0 = CurDAG->getTargetConstant(0, DL,
MVT::i8);
976 Offset1 = CurDAG->getTargetConstant(1, DL,
MVT::i8);
987 if (Subtarget->useFlatForGlobal())
993 GLC = CurDAG->getTargetConstant(0, DL,
MVT::i1);
995 SLC = CurDAG->getTargetConstant(0, DL,
MVT::i1);
996 TFE = CurDAG->getTargetConstant(0, DL,
MVT::i1);
998 Idxen = CurDAG->getTargetConstant(0, DL,
MVT::i1);
999 Offen = CurDAG->getTargetConstant(0, DL,
MVT::i1);
1000 Addr64 = CurDAG->getTargetConstant(0, DL,
MVT::i1);
1001 SOffset = CurDAG->getTargetConstant(0, DL,
MVT::i32);
1003 if (CurDAG->isBaseWithConstantOffset(Addr)) {
1012 Addr64 = CurDAG->getTargetConstant(1, DL,
MVT::i1);
1017 VAddr = CurDAG->getTargetConstant(0, DL,
MVT::i32);
1028 Offset = CurDAG->getTargetConstant(0, DL,
MVT::i16);
1029 SOffset =
SDValue(CurDAG->getMachineNode(AMDGPU::S_MOV_B32, DL,
MVT::i32,
1040 Addr64 = CurDAG->getTargetConstant(1, DL,
MVT::i1);
1043 Offset = CurDAG->getTargetConstant(0, DL,
MVT::i16);
1048 VAddr = CurDAG->getTargetConstant(0, DL,
MVT::i32);
1050 Offset = CurDAG->getTargetConstant(0, DL,
MVT::i16);
1055 bool AMDGPUDAGToDAGISel::SelectMUBUFAddr64(
SDValue Addr,
SDValue &SRsrc,
1059 SDValue Ptr, Offen, Idxen, Addr64;
1065 if (!SelectMUBUF(Addr, Ptr, VAddr, SOffset, Offset, Offen, Idxen, Addr64,
1083 bool AMDGPUDAGToDAGISel::SelectMUBUFAddr64(
SDValue Addr,
SDValue &SRsrc,
1087 SLC = CurDAG->getTargetConstant(0,
SDLoc(Addr),
MVT::i1);
1090 return SelectMUBUFAddr64(Addr, SRsrc, VAddr, SOffset, Offset, GLC, SLC, TFE);
1098 std::pair<SDValue, SDValue> AMDGPUDAGToDAGISel::foldFrameIndex(
SDValue N)
const {
1102 if (
auto FI = dyn_cast<FrameIndexSDNode>(N)) {
1103 SDValue TFI = CurDAG->getTargetFrameIndex(FI->getIndex(),
1104 FI->getValueType(0));
1118 bool AMDGPUDAGToDAGISel::SelectMUBUFScratchOffen(
SDNode *Parent,
1130 unsigned Imm = CAddr->getZExtValue();
1132 SDValue HighBits = CurDAG->getTargetConstant(Imm & ~4095, DL,
MVT::i32);
1133 MachineSDNode *MovHighBits = CurDAG->getMachineNode(AMDGPU::V_MOV_B32_e32,
1135 VAddr =
SDValue(MovHighBits, 0);
1143 SOffset = CurDAG->getRegister(SOffsetReg,
MVT::i32);
1144 ImmOffset = CurDAG->getTargetConstant(Imm & 4095, DL,
MVT::i16);
1148 if (CurDAG->isBaseWithConstantOffset(Addr)) {
1171 (!Subtarget->privateMemoryResourceIsRangeChecked() ||
1172 CurDAG->SignBitIsZero(N0))) {
1173 std::tie(VAddr, SOffset) = foldFrameIndex(N0);
1180 std::tie(VAddr, SOffset) = foldFrameIndex(Addr);
1181 ImmOffset = CurDAG->getTargetConstant(0, DL,
MVT::i16);
1185 bool AMDGPUDAGToDAGISel::SelectMUBUFScratchOffset(
SDNode *Parent,
1206 SOffset = CurDAG->getRegister(SOffsetReg,
MVT::i32);
1212 bool AMDGPUDAGToDAGISel::SelectMUBUFOffset(
SDValue Addr,
SDValue &SRsrc,
1216 SDValue Ptr, VAddr, Offen, Idxen, Addr64;
1218 static_cast<const SIInstrInfo *
>(Subtarget->getInstrInfo());
1220 if (!SelectMUBUF(Addr, Ptr, VAddr, SOffset, Offset, Offen, Idxen, Addr64,
1224 if (!cast<ConstantSDNode>(Offen)->getSExtValue() &&
1225 !cast<ConstantSDNode>(Idxen)->getSExtValue() &&
1226 !cast<ConstantSDNode>(Addr64)->getSExtValue()) {
1240 bool AMDGPUDAGToDAGISel::SelectMUBUFOffset(
SDValue Addr,
SDValue &SRsrc,
1245 return SelectMUBUFOffset(Addr, SRsrc, Soffset, Offset, GLC, SLC, TFE);
1247 bool AMDGPUDAGToDAGISel::SelectMUBUFOffset(
SDValue Addr,
SDValue &SRsrc,
1252 return SelectMUBUFOffset(Addr, SRsrc, Soffset, Offset, GLC, SLC, TFE);
1261 uint32_t Imm = cast<ConstantSDNode>(Constant)->getZExtValue();
1265 if (Imm <= MaxImm + 64) {
1267 Overflow = Imm - MaxImm;
1282 Overflow = High -
Align;
1293 ImmOffset = CurDAG->getTargetConstant(Imm, DL,
MVT::i16);
1296 SOffset = CurDAG->getTargetConstant(Overflow, DL,
MVT::i32);
1298 SOffset =
SDValue(CurDAG->getMachineNode(AMDGPU::S_MOV_B32, DL,
MVT::i32,
1299 CurDAG->getTargetConstant(Overflow, DL,
MVT::i32)),
1305 bool AMDGPUDAGToDAGISel::SelectMUBUFIntrinsicOffset(
SDValue Offset,
1310 if (!isa<ConstantSDNode>(Offset))
1313 return SelectMUBUFConstant(Offset, SOffset, ImmOffset);
1316 bool AMDGPUDAGToDAGISel::SelectMUBUFIntrinsicVOffset(
SDValue Offset,
1323 if (isa<ConstantSDNode>(Offset)) {
1329 SelectMUBUFConstant(Offset, Tmp1, Tmp2))
1333 if (CurDAG->isBaseWithConstantOffset(Offset)) {
1336 if (cast<ConstantSDNode>(N1)->getSExtValue() >= 0 &&
1337 SelectMUBUFConstant(N1, SOffset, ImmOffset)) {
1343 SOffset = CurDAG->getTargetConstant(0, DL,
MVT::i32);
1344 ImmOffset = CurDAG->getTargetConstant(0, DL,
MVT::i16);
1350 template <
bool IsSigned>
1351 bool AMDGPUDAGToDAGISel::SelectFlatOffset(
SDValue Addr,
1355 int64_t OffsetVal = 0;
1357 if (Subtarget->hasFlatInstOffsets() &&
1358 CurDAG->isBaseWithConstantOffset(Addr)) {
1361 int64_t COffsetVal = cast<ConstantSDNode>(N1)->getSExtValue();
1363 if ((IsSigned && isInt<13>(COffsetVal)) ||
1364 (!IsSigned && isUInt<12>(COffsetVal))) {
1366 OffsetVal = COffsetVal;
1371 Offset = CurDAG->getTargetConstant(OffsetVal,
SDLoc(),
MVT::i16);
1377 bool AMDGPUDAGToDAGISel::SelectFlatAtomic(
SDValue Addr,
1381 return SelectFlatOffset<false>(Addr, VAddr,
Offset, SLC);
1384 bool AMDGPUDAGToDAGISel::SelectFlatAtomicSigned(
SDValue Addr,
1388 return SelectFlatOffset<true>(Addr, VAddr,
Offset, SLC);
1391 bool AMDGPUDAGToDAGISel::SelectSMRDOffset(
SDValue ByteOffsetNode,
1392 SDValue &Offset,
bool &Imm)
const {
1399 SDLoc SL(ByteOffsetNode);
1405 Offset = CurDAG->getTargetConstant(EncodedOffset, SL,
MVT::i32);
1415 Offset = CurDAG->getTargetConstant(EncodedOffset, SL,
MVT::i32);
1418 Offset =
SDValue(CurDAG->getMachineNode(AMDGPU::S_MOV_B32, SL,
MVT::i32,
1425 SDValue AMDGPUDAGToDAGISel::Expand32BitAddress(
SDValue Addr)
const {
1438 CurDAG->getTargetConstant(AMDGPU::SReg_64_XEXECRegClassID, SL,
MVT::i32),
1440 CurDAG->getTargetConstant(AMDGPU::sub0, SL,
MVT::i32),
1441 SDValue(CurDAG->getMachineNode(AMDGPU::S_MOV_B32, SL,
MVT::i32, AddrHi),
1443 CurDAG->getTargetConstant(AMDGPU::sub1, SL,
MVT::i32),
1446 return SDValue(CurDAG->getMachineNode(AMDGPU::REG_SEQUENCE, SL,
MVT::i64,
1450 bool AMDGPUDAGToDAGISel::SelectSMRD(
SDValue Addr,
SDValue &SBase,
1451 SDValue &Offset,
bool &Imm)
const {
1454 if (CurDAG->isBaseWithConstantOffset(Addr)) {
1458 if (SelectSMRDOffset(N1, Offset, Imm)) {
1459 SBase = Expand32BitAddress(N0);
1463 SBase = Expand32BitAddress(Addr);
1464 Offset = CurDAG->getTargetConstant(0, SL,
MVT::i32);
1469 bool AMDGPUDAGToDAGISel::SelectSMRDImm(
SDValue Addr,
SDValue &SBase,
1472 return SelectSMRD(Addr, SBase, Offset, Imm) && Imm;
1475 bool AMDGPUDAGToDAGISel::SelectSMRDImm32(
SDValue Addr,
SDValue &SBase,
1482 if (!SelectSMRD(Addr, SBase, Offset, Imm))
1485 return !Imm && isa<ConstantSDNode>(
Offset);
1488 bool AMDGPUDAGToDAGISel::SelectSMRDSgpr(
SDValue Addr,
SDValue &SBase,
1491 return SelectSMRD(Addr, SBase, Offset, Imm) && !Imm &&
1492 !isa<ConstantSDNode>(
Offset);
1495 bool AMDGPUDAGToDAGISel::SelectSMRDBufferImm(
SDValue Addr,
1498 return SelectSMRDOffset(Addr, Offset, Imm) && Imm;
1501 bool AMDGPUDAGToDAGISel::SelectSMRDBufferImm32(
SDValue Addr,
1507 if (!SelectSMRDOffset(Addr, Offset, Imm))
1510 return !Imm && isa<ConstantSDNode>(
Offset);
1513 bool AMDGPUDAGToDAGISel::SelectMOVRELOffset(
SDValue Index,
1518 if (CurDAG->isBaseWithConstantOffset(Index)) {
1529 if (isa<ConstantSDNode>(Index))
1533 Offset = CurDAG->getTargetConstant(0, DL,
MVT::i32);
1537 SDNode *AMDGPUDAGToDAGISel::getS_BFE(
unsigned Opcode,
const SDLoc &DL,
1543 uint32_t PackedVal = Offset | (Width << 16);
1544 SDValue PackedConst = CurDAG->getTargetConstant(PackedVal, DL,
MVT::i32);
1546 return CurDAG->getMachineNode(Opcode, DL,
MVT::i32, Val, PackedConst);
1549 void AMDGPUDAGToDAGISel::SelectS_BFEFromShifts(
SDNode *N) {
1562 if (0 < BVal && BVal <= CVal && CVal < 32) {
1564 unsigned Opcode = Signed ? AMDGPU::S_BFE_I32 : AMDGPU::S_BFE_U32;
1566 ReplaceNode(N, getS_BFE(Opcode,
SDLoc(N), Shl.
getOperand(0), CVal - BVal,
1574 void AMDGPUDAGToDAGISel::SelectS_BFE(
SDNode *N) {
1584 if (Shift && Mask) {
1586 uint32_t MaskVal = Mask->getZExtValue();
1591 ReplaceNode(N, getS_BFE(AMDGPU::S_BFE_U32,
SDLoc(N),
1606 if (Shift && Mask) {
1608 uint32_t MaskVal = Mask->getZExtValue() >> ShiftVal;
1613 ReplaceNode(N, getS_BFE(AMDGPU::S_BFE_U32,
SDLoc(N),
1619 SelectS_BFEFromShifts(N);
1625 SelectS_BFEFromShifts(N);
1640 unsigned Width = cast<VTSDNode>(N->
getOperand(1))->getVT().getSizeInBits();
1641 ReplaceNode(N, getS_BFE(AMDGPU::S_BFE_I32,
SDLoc(N), Src.
getOperand(0),
1650 bool AMDGPUDAGToDAGISel::isCBranchSCC(
const SDNode *N)
const {
1667 auto ST =
static_cast<const GCNSubtarget *
>(Subtarget);
1676 void AMDGPUDAGToDAGISel::SelectBRCOND(
SDNode *N) {
1680 CurDAG->SelectNodeTo(N, AMDGPU::SI_BR_UNDEF,
MVT::Other,
1685 bool UseSCCBr = isCBranchSCC(N) && isUniformBr(N);
1686 unsigned BrOp = UseSCCBr ? AMDGPU::S_CBRANCH_SCC1 : AMDGPU::S_CBRANCH_VCCNZ;
1687 unsigned CondReg = UseSCCBr ? AMDGPU::SCC : AMDGPU::VCC;
1704 Cond =
SDValue(CurDAG->getMachineNode(AMDGPU::S_AND_B64, SL,
MVT::i1,
1705 CurDAG->getRegister(AMDGPU::EXEC,
MVT::i1),
1716 void AMDGPUDAGToDAGISel::SelectFMAD_FMA(
SDNode *N) {
1719 if (VT !=
MVT::f32 || (!Subtarget->hasMadMixInsts() &&
1720 !Subtarget->hasFmaMixInsts()) ||
1721 ((IsFMA && Subtarget->hasMadMixInsts()) ||
1722 (!IsFMA && Subtarget->hasFmaMixInsts()))) {
1730 unsigned Src0Mods, Src1Mods, Src2Mods;
1734 bool Sel0 = SelectVOP3PMadMixModsImpl(Src0, Src0, Src0Mods);
1735 bool Sel1 = SelectVOP3PMadMixModsImpl(Src1, Src1, Src1Mods);
1736 bool Sel2 = SelectVOP3PMadMixModsImpl(Src2, Src2, Src2Mods);
1738 assert((IsFMA || !Subtarget->hasFP32Denormals()) &&
1739 "fmad selected with denormals enabled");
1743 if (Sel0 || Sel1 || Sel2) {
1747 CurDAG->getTargetConstant(Src0Mods,
SDLoc(),
MVT::i32), Src0,
1748 CurDAG->getTargetConstant(Src1Mods,
SDLoc(),
MVT::i32), Src1,
1749 CurDAG->getTargetConstant(Src2Mods,
SDLoc(),
MVT::i32), Src2,
1754 CurDAG->SelectNodeTo(N,
1755 IsFMA ? AMDGPU::V_FMA_MIX_F32 : AMDGPU::V_MAD_MIX_F32,
1764 void AMDGPUDAGToDAGISel::SelectATOMIC_CMP_SWAP(
SDNode *N) {
1767 if (AS == AMDGPUASI.FLAT_ADDRESS) {
1777 if (Subtarget->hasAddr64()) {
1780 if (SelectMUBUFAddr64(Mem->
getBasePtr(), SRsrc, VAddr, SOffset,
Offset, SLC)) {
1781 unsigned Opcode = Is32 ? AMDGPU::BUFFER_ATOMIC_CMPSWAP_ADDR64_RTN :
1782 AMDGPU::BUFFER_ATOMIC_CMPSWAP_X2_ADDR64_RTN;
1791 CmpSwap = CurDAG->getMachineNode(Opcode, SL, Mem->
getVTList(), Ops);
1798 unsigned Opcode = Is32 ? AMDGPU::BUFFER_ATOMIC_CMPSWAP_OFFSET_RTN :
1799 AMDGPU::BUFFER_ATOMIC_CMPSWAP_X2_OFFSET_RTN;
1806 CmpSwap = CurDAG->getMachineNode(Opcode, SL, Mem->
getVTList(), Ops);
1819 unsigned SubReg = Is32 ? AMDGPU::sub0 : AMDGPU::sub0_sub1;
1821 = CurDAG->getTargetExtractSubreg(SubReg, SL, VT,
SDValue(CmpSwap, 0));
1823 ReplaceUses(
SDValue(N, 0), Extract);
1825 CurDAG->RemoveDeadNode(N);
1829 unsigned &Mods)
const {
1846 bool AMDGPUDAGToDAGISel::SelectVOP3Mods(
SDValue In,
SDValue &Src,
1849 if (SelectVOP3ModsImpl(In, Src, Mods)) {
1850 SrcMods = CurDAG->getTargetConstant(Mods,
SDLoc(In),
MVT::i32);
1857 bool AMDGPUDAGToDAGISel::SelectVOP3Mods_NNaN(
SDValue In,
SDValue &Src,
1859 SelectVOP3Mods(In, Src, SrcMods);
1860 return isNoNanSrc(Src);
1863 bool AMDGPUDAGToDAGISel::SelectVOP3NoMods(
SDValue In,
SDValue &Src)
const {
1871 bool AMDGPUDAGToDAGISel::SelectVOP3Mods0(
SDValue In,
SDValue &Src,
1875 Clamp = CurDAG->getTargetConstant(0, DL,
MVT::i1);
1876 Omod = CurDAG->getTargetConstant(0, DL,
MVT::i1);
1878 return SelectVOP3Mods(In, Src, SrcMods);
1881 bool AMDGPUDAGToDAGISel::SelectVOP3Mods0Clamp0OMod(
SDValue In,
SDValue &Src,
1885 Clamp = Omod = CurDAG->getTargetConstant(0,
SDLoc(In),
MVT::i32);
1886 return SelectVOP3Mods(In, Src, SrcMods);
1889 bool AMDGPUDAGToDAGISel::SelectVOP3OMods(
SDValue In,
SDValue &Src,
1894 Clamp = CurDAG->getTargetConstant(0, DL,
MVT::i1);
1895 Omod = CurDAG->getTargetConstant(0, DL,
MVT::i1);
1913 if (ShiftAmt->getZExtValue() == 16) {
1935 bool AMDGPUDAGToDAGISel::SelectVOP3PMods(
SDValue In,
SDValue &Src,
1946 unsigned VecMods = Mods;
1970 if (Lo == Hi && !isInlineImmediate(Lo.
getNode())) {
1975 SrcMods = CurDAG->getTargetConstant(Mods,
SDLoc(In),
MVT::i32);
1985 SrcMods = CurDAG->getTargetConstant(Mods,
SDLoc(In),
MVT::i32);
1989 bool AMDGPUDAGToDAGISel::SelectVOP3PMods0(
SDValue In,
SDValue &Src,
1995 Clamp = CurDAG->getTargetConstant(0, SL,
MVT::i32);
1997 return SelectVOP3PMods(In, Src, SrcMods);
2000 bool AMDGPUDAGToDAGISel::SelectVOP3OpSel(
SDValue In,
SDValue &Src,
2004 SrcMods = CurDAG->getTargetConstant(0,
SDLoc(In),
MVT::i32);
2008 bool AMDGPUDAGToDAGISel::SelectVOP3OpSel0(
SDValue In,
SDValue &Src,
2014 Clamp = CurDAG->getTargetConstant(0, SL,
MVT::i32);
2016 return SelectVOP3OpSel(In, Src, SrcMods);
2019 bool AMDGPUDAGToDAGISel::SelectVOP3OpSelMods(
SDValue In,
SDValue &Src,
2022 return SelectVOP3Mods(In, Src, SrcMods);
2025 bool AMDGPUDAGToDAGISel::SelectVOP3OpSelMods0(
SDValue In,
SDValue &Src,
2031 Clamp = CurDAG->getTargetConstant(0, SL,
MVT::i32);
2033 return SelectVOP3OpSelMods(In, Src, SrcMods);
2038 bool AMDGPUDAGToDAGISel::SelectVOP3PMadMixModsImpl(
SDValue In,
SDValue &Src,
2039 unsigned &Mods)
const {
2041 SelectVOP3ModsImpl(In, Src, Mods);
2052 SelectVOP3ModsImpl(Src, Src, ModsTmp);
2057 if ((ModsTmp & SISrcMods::ABS) != 0)
2079 bool AMDGPUDAGToDAGISel::SelectVOP3PMadMixMods(
SDValue In,
SDValue &Src,
2082 SelectVOP3PMadMixModsImpl(In, Src, Mods);
2083 SrcMods = CurDAG->getTargetConstant(Mods,
SDLoc(In),
MVT::i32);
2088 bool AMDGPUDAGToDAGISel::SelectHi16Elt(
SDValue In,
SDValue &Src)
const {
2096 SDValue K = CurDAG->getTargetConstant(
C->getZExtValue() << 16, SL,
MVT::i32);
2097 MachineSDNode *MovK = CurDAG->getMachineNode(AMDGPU::V_MOV_B32_e32,
2105 SDValue K = CurDAG->getTargetConstant(
2106 C->getValueAPF().bitcastToAPInt().getZExtValue() << 16, SL,
MVT::i32);
2107 MachineSDNode *MovK = CurDAG->getMachineNode(AMDGPU::V_MOV_B32_e32,
2116 void AMDGPUDAGToDAGISel::PostprocessISelDAG() {
2119 bool IsModified =
false;
2125 while (Position != CurDAG->allnodes_end()) {
2126 SDNode *Node = &*Position++;
2132 if (ResNode != Node) {
2134 ReplaceUses(Node, ResNode);
2138 CurDAG->RemoveDeadNodes();
2139 }
while (IsModified);
2147 bool R600DAGToDAGISel::isConstantLoad(
const MemSDNode *N,
int CbId)
const {
2157 bool R600DAGToDAGISel::SelectGlobalValueConstantOffset(
SDValue Addr,
2160 IntPtr = CurDAG->getIntPtrConstant(Cst->getZExtValue() / 4,
SDLoc(Addr),
2167 bool R600DAGToDAGISel::SelectGlobalValueVariableOffset(
SDValue Addr,
2169 if (!isa<ConstantSDNode>(Addr)) {
2171 Offset = CurDAG->getIntPtrConstant(0,
SDLoc(Addr),
true);
2191 unsigned RegClassID;
2196 switch(NumVectorElts) {
2197 case 2: RegClassID = R600::R600_Reg64RegClassID;
break;
2200 RegClassID = R600::R600_Reg128VerticalRegClassID;
2202 RegClassID = R600::R600_Reg128RegClassID;
2206 SelectBuildVector(N, RegClassID);
2214 bool R600DAGToDAGISel::SelectADDRIndirect(
SDValue Addr,
SDValue &Base,
2219 if ((C = dyn_cast<ConstantSDNode>(Addr))) {
2220 Base = CurDAG->getRegister(R600::INDIRECT_BASE_ADDR,
MVT::i32);
2223 (C = dyn_cast<ConstantSDNode>(Addr.
getOperand(0)))) {
2224 Base = CurDAG->getRegister(R600::INDIRECT_BASE_ADDR,
MVT::i32);
2227 (C = dyn_cast<ConstantSDNode>(Addr.
getOperand(1)))) {
2232 Offset = CurDAG->getTargetConstant(0, DL,
MVT::i32);
2238 bool R600DAGToDAGISel::SelectADDRVTX_READ(
SDValue Addr,
SDValue &Base,
2244 &&
isInt<16>(IMMOffset->getZExtValue())) {
2247 Offset = CurDAG->getTargetConstant(IMMOffset->getZExtValue(),
SDLoc(Addr),
2251 }
else if ((IMMOffset = dyn_cast<ConstantSDNode>(Addr))
2252 &&
isInt<16>(IMMOffset->getZExtValue())) {
2253 Base = CurDAG->getCopyFromReg(CurDAG->getEntryNode(),
2254 SDLoc(CurDAG->getEntryNode()),
2256 Offset = CurDAG->getTargetConstant(IMMOffset->getZExtValue(),
SDLoc(Addr),
2263 Offset = CurDAG->getTargetConstant(0,
SDLoc(Addr),
MVT::i32);
unsigned getFrameOffsetReg() const
unsigned getScratchWaveOffsetReg() const
BITCAST - This operator converts between integer, vector and FP values, as if the value was stored to...
constexpr bool isUInt< 32 >(uint64_t x)
void push_back(const T &Elt)
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
static bool isExtractHiElt(SDValue In, SDValue &Out)
EVT getValueType() const
Return the ValueType of the referenced return value.
Interface definition for SIRegisterInfo.
static unsigned getSubRegFromChannel(unsigned Channel)
uint64_t getZExtValue() const
Get zero extended value.
static APInt getAllOnesValue(unsigned numBits)
Get the all-ones value.
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
AMDGPU specific subclass of TargetSubtarget.
const TargetRegisterClass * getRegClass(unsigned Reg) const
Return the register class of the specified virtual register.
Compute iterated dominance frontiers using a linear time algorithm.
void setMemRefs(mmo_iterator NewMemRefs, mmo_iterator NewMemRefsEnd)
Assign this MachineSDNodes's memory reference descriptor list.
uint64_t getDefaultRsrcDataFormat() const
FunctionPass * createR600ISelDag(TargetMachine *TM, CodeGenOpt::Level OptLevel)
This pass converts a legalized DAG into a R600-specific.
unsigned getStackPtrOffsetReg() const
SDValue copyToM0(SelectionDAG &DAG, SDValue Chain, const SDLoc &DL, SDValue V) const
Carry-setting nodes for multiple precision addition and subtraction.
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
Describe properties that are true of each instruction in the target description file.
static bool isVirtualRegister(unsigned Reg)
Return true if the specified register number is in the virtual register namespace.
SDVTList getVTList() const
AMDGPUAS getAMDGPUAS(const Module &M)
const SDValue & getChain() const
virtual SDNode * PostISelFolding(MachineSDNode *N, SelectionDAG &DAG) const =0
static bool getConstantValue(SDValue N, uint32_t &Out)
SDNode * legalizeTargetIndependentNode(SDNode *Node, SelectionDAG &DAG) const
Legalize target independent instructions (e.g.
constexpr bool isInt< 16 >(int64_t x)
unsigned const TargetRegisterInfo * TRI
MVT getSimpleValueType(unsigned ResNo) const
Return the type of a specified result as a simple type.
const SDNodeFlags getFlags() const
void setNodeId(int Id)
Set unique node id.
SDNode * getNode() const
get the SDNode which holds the desired result
MachineMemOperand * getMemOperand() const
Return a MachineMemOperand object describing the memory reference performed by operation.
bool isInlineConstant(const APInt &Imm) const
constexpr bool isMask_32(uint32_t Value)
Return true if the argument is a non-empty sequence of ones starting at the least significant bit wit...
bool hasOneUse() const
Return true if there is exactly one node using value ResNo of Node.
unsigned getAddressSpace() const
Return the address space for the associated pointer.
MachineSDNode * wrapAddr64Rsrc(SelectionDAG &DAG, const SDLoc &DL, SDValue Ptr) const
uint64_t alignDown(uint64_t Value, uint64_t Align, uint64_t Skew=0)
Returns the largest uint64_t less than or equal to Value and is Skew mod Align.
AnalysisUsage & addRequired()
#define INITIALIZE_PASS_DEPENDENCY(depName)
bool hasOneUse() const
Return true if there is exactly one use of this node.
A description of a memory reference used in the backend.
unsigned getNumOperands() const
Return the number of declared MachineOperands for this MachineInstruction.
OpenCL uses address spaces to differentiate between various memory regions on the hardware...
const HexagonInstrInfo * TII
Shift and rotation operations.
unsigned get32BitAddressHighBits() const
static bool EnableLateStructurizeCFG
BUILD_PAIR - This is the opposite of EXTRACT_ELEMENT in some ways.
CopyToReg - This node has three operands: a chain, a register number to set to this value...
Position
Position to insert a new instruction relative to an existing instruction.
This file implements a class to represent arbitrary precision integral constant values and operations...
This represents a list of ValueType's that has been intern'd by a SelectionDAG.
TargetRegisterInfo interface that is implemented by all hw codegen targets.
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
int64_t getSExtValue() const
unsigned getScalarSizeInBits() const
unsigned getSizeInBits() const
Return the size of the specified value type in bits.
Simple integer binary arithmetic operators.
MDNode * getMetadata(unsigned KindID) const
Get the metadata of given kind attached to this Instruction.
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out...
This node is for VLIW targets and it is used to represent a vector that is stored in consecutive regi...
BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a vector with the specified, possibly variable...
MVT getSimpleValueType() const
Return the simple ValueType of the referenced return value.
int64_t getSMRDEncodedOffset(const MCSubtargetInfo &ST, int64_t ByteOffset)
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
constexpr bool isUInt< 8 >(uint64_t x)
unsigned const MachineRegisterInfo * MRI
LLVM Basic Block Representation.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
unsigned getVectorNumElements() const
Given a vector type, return the number of elements it contains.
PointerUnion< const Value *, const PseudoSourceValue * > V
This is the IR pointer value for the access, or it is null if unknown.
This is an important base class in LLVM.
const SDValue & getOperand(unsigned Num) const
Carry-using nodes for multiple precision addition and subtraction.
SI DAG Lowering interface definition.
Represent the analysis usage information of a pass.
INITIALIZE_PASS_BEGIN(AMDGPUDAGToDAGISel, "isel", "AMDGPU DAG->DAG Pattern Instruction Selection", false, false) INITIALIZE_PASS_END(AMDGPUDAGToDAGISel
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
FunctionPass class - This class is used to implement most global optimizations.
const R600RegisterInfo & getRegisterInfo() const
bool isDefined() const
Returns true if the flags are in a defined state.
AMDGPU DAG DAG Pattern Instruction Selection
The AMDGPU TargetMachine interface definition for hw codgen targets.
FunctionPass * createAMDGPUISelDag(TargetMachine *TM=nullptr, CodeGenOpt::Level OptLevel=CodeGenOpt::Default)
This pass converts a legalized DAG into a AMDGPU-specific.
X = FP_EXTEND(Y) - Extend a smaller FP type into a larger FP type.
bool isLegalSMRDImmOffset(const MCSubtargetInfo &ST, int64_t ByteOffset)
T dyn_cast() const
Returns the current pointer if it is of the specified pointer type, otherwises returns null...
This class contains a discriminated union of information about pointers in memory operands...
bool isMachineOpcode() const
Test if this node has a post-isel opcode, directly corresponding to a MachineInstr opcode...
unsigned getNumOperands() const
Return the number of values used by this operation.
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE, "Assign register bank of generic virtual registers", false, false) RegBankSelect
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static unsigned selectSGPRVectorRegClassID(unsigned NumVectorElts)
MachineSDNode * buildRSRC(SelectionDAG &DAG, const SDLoc &DL, SDValue Ptr, uint32_t RsrcDword1, uint64_t RsrcDword2And3) const
Return a resource descriptor with the 'Add TID' bit enabled The TID (Thread ID) is multiplied by the ...
Iterator for intrusive lists based on ilist_node.
unsigned countPopulation(T Value)
Count the number of set bits in a value.
EVT getVectorElementType() const
Given a vector type, return the type of each element.
Interface definition of the TargetLowering class that is common to all AMD GPUs.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
unsigned getScratchRSrcReg() const
Returns the physical register reserved for use as the resource descriptor for scratch accesses...
BRCOND - Conditional branch.
An SDNode that represents everything that will be needed to construct a MachineInstr.
This is an abstract virtual class for memory operations.
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
unsigned getNumDefs() const
Return the number of MachineOperands that are register definitions.
Represents one node in the SelectionDAG.
SelectionDAGISel - This is the common base class used for SelectionDAG-based pattern-matching instruc...
Special value supplied for machine level alias analysis.
static unsigned getReg(const void *D, unsigned RC, unsigned RegNo)
static bool isStackPtrRelative(const MachinePointerInfo &PtrInfo)
static SDValue stripExtractLoElt(SDValue In)
Contains the definition of a TargetInstrInfo class that is common to all AMD GPUs.
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
Provides AMDGPU specific target descriptions.
This class keeps track of the SPI_SP_INPUT_ADDR config register, which tells the hardware which inter...
Interface definition for SIInstrInfo.
Bitwise operators - logical and, logical or, logical xor.
int16_t RegClass
This specifies the register class enumeration of the operand if the operand is a register.
SIGN_EXTEND_INREG - This operator atomically performs a SHL/SRA pair to sign extend a small value in ...
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
unsigned getOpcode() const
SDValue getValue(unsigned R) const
constexpr bool isUInt< 16 >(uint64_t x)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static bool isLegalMUBUFImmOffset(unsigned Imm)
FMA - Perform a * b + c with no intermediate rounding step.
unsigned getMachineOpcode() const
This may only be called if isMachineOpcode returns true.
const TargetRegisterClass * getPhysRegClass(unsigned Reg) const
Return the 'base' register class for this register.
const MCOperandInfo * OpInfo
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
Primary interface to the complete machine description for the target machine.
static SDValue stripBitcast(SDValue Val)
StringRef - Represent a constant reference to a string, i.e.
FMAD - Perform a * b + c, while getting the same result as the separately rounded operations...
SetCC operator - This evaluates to a true value iff the condition is true.
bool bitsEq(EVT VT) const
Return true if this has the same number of bits as VT.
const SDValue & getOperand(unsigned i) const
const TerminatorInst * getTerminator() const LLVM_READONLY
Returns the terminator instruction if the block is well formed or null if the block is not well forme...
OUTCHAIN = ATOMIC_STORE(INCHAIN, ptr, val) This corresponds to "store atomic" instruction.
uint64_t getZExtValue() const
TRUNCATE - Completely drop the high bits.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
FNEG, FABS, FSQRT, FSIN, FCOS, FPOWI, FPOW, FLOG, FLOG2, FLOG10, FEXP, FEXP2, FCEIL, FTRUNC, FRINT, FNEARBYINT, FROUND, FFLOOR - Perform various unary floating point operations.
Analyzes if a function potentially memory bound and if a kernel kernel may benefit from limiting numb...
MachineInstr::mmo_iterator allocateMemRefsArray(unsigned long Num)
allocateMemRefsArray - Allocate an array to hold MachineMemOperand pointers.
Val, OUTCHAIN = ATOMIC_LOAD(INCHAIN, ptr) This corresponds to "load atomic" instruction.
const SDValue & getBasePtr() const
SCALAR_TO_VECTOR(VAL) - This represents the operation of loading a scalar value into element 0 of the...
constexpr char Args[]
Key for Kernel::Metadata::mArgs.