17 #define _USE_MATH_DEFINES
87 "amdgpu-vgpr-index-mode",
88 cl::desc(
"Use GPR indexing mode instead of movrel for vector indexing"),
92 unsigned NumSGPRs = AMDGPU::SGPR_32RegClass.getNumRegs();
93 for (
unsigned Reg = 0;
Reg < NumSGPRs; ++
Reg) {
95 return AMDGPU::SGPR0 +
Reg;
540 unsigned IntrID)
const {
542 case Intrinsic::amdgcn_atomic_inc:
543 case Intrinsic::amdgcn_atomic_dec: {
562 Type *&AccessTy)
const {
564 case Intrinsic::amdgcn_atomic_inc:
565 case Intrinsic::amdgcn_atomic_dec: {
576 bool SITargetLowering::isLegalFlatAddressingMode(
const AddrMode &AM)
const {
580 return AM.BaseOffs == 0 && AM.Scale == 0;
587 return isUInt<12>(AM.BaseOffs) && AM.Scale == 0;
590 bool SITargetLowering::isLegalMUBUFAddressingMode(
const AddrMode &AM)
const {
600 if (!isUInt<12>(AM.BaseOffs))
643 return isLegalFlatAddressingMode(AM);
646 return isLegalMUBUFAddressingMode(AM);
652 return isLegalMUBUFAddressingMode(AM);
659 return isLegalMUBUFAddressingMode(AM);
686 return isLegalMUBUFAddressingMode(AM);
710 return isLegalFlatAddressingMode(AM);
732 bool *IsFast)
const {
750 bool AlignedBy4 = (Align % 4 == 0);
752 *IsFast = AlignedBy4;
771 (Align % 4 == 0) :
true;
791 unsigned SrcAlign,
bool IsMemset,
800 if (Size >= 16 && DstAlign >= 4)
803 if (Size >= 8 && DstAlign >= 4)
817 unsigned DestAS)
const {
823 const MemSDNode *MemNode = cast<MemSDNode>(
N);
830 unsigned DestAS)
const {
840 const MemSDNode *MemNode = cast<MemSDNode>(
N);
914 Val = getFPExtOrFPTrunc(DAG, Val, SL, VT);
923 SDValue SITargetLowering::lowerKernargMemParameter(
926 uint64_t Offset,
bool Signed,
935 SDValue Ptr = lowerKernArgParameterPtr(DAG, SL, Chain, Offset);
941 SDValue Val = convertArgType(DAG, VT, MemVT, SL, Load, Signed, Arg);
988 ExtType, SL, VA.
getLocVT(), Chain, FIN,
1000 for (
unsigned I = 0,
E = Ins.
size(), PSInputNum = 0;
I !=
E; ++
I) {
1033 for (
unsigned J = 0; J != NumElements; ++J) {
1050 MF.
addLiveIn(Reg, &AMDGPU::VGPR_32RegClass);
1056 MF.
addLiveIn(Reg, &AMDGPU::VGPR_32RegClass);
1062 MF.
addLiveIn(Reg, &AMDGPU::VGPR_32RegClass);
1074 MF.
addLiveIn(ImplicitBufferPtrReg, &AMDGPU::SGPR_64RegClass);
1081 MF.
addLiveIn(PrivateSegmentBufferReg, &AMDGPU::SGPR_128RegClass);
1087 MF.
addLiveIn(DispatchPtrReg, &AMDGPU::SGPR_64RegClass);
1093 MF.
addLiveIn(QueuePtrReg, &AMDGPU::SGPR_64RegClass);
1099 MF.
addLiveIn(InputPtrReg, &AMDGPU::SGPR_64RegClass);
1105 MF.
addLiveIn(DispatchIDReg, &AMDGPU::SGPR_64RegClass);
1111 MF.
addLiveIn(FlatScratchInitReg, &AMDGPU::SGPR_64RegClass);
1127 MF.
addLiveIn(Reg, &AMDGPU::SReg_32_XM0RegClass);
1133 MF.
addLiveIn(Reg, &AMDGPU::SReg_32_XM0RegClass);
1139 MF.
addLiveIn(Reg, &AMDGPU::SReg_32_XM0RegClass);
1145 MF.
addLiveIn(Reg, &AMDGPU::SReg_32_XM0RegClass);
1151 unsigned PrivateSegmentWaveByteOffsetReg;
1154 PrivateSegmentWaveByteOffsetReg =
1159 if (PrivateSegmentWaveByteOffsetReg == AMDGPU::NoRegister) {
1166 MF.
addLiveIn(PrivateSegmentWaveByteOffsetReg, &AMDGPU::SGPR_32RegClass);
1167 CCInfo.
AllocateReg(PrivateSegmentWaveByteOffsetReg);
1182 if (HasStackObjects)
1188 HasStackObjects =
true;
1192 if (HasStackObjects) {
1205 unsigned ReservedBufferReg
1207 unsigned ReservedOffsetReg
1226 if (HasStackObjects) {
1231 unsigned ReservedOffsetReg
1252 *Fn,
"unsupported non-compute shaders with HSA", DL.
getDebugLoc());
1259 if (ST.debuggerEmitPrologue())
1260 createDebuggerPrologueStackObjects(MF);
1292 CCInfo.AllocateReg(AMDGPU::VGPR0);
1293 CCInfo.AllocateReg(AMDGPU::VGPR1);
1304 }
else if (IsKernel) {
1319 CCInfo.AnalyzeFormalArguments(Splits, AssignFn);
1324 for (
unsigned i = 0, e = Ins.
size(), ArgIdx = 0; i != e; ++i) {
1334 if (IsEntryFunc && VA.
isMemLoc()) {
1344 SDValue Arg = lowerKernargMemParameter(
1345 DAG, VT, MemVT, DL, Chain, Offset, Ins[i].
Flags.isSExt(), &Ins[i]);
1361 }
else if (!IsEntryFunc && VA.
isMemLoc()) {
1362 SDValue Val = lowerStackParameter(DAG, VA, DL, Chain, Arg);
1411 for (
unsigned j = 1; j != NumElements; ++j) {
1412 Reg = ArgLocs[ArgIdx++].getLocReg();
1439 return Chains.
empty() ? Chain :
1457 CCState CCInfo(CallConv, IsVarArg, MF, RVLocs, Context);
1484 for (
unsigned i = 0, e = Outs.
size(); i != e; ++i) {
1497 for (
unsigned j = 0; j != NumElements; ++j) {
1536 Chain = DAG.
getCopyToReg(Chain, DL, PhysReturnAddrReg, ReturnAddrReg, Flag);
1543 for (
unsigned i = 0, realRVLocIdx = 0;
1545 ++i, ++realRVLocIdx) {
1550 SDValue Arg = SplitVals[realRVLocIdx];
1593 .Case(
"m0", AMDGPU::M0)
1594 .
Case(
"exec", AMDGPU::EXEC)
1595 .
Case(
"exec_lo", AMDGPU::EXEC_LO)
1596 .
Case(
"exec_hi", AMDGPU::EXEC_HI)
1597 .
Case(
"flat_scratch", AMDGPU::FLAT_SCR)
1598 .
Case(
"flat_scratch_lo", AMDGPU::FLAT_SCR_LO)
1599 .
Case(
"flat_scratch_hi", AMDGPU::FLAT_SCR_HI)
1602 if (Reg == AMDGPU::NoRegister) {
1611 +
StringRef(RegName) +
"\" for subtarget."));
1616 case AMDGPU::EXEC_LO:
1617 case AMDGPU::EXEC_HI:
1618 case AMDGPU::FLAT_SCR_LO:
1619 case AMDGPU::FLAT_SCR_HI:
1624 case AMDGPU::FLAT_SCR:
1645 if (SplitPoint == BB->
end()) {
1647 MI.
setDesc(TII->get(AMDGPU::SI_KILL_TERMINATOR));
1661 MI.
setDesc(TII->get(AMDGPU::SI_KILL_TERMINATOR));
1680 unsigned InitSaveExecReg,
1682 bool UseGPRIdxMode) {
1690 BuildMI(LoopBB, I, DL, TII->get(TargetOpcode::PHI), PhiReg)
1696 BuildMI(LoopBB, I, DL, TII->get(TargetOpcode::PHI), PhiExec)
1697 .addReg(InitSaveExecReg)
1703 BuildMI(LoopBB, I, DL, TII->get(AMDGPU::V_READFIRSTLANE_B32), CurrentIdxReg)
1707 BuildMI(LoopBB, I, DL, TII->get(AMDGPU::V_CMP_EQ_U32_e64), CondReg)
1708 .addReg(CurrentIdxReg)
1711 if (UseGPRIdxMode) {
1714 IdxReg = CurrentIdxReg;
1717 BuildMI(LoopBB, I, DL, TII->get(AMDGPU::S_ADD_I32), IdxReg)
1723 BuildMI(LoopBB, I, DL, TII->get(AMDGPU::S_SET_GPR_IDX_IDX))
1729 BuildMI(LoopBB, I, DL, TII->get(AMDGPU::S_MOV_B32), AMDGPU::M0)
1732 BuildMI(LoopBB, I, DL, TII->get(AMDGPU::S_ADD_I32), AMDGPU::M0)
1739 BuildMI(LoopBB, I, DL, TII->get(AMDGPU::S_AND_SAVEEXEC_B64), NewExec)
1746 BuildMI(LoopBB, I, DL, TII->get(AMDGPU::S_XOR_B64), AMDGPU::EXEC)
1747 .addReg(AMDGPU::EXEC)
1754 BuildMI(LoopBB, I, DL, TII->get(AMDGPU::S_CBRANCH_EXECNZ))
1768 unsigned InitResultReg,
1771 bool UseGPRIdxMode) {
1781 BuildMI(MBB, I, DL, TII->get(TargetOpcode::IMPLICIT_DEF), TmpExec);
1784 BuildMI(MBB, I, DL, TII->get(AMDGPU::S_MOV_B64), SaveExec)
1785 .addReg(AMDGPU::EXEC);
1794 MF->
insert(MBBI, LoopBB);
1795 MF->
insert(MBBI, RemainderBB);
1809 InitResultReg, DstReg, PhiReg, TmpExec,
1810 Offset, UseGPRIdxMode);
1813 BuildMI(*RemainderBB, First, DL, TII->get(AMDGPU::S_MOV_B64), AMDGPU::EXEC)
1820 static std::pair<unsigned, int>
1825 int NumElts = TRI.getRegSizeInBits(*SuperRC) / 32;
1829 if (Offset >= NumElts || Offset < 0)
1830 return std::make_pair(AMDGPU::sub0, Offset);
1832 return std::make_pair(AMDGPU::sub0 + Offset, 0);
1841 bool IsIndirectSrc) {
1854 if (UseGPRIdxMode) {
1855 unsigned IdxMode = IsIndirectSrc ?
1859 BuildMI(*MBB, I, DL, TII->get(AMDGPU::S_SET_GPR_IDX_ON))
1866 BuildMI(*MBB, I, DL, TII->get(AMDGPU::S_ADD_I32), Tmp)
1870 BuildMI(*MBB, I, DL, TII->get(AMDGPU::S_SET_GPR_IDX_ON))
1881 BuildMI(*MBB, I, DL, TII->get(AMDGPU::S_MOV_B32), AMDGPU::M0)
1884 BuildMI(*MBB, I, DL, TII->get(AMDGPU::S_ADD_I32), AMDGPU::M0)
1908 std::tie(SubReg, Offset)
1917 if (UseGPRIdxMode) {
1921 BuildMI(MBB, I, DL, TII->get(AMDGPU::V_MOV_B32_e32), Dst)
1925 BuildMI(MBB, I, DL, TII->get(AMDGPU::S_SET_GPR_IDX_OFF));
1927 BuildMI(MBB, I, DL, TII->get(AMDGPU::V_MOVRELS_B32_e32), Dst)
1943 BuildMI(MBB, I, DL, TII->get(TargetOpcode::IMPLICIT_DEF), InitReg);
1945 if (UseGPRIdxMode) {
1952 BuildMI(MBB, std::next(I), DL, TII->get(AMDGPU::S_SET_GPR_IDX_OFF));
1955 auto InsPt =
loadM0FromVGPR(TII, MBB, MI, InitReg, PhiReg, Offset, UseGPRIdxMode);
1958 if (UseGPRIdxMode) {
1959 BuildMI(*LoopBB, InsPt, DL, TII->get(AMDGPU::V_MOV_B32_e32), Dst)
1964 BuildMI(*LoopBB, InsPt, DL, TII->get(AMDGPU::V_MOVRELS_B32_e32), Dst)
1976 switch (TRI.getRegSizeInBits(*VecRC)) {
1978 return AMDGPU::V_MOVRELD_B32_V1;
1980 return AMDGPU::V_MOVRELD_B32_V2;
1982 return AMDGPU::V_MOVRELD_B32_V4;
1984 return AMDGPU::V_MOVRELD_B32_V8;
1986 return AMDGPU::V_MOVRELD_B32_V16;
2016 if (Idx->
getReg() == AMDGPU::NoRegister) {
2022 BuildMI(MBB, I, DL, TII->get(TargetOpcode::INSERT_SUBREG), Dst)
2035 if (UseGPRIdxMode) {
2036 BuildMI(MBB, I, DL, TII->get(AMDGPU::V_MOV_B32_indirect))
2043 BuildMI(MBB, I, DL, TII->get(AMDGPU::S_SET_GPR_IDX_OFF));
2047 BuildMI(MBB, I, DL, MovRelDesc)
2051 .addImm(SubReg - AMDGPU::sub0);
2063 if (UseGPRIdxMode) {
2072 BuildMI(MBB, std::next(I), DL, TII->get(AMDGPU::S_SET_GPR_IDX_OFF));
2081 if (UseGPRIdxMode) {
2082 BuildMI(*LoopBB, InsPt, DL, TII->get(AMDGPU::V_MOV_B32_indirect))
2091 BuildMI(*LoopBB, InsPt, DL, MovRelDesc)
2095 .
addImm(SubReg - AMDGPU::sub0);
2130 case AMDGPU::SI_INIT_M0:
2132 TII->get(AMDGPU::S_MOV_B32), AMDGPU::M0)
2137 case AMDGPU::SI_INIT_EXEC:
2145 case AMDGPU::SI_INIT_EXEC_FROM_INPUT: {
2161 if (
I->getOpcode() != TargetOpcode::COPY ||
2162 I->getOperand(0).getReg() != InputReg)
2166 FirstMI = &*++BB->
begin();
2168 I->removeFromParent();
2178 BuildMI(*BB, FirstMI,
DebugLoc(), TII->get(AMDGPU::S_BFE_U32), CountReg)
2195 case AMDGPU::GET_GROUPSTATICSIZE: {
2197 BuildMI(*BB, MI, DL, TII->get(AMDGPU::S_MOV_B32))
2203 case AMDGPU::SI_INDIRECT_SRC_V1:
2204 case AMDGPU::SI_INDIRECT_SRC_V2:
2205 case AMDGPU::SI_INDIRECT_SRC_V4:
2206 case AMDGPU::SI_INDIRECT_SRC_V8:
2207 case AMDGPU::SI_INDIRECT_SRC_V16:
2209 case AMDGPU::SI_INDIRECT_DST_V1:
2210 case AMDGPU::SI_INDIRECT_DST_V2:
2211 case AMDGPU::SI_INDIRECT_DST_V4:
2212 case AMDGPU::SI_INDIRECT_DST_V8:
2213 case AMDGPU::SI_INDIRECT_DST_V16:
2215 case AMDGPU::SI_KILL:
2217 case AMDGPU::V_CNDMASK_B64_PSEUDO: {
2229 BuildMI(*BB, MI, DL, TII->get(AMDGPU::V_CNDMASK_B32_e64), DstLo)
2230 .addReg(Src0, 0, AMDGPU::sub0)
2231 .
addReg(Src1, 0, AMDGPU::sub0)
2233 BuildMI(*BB, MI, DL, TII->get(AMDGPU::V_CNDMASK_B32_e64), DstHi)
2234 .addReg(Src0, 0, AMDGPU::sub1)
2235 .
addReg(Src1, 0, AMDGPU::sub1)
2238 BuildMI(*BB, MI, DL, TII->get(AMDGPU::REG_SEQUENCE), Dst)
2246 case AMDGPU::SI_BR_UNDEF: {
2330 SDValue Result = LowerLOAD(Op, DAG);
2333 "Load should return a value and a chain");
2339 return LowerTrig(Op, DAG);
2341 case ISD::FDIV:
return LowerFDIV(Op, DAG);
2347 return LowerGlobalAddress(MFI, Op, DAG);
2354 return lowerINSERT_VECTOR_ELT(Op, DAG);
2356 return lowerEXTRACT_VECTOR_ELT(Op, DAG);
2358 return lowerFP_ROUND(Op, DAG);
2362 return lowerTRAP(Op, DAG);
2382 unsigned IID = cast<ConstantSDNode>(N->
getOperand(0))->getZExtValue();
2383 if (IID == Intrinsic::amdgcn_cvt_pkrtz) {
2401 EVT SelectVT = NewVT;
2411 if (NewVT != SelectVT)
2428 if (
I.getUse().get() != Value)
2431 if (
I->getOpcode() == Opcode)
2437 unsigned SITargetLowering::isCFIntrinsic(
const SDNode *Intr)
const {
2439 switch (cast<ConstantSDNode>(Intr->
getOperand(1))->getZExtValue()) {
2440 case Intrinsic::amdgcn_if:
2442 case Intrinsic::amdgcn_else:
2444 case Intrinsic::amdgcn_loop:
2446 case Intrinsic::amdgcn_end_cf:
2458 void SITargetLowering::createDebuggerPrologueStackObjects(
2474 for (
unsigned i = 0; i < 3; ++i) {
2484 bool SITargetLowering::shouldEmitFixup(
const GlobalValue *GV)
const {
2490 bool SITargetLowering::shouldEmitGOTReloc(
const GlobalValue *GV)
const {
2493 !shouldEmitFixup(GV) &&
2497 bool SITargetLowering::shouldEmitPCReloc(
const GlobalValue *GV)
const {
2498 return !shouldEmitFixup(GV) && !shouldEmitGOTReloc(GV);
2530 unsigned CFNode = isCFIntrinsic(Intr);
2580 for (
unsigned i = 1, e = Intr->
getNumValues() - 1; i != e; ++i) {
2613 "Do not know how to custom lower FP_ROUND for non-f16 type");
2616 EVT SrcVT = Src.getValueType();
2639 assert(UserSGPR != AMDGPU::NoRegister);
2642 DAG, &AMDGPU::SReg_64RegClass, UserSGPR,
MVT::i64);
2664 "debugtrap handler not supported",
2678 SDValue SITargetLowering::getSegmentAperture(
unsigned AS,
const SDLoc &DL,
2703 assert(UserSGPR != AMDGPU::NoRegister);
2706 DAG, &AMDGPU::SReg_64RegClass, UserSGPR,
MVT::i64);
2751 NonNull, Ptr, SegmentNullPtr);
2790 if (isa<ConstantSDNode>(Idx))
2833 if (
SDValue Combined = performExtractVectorEltCombine(Op.
getNode(), DCI))
2836 if (
const ConstantSDNode *CIdx = dyn_cast<ConstantSDNode>(Idx)) {
2839 if (CIdx->getZExtValue() == 1) {
2843 assert(CIdx->getZExtValue() == 0);
2876 const SDLoc &DL,
unsigned Offset,
EVT PtrVT,
2912 GAFlags : GAFlags + 1);
2929 if (shouldEmitFixup(GV))
2931 else if (shouldEmitPCReloc(GV))
2969 unsigned Offset)
const {
2981 "non-hsa intrinsic with hsa target",
2990 "intrinsic not supported on subtarget",
3004 unsigned IntrinsicID = cast<ConstantSDNode>(Op.
getOperand(0))->getZExtValue();
3008 switch (IntrinsicID) {
3009 case Intrinsic::amdgcn_implicit_buffer_ptr: {
3013 unsigned Reg = TRI->getPreloadedValue(MF,
3017 case Intrinsic::amdgcn_dispatch_ptr:
3018 case Intrinsic::amdgcn_queue_ptr: {
3021 *MF.
getFunction(),
"unsupported hsa intrinsic without hsa target",
3027 auto Reg = IntrinsicID == Intrinsic::amdgcn_dispatch_ptr ?
3030 TRI->getPreloadedValue(MF, Reg), VT);
3032 case Intrinsic::amdgcn_implicitarg_ptr: {
3034 return lowerKernArgParameterPtr(DAG, DL, DAG.
getEntryNode(), offset);
3036 case Intrinsic::amdgcn_kernarg_segment_ptr: {
3041 case Intrinsic::amdgcn_dispatch_id: {
3045 case Intrinsic::amdgcn_rcp:
3047 case Intrinsic::amdgcn_rsq:
3049 case Intrinsic::amdgcn_rsq_legacy:
3054 case Intrinsic::amdgcn_rcp_legacy:
3058 case Intrinsic::amdgcn_rsq_clamp: {
3072 case Intrinsic::r600_read_ngroups_x:
3076 return lowerKernargMemParameter(DAG, VT, VT, DL, DAG.
getEntryNode(),
3078 case Intrinsic::r600_read_ngroups_y:
3082 return lowerKernargMemParameter(DAG, VT, VT, DL, DAG.
getEntryNode(),
3084 case Intrinsic::r600_read_ngroups_z:
3088 return lowerKernargMemParameter(DAG, VT, VT, DL, DAG.
getEntryNode(),
3090 case Intrinsic::r600_read_global_size_x:
3094 return lowerKernargMemParameter(DAG, VT, VT, DL, DAG.
getEntryNode(),
3096 case Intrinsic::r600_read_global_size_y:
3100 return lowerKernargMemParameter(DAG, VT, VT, DL, DAG.
getEntryNode(),
3102 case Intrinsic::r600_read_global_size_z:
3106 return lowerKernargMemParameter(DAG, VT, VT, DL, DAG.
getEntryNode(),
3108 case Intrinsic::r600_read_local_size_x:
3112 return lowerImplicitZextParam(DAG, Op,
MVT::i16,
3114 case Intrinsic::r600_read_local_size_y:
3118 return lowerImplicitZextParam(DAG, Op,
MVT::i16,
3120 case Intrinsic::r600_read_local_size_z:
3124 return lowerImplicitZextParam(DAG, Op,
MVT::i16,
3126 case Intrinsic::amdgcn_workgroup_id_x:
3127 case Intrinsic::r600_read_tgid_x:
3130 case Intrinsic::amdgcn_workgroup_id_y:
3131 case Intrinsic::r600_read_tgid_y:
3134 case Intrinsic::amdgcn_workgroup_id_z:
3135 case Intrinsic::r600_read_tgid_z:
3138 case Intrinsic::amdgcn_workitem_id_x:
3139 case Intrinsic::r600_read_tidig_x:
3142 case Intrinsic::amdgcn_workitem_id_y:
3143 case Intrinsic::r600_read_tidig_y:
3146 case Intrinsic::amdgcn_workitem_id_z:
3147 case Intrinsic::r600_read_tidig_z:
3150 case AMDGPUIntrinsic::SI_load_const: {
3164 case Intrinsic::amdgcn_fdiv_fast:
3165 return lowerFDIV_FAST(Op, DAG);
3166 case Intrinsic::amdgcn_interp_mov: {
3172 case Intrinsic::amdgcn_interp_p1: {
3178 case Intrinsic::amdgcn_interp_p2: {
3185 case Intrinsic::amdgcn_sin:
3188 case Intrinsic::amdgcn_cos:
3191 case Intrinsic::amdgcn_log_clamp: {
3196 *MF.
getFunction(),
"intrinsic not supported on subtarget",
3201 case Intrinsic::amdgcn_ldexp:
3205 case Intrinsic::amdgcn_fract:
3208 case Intrinsic::amdgcn_class:
3211 case Intrinsic::amdgcn_div_fmas:
3216 case Intrinsic::amdgcn_div_fixup:
3220 case Intrinsic::amdgcn_trig_preop:
3223 case Intrinsic::amdgcn_div_scale: {
3242 Denominator, Numerator);
3244 case Intrinsic::amdgcn_icmp: {
3250 if (CondCode < ICmpInst::Predicate::FIRST_ICMP_PREDICATE ||
3251 CondCode > ICmpInst::Predicate::LAST_ICMP_PREDICATE)
3259 case Intrinsic::amdgcn_fcmp: {
3264 int CondCode = CD->getSExtValue();
3265 if (CondCode < FCmpInst::Predicate::FIRST_FCMP_PREDICATE ||
3266 CondCode > FCmpInst::Predicate::LAST_FCMP_PREDICATE)
3274 case Intrinsic::amdgcn_fmed3:
3277 case Intrinsic::amdgcn_fmul_legacy:
3280 case Intrinsic::amdgcn_sffbh:
3282 case Intrinsic::amdgcn_sbfe:
3285 case Intrinsic::amdgcn_ubfe:
3288 case Intrinsic::amdgcn_cvt_pkrtz: {
3302 unsigned IntrID = cast<ConstantSDNode>(Op.
getOperand(1))->getZExtValue();
3307 case Intrinsic::amdgcn_atomic_inc:
3308 case Intrinsic::amdgcn_atomic_dec: {
3310 unsigned Opc = (IntrID == Intrinsic::amdgcn_atomic_inc) ?
3321 case Intrinsic::amdgcn_buffer_load:
3322 case Intrinsic::amdgcn_buffer_load_format: {
3333 unsigned Opc = (IntrID == Intrinsic::amdgcn_buffer_load) ?
3345 case Intrinsic::amdgcn_tbuffer_load: {
3369 case Intrinsic::amdgcn_image_sample:
3370 case Intrinsic::amdgcn_image_sample_cl:
3371 case Intrinsic::amdgcn_image_sample_d:
3372 case Intrinsic::amdgcn_image_sample_d_cl:
3373 case Intrinsic::amdgcn_image_sample_l:
3374 case Intrinsic::amdgcn_image_sample_b:
3375 case Intrinsic::amdgcn_image_sample_b_cl:
3376 case Intrinsic::amdgcn_image_sample_lz:
3377 case Intrinsic::amdgcn_image_sample_cd:
3378 case Intrinsic::amdgcn_image_sample_cd_cl:
3381 case Intrinsic::amdgcn_image_sample_c:
3382 case Intrinsic::amdgcn_image_sample_c_cl:
3383 case Intrinsic::amdgcn_image_sample_c_d:
3384 case Intrinsic::amdgcn_image_sample_c_d_cl:
3385 case Intrinsic::amdgcn_image_sample_c_l:
3386 case Intrinsic::amdgcn_image_sample_c_b:
3387 case Intrinsic::amdgcn_image_sample_c_b_cl:
3388 case Intrinsic::amdgcn_image_sample_c_lz:
3389 case Intrinsic::amdgcn_image_sample_c_cd:
3390 case Intrinsic::amdgcn_image_sample_c_cd_cl:
3393 case Intrinsic::amdgcn_image_sample_o:
3394 case Intrinsic::amdgcn_image_sample_cl_o:
3395 case Intrinsic::amdgcn_image_sample_d_o:
3396 case Intrinsic::amdgcn_image_sample_d_cl_o:
3397 case Intrinsic::amdgcn_image_sample_l_o:
3398 case Intrinsic::amdgcn_image_sample_b_o:
3399 case Intrinsic::amdgcn_image_sample_b_cl_o:
3400 case Intrinsic::amdgcn_image_sample_lz_o:
3401 case Intrinsic::amdgcn_image_sample_cd_o:
3402 case Intrinsic::amdgcn_image_sample_cd_cl_o:
3405 case Intrinsic::amdgcn_image_sample_c_o:
3406 case Intrinsic::amdgcn_image_sample_c_cl_o:
3407 case Intrinsic::amdgcn_image_sample_c_d_o:
3408 case Intrinsic::amdgcn_image_sample_c_d_cl_o:
3409 case Intrinsic::amdgcn_image_sample_c_l_o:
3410 case Intrinsic::amdgcn_image_sample_c_b_o:
3411 case Intrinsic::amdgcn_image_sample_c_b_cl_o:
3412 case Intrinsic::amdgcn_image_sample_c_lz_o:
3413 case Intrinsic::amdgcn_image_sample_c_cd_o:
3414 case Intrinsic::amdgcn_image_sample_c_cd_cl_o:
3416 case Intrinsic::amdgcn_image_getlod: {
3435 unsigned IntrinsicID = cast<ConstantSDNode>(Op.
getOperand(1))->getZExtValue();
3438 switch (IntrinsicID) {
3439 case Intrinsic::amdgcn_exp: {
3457 unsigned Opc = Done->isNullValue() ?
3461 case Intrinsic::amdgcn_exp_compr: {
3486 case Intrinsic::amdgcn_s_sendmsg:
3487 case Intrinsic::amdgcn_s_sendmsghalt: {
3488 unsigned NodeOp = (IntrinsicID == Intrinsic::amdgcn_s_sendmsg) ?
3495 case Intrinsic::amdgcn_init_exec: {
3499 case Intrinsic::amdgcn_init_exec_from_input: {
3503 case AMDGPUIntrinsic::AMDGPU_kill: {
3506 if (!K->isNegative())
3516 case Intrinsic::amdgcn_s_barrier: {
3526 case AMDGPUIntrinsic::SI_tbuffer_store: {
3536 "Legacy intrinsic doesn't support both offset and index - use new version");
3561 "Value of tfe other than zero is unsupported");
3567 VT.getStoreSize(), 4);
3572 case Intrinsic::amdgcn_tbuffer_store: {
3617 BasePtr, RealMemVT, MMO);
3631 "Custom lowering for non-i32 vectors hasn't been implemented.");
3669 if (NumElements > 4)
3682 if (NumElements > 2)
3687 if (NumElements > 4)
3694 if (NumElements > 2)
3697 if (NumElements == 2)
3750 if (CLHS->isExactlyValue(1.0)) {
3770 if (CLHS->isExactlyValue(-1.0)) {
3791 return DAG.
getNode(Opcode, SL, VT, A, B);
3812 return DAG.
getNode(Opcode, SL, VT, A, B, C);
3830 if (
SDValue FastLowered = lowerFastUnsafeFDIV(Op, DAG))
3884 if (
SDValue FastLowered = lowerFastUnsafeFDIV(Op, DAG))
3908 (1 << AMDGPU::Hwreg::WIDTH_M1_SHIFT_);
3918 EnableDenormValue, BitField);
3929 ApproxRcp, One, NegDivScale0);
3938 NumeratorScaled, Mul);
3943 NumeratorScaled, Fma3);
3946 const SDValue DisableDenormValue =
3955 DisableDenorm, DAG.
getRoot());
3961 Fma4, Fma1, Fma3, Scale);
3968 return lowerFastUnsafeFDIV(Op, DAG);
3996 NegDivScale0, Mul, DivScale1);
4028 Fma4, Fma3, Mul, Scale);
4037 return LowerFDIV32(Op, DAG);
4040 return LowerFDIV64(Op, DAG);
4043 return LowerFDIV16(Op, DAG);
4076 unsigned NumElements = VT.getVectorNumElements();
4079 if (NumElements > 4)
4087 if (NumElements > 2)
4091 if (NumElements > 4)
4098 if (NumElements > 2)
4101 if (NumElements == 2)
4152 SDValue Ops[] = { ChainIn, Addr, NewOld };
4163 DAGCombinerInfo &DCI)
const {
4179 if (DCI.isAfterLegalizeVectorOps() && SrcVT ==
MVT::i32) {
4182 DCI.AddToWorklist(Cvt.
getNode());
4197 return isUInt<12>(OffsetSize);
4203 return isUInt<20>(OffsetSize);
4205 return (OffsetSize % 4 == 0) &&
isUInt<8>(OffsetSize / 4);
4232 DAGCombinerInfo &DCI)
const {
4264 DAGCombinerInfo &DCI)
const {
4285 return (Opc ==
ISD::AND && (Val == 0 || Val == 0xffffffff)) ||
4286 (Opc ==
ISD::OR && (Val == 0xffffffff || Val == 0)) ||
4295 SDValue SITargetLowering::splitBinaryBitConstantOp(
4296 DAGCombinerInfo &DCI,
4335 DAGCombinerInfo &DCI)
const {
4336 if (DCI.isBeforeLegalize())
4348 = splitBinaryBitConstantOp(DCI,
SDLoc(N),
ISD::AND, LHS, CRHS))
4361 if (
auto *CShift = dyn_cast<ConstantSDNode>(LHS->
getOperand(1))) {
4362 unsigned Shift = CShift->getZExtValue();
4364 unsigned Offset = NB + Shift;
4365 if ((Offset & (Bits - 1)) == 0) {
4436 DAGCombinerInfo &DCI)
const {
4456 static const uint32_t MaxMask = 0x3ff;
4488 DCI.AddToWorklist(LowOr.
getNode());
4489 DCI.AddToWorklist(HiBits.
getNode());
4500 = splitBinaryBitConstantOp(DCI,
SDLoc(N),
ISD::OR, LHS, CRHS))
4508 DAGCombinerInfo &DCI)
const {
4519 = splitBinaryBitConstantOp(DCI,
SDLoc(N),
ISD::XOR, LHS, CRHS))
4582 SDValue SITargetLowering::performZeroExtendCombine(
SDNode *N,
4583 DAGCombinerInfo &DCI)
const {
4609 DAGCombinerInfo &DCI)
const {
4614 if (
const ConstantSDNode *CMask = dyn_cast<ConstantSDNode>(Mask)) {
4615 if (CMask->isNullValue())
4695 auto F = cast<ConstantFPSDNode>(
Op)->getValueAPF();
4696 return !
F.isDenormal() && !(
F.isNaN() &&
F.isSignaling());
4703 SDValue SITargetLowering::performFCanonicalizeCombine(
4705 DAGCombinerInfo &DCI)
const {
4783 SDValue SITargetLowering::performIntMed3ImmCombine(
4805 return DAG.
getNode(Med3Opc, SL, VT,
4864 DAGCombinerInfo &DCI)
const {
4907 if (
SDValue Med3 = performIntMed3ImmCombine(DAG,
SDLoc(N), Op0, Op1,
true))
4912 if (
SDValue Med3 = performIntMed3ImmCombine(DAG,
SDLoc(N), Op0, Op1,
false))
4923 if (
SDValue Res = performFPMed3ImmCombine(DAG,
SDLoc(N), Op0, Op1))
4934 return (CA->isExactlyValue(0.0) && CB->isExactlyValue(1.0)) ||
4935 (CA->isExactlyValue(1.0) && CB->isExactlyValue(0.0));
4944 DAGCombinerInfo &DCI)
const {
4968 if (isa<ConstantFPSDNode>(Src0) && !isa<ConstantFPSDNode>(Src1))
4971 if (isa<ConstantFPSDNode>(Src1) && !isa<ConstantFPSDNode>(Src2))
4974 if (isa<ConstantFPSDNode>(Src0) && !isa<ConstantFPSDNode>(Src1))
4985 DAGCombinerInfo &DCI)
const {
4993 SDValue SITargetLowering::performExtractVectorEltCombine(
4994 SDNode *N, DAGCombinerInfo &DCI)
const {
5011 unsigned SITargetLowering::getFusedOpcode(
const SelectionDAG &DAG,
5013 const SDNode *N1)
const {
5034 DAGCombinerInfo &DCI)
const {
5064 return DAG.
getNode(Opc, SL, VTList, Args);
5069 if (!C || C->getZExtValue() != 0)
break;
5078 DAGCombinerInfo &DCI)
const {
5096 if (!C || C->getZExtValue() != 0)
5104 SDValue SITargetLowering::performAddCarrySubCarryCombine(
SDNode *N,
5105 DAGCombinerInfo &DCI)
const {
5111 if (!C || C->getZExtValue() != 0)
5130 DAGCombinerInfo &DCI)
const {
5148 unsigned FusedOp = getFusedOpcode(DAG, N, LHS.
getNode());
5151 return DAG.
getNode(FusedOp, SL, VT, A, Two, RHS);
5160 unsigned FusedOp = getFusedOpcode(DAG, N, RHS.
getNode());
5163 return DAG.
getNode(FusedOp, SL, VT, A, Two, LHS);
5172 DAGCombinerInfo &DCI)
const {
5192 unsigned FusedOp = getFusedOpcode(DAG, N, LHS.getNode());
5197 return DAG.
getNode(FusedOp, SL, VT, A, Two, NegRHS);
5207 unsigned FusedOp = getFusedOpcode(DAG, N, RHS.
getNode());
5210 return DAG.
getNode(FusedOp, SL, VT, A, NegTwo, LHS);
5219 DAGCombinerInfo &DCI)
const {
5278 SDValue SITargetLowering::performCvtF32UByteNCombine(
SDNode *N,
5279 DAGCombinerInfo &DCI)
const {
5296 dyn_cast<ConstantSDNode>(Srl.
getOperand(1))) {
5300 unsigned SrcOffset = C->getZExtValue() + 8 *
Offset;
5301 if (SrcOffset < 32 && SrcOffset % 8 == 0) {
5312 !DCI.isBeforeLegalizeOps());
5314 if (TLI.ShrinkDemandedConstant(Src, Demanded, TLO) ||
5315 TLI.SimplifyDemandedBits(Src, Demanded, Known, TLO)) {
5316 DCI.CommitTargetLoweringOpt(TLO);
5328 return performAddCombine(N, DCI);
5330 return performSubCombine(N, DCI);
5333 return performAddCarrySubCarryCombine(N, DCI);
5335 return performFAddCombine(N, DCI);
5337 return performFSubCombine(N, DCI);
5339 return performSetCCCombine(N, DCI);
5350 return performMinMaxCombine(N, DCI);
5374 return performMemSDNodeCombine(cast<MemSDNode>(N), DCI);
5376 return performAndCombine(N, DCI);
5378 return performOrCombine(N, DCI);
5380 return performXorCombine(N, DCI);
5382 return performZeroExtendCombine(N, DCI);
5384 return performClassCombine(N, DCI);
5386 return performFCanonicalizeCombine(N, DCI);
5401 return performUCharToFloatCombine(N, DCI);
5406 return performCvtF32UByteNCombine(N, DCI);
5408 return performFMed3Combine(N, DCI);
5410 return performCvtPkRTZCombine(N, DCI);
5430 return performExtractVectorEltCombine(N, DCI);
5439 case AMDGPU::sub0:
return 0;
5440 case AMDGPU::sub1:
return 1;
5441 case AMDGPU::sub2:
return 2;
5442 case AMDGPU::sub3:
return 3;
5447 void SITargetLowering::adjustWritemask(
MachineSDNode *&Node,
5453 unsigned NewDmask = 0;
5460 if (
I.getUse().getResNo() != 0)
5464 if (!
I->isMachineOpcode() ||
5465 I->getMachineOpcode() != TargetOpcode::EXTRACT_SUBREG)
5476 for (
unsigned i = 0, Dmask = OldDmask; i <= Lane; i++) {
5479 Dmask &= ~(1 << Comp);
5487 NewDmask |= 1 << Comp;
5491 if (NewDmask == OldDmask)
5495 std::vector<SDValue> Ops;
5498 Ops.insert(Ops.end(), Node->
op_begin() + DmaskIdx + 1, Node->
op_end());
5503 if (NewDmask && (NewDmask & (NewDmask-1)) == 0) {
5514 for (
unsigned i = 0, Idx = AMDGPU::sub0; i < 4; ++i) {
5524 case AMDGPU::sub0: Idx = AMDGPU::sub1;
break;
5525 case AMDGPU::sub1: Idx = AMDGPU::sub2;
break;
5526 case AMDGPU::sub2: Idx = AMDGPU::sub3;
break;
5535 return isa<FrameIndexSDNode>(
Op);
5549 if (SrcVal.getValueType() ==
MVT::i1 &&
5592 if (TII->
isMIMG(Opcode) && !TII->get(Opcode).mayStore() &&
5594 adjustWritemask(Node, DAG);
5596 if (Opcode == AMDGPU::INSERT_SUBREG ||
5597 Opcode == AMDGPU::REG_SEQUENCE) {
5622 if (RC != &AMDGPU::VReg_128RegClass)
5627 unsigned BitsSet = 0;
5628 for (
unsigned i = 0; i < 4; ++i)
5629 BitsSet += Writemask & (1 << i) ? 1 : 0;
5632 case 1: RC = &AMDGPU::VGPR_32RegClass;
break;
5633 case 2: RC = &AMDGPU::VReg_64RegClass;
break;
5634 case 3: RC = &AMDGPU::VReg_96RegClass;
break;
5638 MI.
setDesc(TII->get(NewOpcode));
5645 if (NoRetAtomicOp != -1) {
5647 MI.
setDesc(TII->get(NoRetAtomicOp));
5665 MI.
setDesc(TII->get(NoRetAtomicOp));
5673 TII->get(AMDGPU::IMPLICIT_DEF),
Def);
5722 uint64_t RsrcDword2And3)
const {
5732 RsrcDword2And3 & UINT64_C(0xFFFFFFFF));
5754 std::pair<unsigned, const TargetRegisterClass *>
5761 if (Constraint.
size() == 1) {
5762 switch (Constraint[0]) {
5767 return std::make_pair(0U,
nullptr);
5770 return std::make_pair(0U, &AMDGPU::SReg_32_XM0RegClass);
5772 return std::make_pair(0U, &AMDGPU::SGPR_64RegClass);
5774 return std::make_pair(0U, &AMDGPU::SReg_128RegClass);
5776 return std::make_pair(0U, &AMDGPU::SReg_256RegClass);
5778 return std::make_pair(0U, &AMDGPU::SReg_512RegClass);
5784 return std::make_pair(0U,
nullptr);
5787 return std::make_pair(0U, &AMDGPU::VGPR_32RegClass);
5789 return std::make_pair(0U, &AMDGPU::VReg_64RegClass);
5791 return std::make_pair(0U, &AMDGPU::VReg_96RegClass);
5793 return std::make_pair(0U, &AMDGPU::VReg_128RegClass);
5795 return std::make_pair(0U, &AMDGPU::VReg_256RegClass);
5797 return std::make_pair(0U, &AMDGPU::VReg_512RegClass);
5802 if (Constraint.
size() > 1) {
5804 if (Constraint[1] ==
'v') {
5805 RC = &AMDGPU::VGPR_32RegClass;
5806 }
else if (Constraint[1] ==
's') {
5807 RC = &AMDGPU::SGPR_32RegClass;
5813 if (!Failed && Idx < RC->getNumRegs())
5822 if (Constraint.
size() == 1) {
5823 switch (Constraint[0]) {
5853 MFI.hasVarSizedObjects() ||
5857 unsigned ReservedStackPtrOffsetReg = TRI->reservedStackPtrOffsetReg(MF);
unsigned addImplicitBufferPtr(const SIRegisterInfo &TRI)
value_iterator value_begin() const
static const unsigned UNKNOWN_ADDRESS_SPACE
std::enable_if< std::numeric_limits< T >::is_signed, bool >::type getAsInteger(unsigned Radix, T &Result) const
Parse the current string as an integer of the specified radix.
BITCAST - This operator converts between integer, vector and FP values, as if the value was stored to...
constexpr bool isUInt< 32 >(uint64_t x)
X = FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating point type down to the precision of the ...
SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl< ISD::OutputArg > &Outs, const SmallVectorImpl< SDValue > &OutVals, const SDLoc &DL, SelectionDAG &DAG) const override
This hook must be implemented to lower outgoing return values, described by the Outs array...
void push_back(const T &Elt)
BUILTIN_OP_END - This must be the last enum value in this list.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
static void r3(uint32_t &A, uint32_t &B, uint32_t &C, uint32_t &D, uint32_t &E, int I, uint32_t *Buf)
A parsed version of the target data layout string in and methods for querying it. ...
const AMDGPURegisterInfo * getRegisterInfo() const override=0
MachineSDNode * wrapAddr64Rsrc(SelectionDAG &DAG, const SDLoc &DL, SDValue Ptr) const
ISD::CondCode getICmpCondCode(ICmpInst::Predicate Pred)
getICmpCondCode - Return the ISD condition code corresponding to the given LLVM IR integer condition ...
FMINNUM/FMAXNUM - Perform floating-point minimum or maximum on two values.
Interface definition for SIRegisterInfo.
SDValue getValue(unsigned R) const
This represents an addressing mode of: BaseGV + BaseOffs + BaseReg + Scale*ScaleReg If BaseGV is null...
const DebugLoc & getDebugLoc() const
static void r2(uint32_t &A, uint32_t &B, uint32_t &C, uint32_t &D, uint32_t &E, int I, uint32_t *Buf)
int getMaskedMIMGOp(uint16_t Opcode, unsigned Channels) const
Given a MIMG Opcode that writes all 4 channels, return the equivalent opcode that writes Channels Cha...
CombineLevel getDAGCombineLevel()
unsigned getQueuePtrUserSGPR() const
std::pair< unsigned, const TargetRegisterClass * > getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI, StringRef Constraint, MVT VT) const override
Given a physical register constraint (e.g.
virtual ConstraintType getConstraintType(StringRef Constraint) const
Given a constraint, return the type of constraint it is for this target.
bool isExactlyValue(double V) const
We don't rely on operator== working on double values, as it returns true for things that are clearly ...
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function. ...
bool isFMAFasterThanFMulAndFAdd(EVT VT) const override
Return true if an FMA operation is faster than a pair of fmul and fadd instructions.
bool hasFlatScratchInit() const
LLVMContext * getContext() const
Diagnostic information for unsupported feature in backend.
AMDGPU specific subclass of TargetSubtarget.
uint64_t getZExtValue() const
Get zero extended value.
SDValue getSetCC(const SDLoc &DL, EVT VT, SDValue LHS, SDValue RHS, ISD::CondCode Cond)
Helper function to make it easier to build SetCC's if you just have an ISD::CondCode instead of an SD...
SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override
This method will be invoked for all target nodes and for any target-independent nodes that the target...
SDValue scalarizeVectorStore(StoreSDNode *ST, SelectionDAG &DAG) const
bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM, Type *Ty, unsigned AS) const override
Return true if the addressing mode represented by AM is legal for this target, for a load/store of th...
bool isTrapHandlerEnabled() const
EXTRACT_SUBVECTOR(VECTOR, IDX) - Returns a subvector from VECTOR (an vector value) starting with the ...
bool isKnownNeverNaN(SDValue Op) const
Test whether the given SDValue is known to never be NaN.
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
BR_CC - Conditional branch.
virtual MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr &MI, MachineBasicBlock *MBB) const
This method should be implemented by targets that mark instructions with the 'usesCustomInserter' fla...
LocInfo getLocInfo() const
unsigned getRegister(unsigned i) const
Return the specified register in the class.
static MVT getVectorVT(MVT VT, unsigned NumElements)
unsigned getPrivateSegmentWaveByteOffsetSystemSGPR() const
bool hasOneUse() const
Return true if there is exactly one use of this node.
unsigned getDestAddressSpace() const
bool hasNUsesOfValue(unsigned NUses, unsigned Value) const
Return true if there are exactly NUSES uses of the indicated value.
VECTOR_SHUFFLE(VEC1, VEC2) - Returns a vector, of the same type as VEC1/VEC2.
static bool isBoolSGPR(SDValue V)
bool hasOneUse() const
Return true if there is exactly one node using value ResNo of Node.
static void allocateSystemSGPRs(CCState &CCInfo, MachineFunction &MF, SIMachineFunctionInfo &Info, CallingConv::ID CallConv, bool IsShader)
const TargetMachine & getTargetMachine() const
SDVTList getVTList() const
Intrinsic::ID getIntrinsicID() const
Return the intrinsic ID of this intrinsic.
unsigned createVirtualRegister(const TargetRegisterClass *RegClass)
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
bool hasUnalignedBufferAccess() const
constexpr uint32_t Lo_32(uint64_t Value)
Return the low 32 bits of a 64 bit value.
virtual SDValue LowerGlobalAddress(AMDGPUMachineFunction *MFI, SDValue Op, SelectionDAG &DAG) const
bool hasDispatchID() const
bool canMergeStoresTo(unsigned AS, EVT MemVT, const SelectionDAG &DAG) const override
Returns if it's reasonable to merge stores to MemVT size.
const TargetMachine & getTarget() const
unsigned addLiveIn(unsigned PReg, const TargetRegisterClass *RC)
addLiveIn - Add the specified physical register as a live-in value and create a corresponding virtual...
void legalizeOperandsVOP3(MachineRegisterInfo &MRI, MachineInstr &MI) const
Fix operands in MI to satisfy constant bus requirements.
SDNode * getGluedNode() const
If this node has a glue operand, return the node to which the glue operand points.
Describe properties that are true of each instruction in the target description file.
bool mayStore(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly modify memory.
bool hasFastFMAF32() const
void setIsUndef(bool Val=true)
bool useVGPRIndexMode(bool UserEnable) const
unsigned addKernargSegmentPtr(const SIRegisterInfo &TRI)
void transferSuccessorsAndUpdatePHIs(MachineBasicBlock *FromMBB)
Transfers all the successors, as in transferSuccessors, and update PHI operands in the successor bloc...
const MachineInstrBuilder & add(const MachineOperand &MO) const
This class represents a function call, abstracting a target machine's calling convention.
const SIInstrInfo * getInstrInfo() const override
unsigned getSrcAddressSpace() const
unsigned addWorkGroupIDY()
const GlobalValue * getGlobal() const
static PointerType * get(Type *ElementType, unsigned AddressSpace)
This constructs a pointer to an object of the specified type in a numbered address space...
bool CCAssignFn(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
CCAssignFn - This function assigns a location for Val, updating State to reflect the change...
bool hasImplicitBufferPtr() const
float BitsToFloat(uint32_t Bits)
This function takes a 32-bit integer and returns the bit equivalent float.
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
bool hasWorkGroupIDZ() const
unsigned getScratchWaveOffsetReg() const
bool getTgtMemIntrinsic(IntrinsicInfo &, const CallInst &, unsigned IntrinsicID) const override
Given an intrinsic, checks if on the target the intrinsic will need to map to a MemIntrinsicNode (tou...
Function Alias Analysis Results
Type * getTypeForEVT(LLVMContext &Context) const
This method returns an LLVM type corresponding to the specified EVT.
unsigned getSizeInBits() const
bool isMemOpUniform(const SDNode *N) const
unsigned getByValSize() const
bool enableIEEEBit(const MachineFunction &MF) const
uint64_t getNullPointerValue(unsigned AddrSpace) const
Get the integer value of a null pointer in the given address space.
static bool bitOpWithConstantIsReducible(unsigned Opc, uint32_t Val)
EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Context, EVT VT) const override
Return the ValueType of the result of SETCC operations.
Val, Success, OUTCHAIN = ATOMIC_CMP_SWAP_WITH_SUCCESS(INCHAIN, ptr, cmp, swap) N.b.
unsigned getNumOperands() const
Return the number of values used by this operation.
static SDValue getFPTernOp(SelectionDAG &DAG, unsigned Opcode, const SDLoc &SL, EVT VT, SDValue A, SDValue B, SDValue C, SDValue GlueChain)
const SDValue & getOperand(unsigned Num) const
bool isSGPRClass(const TargetRegisterClass *RC) const
const Function * getFunction() const
getFunction - Return the LLVM function that this machine code represents
void markPSInputEnabled(unsigned Index)
SDValue getSelect(const SDLoc &DL, EVT VT, SDValue Cond, SDValue LHS, SDValue RHS)
Helper function to make it easier to build Select's if you just have operands and don't want to check...
unsigned getAddressSpace() const
Return the address space of the Pointer type.
SDValue getTruncStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, EVT TVT, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
[US]{MIN/MAX} - Binary minimum or maximum or signed or unsigned integers.
SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
iv Induction Variable Users
bool hasWorkItemIDZ() const
bool CheckReturn(const SmallVectorImpl< ISD::OutputArg > &ArgsFlags, CCAssignFn Fn)
CheckReturn - Analyze the return values of a function, returning true if the return can be performed ...
const SDValue & setRoot(SDValue N)
Set the current root tag of the SelectionDAG.
SDValue scalarizeVectorLoad(LoadSDNode *LD, SelectionDAG &DAG) const
Turn load of vector type into a load of the individual elements.
LLVM_READONLY int getAtomicNoRetOp(uint16_t Opcode)
CLAMP value between 0.0 and 1.0.
const SDValue & getBasePtr() const
INSERT_SUBVECTOR(VECTOR1, VECTOR2, IDX) - Returns a vector with VECTOR2 inserted into VECTOR1 at the ...
std::pair< SDValue, SDValue > split64BitValue(SDValue Op, SelectionDAG &DAG) const
Return 64-bit value Op as two 32-bit integers.
void ReplaceNodeResults(SDNode *N, SmallVectorImpl< SDValue > &Results, SelectionDAG &DAG) const override
This callback is invoked when a node result type is illegal for the target, and the operation was reg...
const AMDGPUImagePseudoSourceValue * getImagePSV() const
bool isAmdCodeObjectV2(const MachineFunction &MF) const
virtual bool isTypeDesirableForOp(unsigned, EVT VT) const
Return true if the target has native support for the specified value type and it is 'desirable' to us...
SDValue splitBinaryBitConstantOpImpl(DAGCombinerInfo &DCI, const SDLoc &SL, unsigned Opc, SDValue LHS, uint32_t ValLo, uint32_t ValHi) const
Split the 64-bit value LHS into two 32-bit components, and perform the binary operation Opc to it wit...
Select with condition operator - This selects between a true value and a false value (ops #2 and #3) ...
bool bitsLT(EVT VT) const
Return true if this has less bits than VT.
unsigned getScratchRSrcReg() const
Returns the physical register reserved for use as the resource descriptor for scratch accesses...
bool isAllOnesValue() const
void setTruncStoreAction(MVT ValVT, MVT MemVT, LegalizeAction Action)
Indicate that the specified truncating store does not work with the specified type and indicate what ...
static const unsigned LOCAL_ADDRESS
Address space for local memory.
RESULT,OUTCHAIN = INTRINSIC_W_CHAIN(INCHAIN, INTRINSICID, arg1, ...) This node represents a target in...
bool hasWorkGroupIDY() const
A convenience struct that encapsulates a DAG, and two SDValues for returning information from TargetL...
const Triple & getTargetTriple() const
static SDValue emitRemovedIntrinsicError(SelectionDAG &DAG, const SDLoc &DL, EVT VT)
SDValue expandUnalignedStore(StoreSDNode *ST, SelectionDAG &DAG) const
Expands an unaligned store to 2 half-size stores for integer values, and possibly more for vectors...
bool isVector() const
Return true if this is a vector value type.
void setPrivateSegmentWaveByteOffset(unsigned Reg)
#define FP_DENORM_FLUSH_NONE
void setDebuggerWorkGroupIDStackObjectIndex(unsigned Dim, int ObjectIdx)
Sets stack object index for Dim's work group ID to ObjectIdx.
bool isNegative() const
Return true if the value is negative.
unsigned reservedPrivateSegmentWaveByteOffsetReg(const MachineFunction &MF) const
Return the end register initially reserved for the scratch wave offset in case spilling is needed...
void setScratchRSrcReg(unsigned Reg)
static unsigned findFirstFreeSGPR(CCState &CCInfo)
const AMDGPUBufferPseudoSourceValue * getBufferPSV() const
A description of a memory reference used in the backend.
bool hasWorkGroupInfo() const
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
int64_t getOffset() const
OpenCL uses address spaces to differentiate between various memory regions on the hardware...
const HexagonInstrInfo * TII
bool getAddrModeArguments(IntrinsicInst *, SmallVectorImpl< Value * > &, Type *&) const override
CodeGenPrepare sinks address calculations into the same BB as Load/Store instructions reading the add...
Shift and rotation operations.
static bool isGather4(const MachineInstr &MI)
void setHasNonSpillStackObjects(bool StackObject=true)
unsigned addDispatchID(const SIRegisterInfo &TRI)
static bool isMIMG(const MachineInstr &MI)
void setDebuggerWorkItemIDStackObjectIndex(unsigned Dim, int ObjectIdx)
Sets stack object index for Dim's work item ID to ObjectIdx.
void setIfReturnsVoid(bool Value)
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
static void allocateHSAUserSGPRs(CCState &CCInfo, MachineFunction &MF, const SIRegisterInfo &TRI, SIMachineFunctionInfo &Info)
SDValue getTargetExtractSubreg(int SRIdx, const SDLoc &DL, EVT VT, SDValue Operand)
A convenience function for creating TargetInstrInfo::EXTRACT_SUBREG nodes.
MachineSDNode * getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT)
These are used for target selectors to create a new node with specified return type(s), MachineInstr opcode, and operands.
MachineFunction & getMachineFunction() const
unsigned getLDSSize() const
bool isReg() const
isReg - Tests if this is a MO_Register operand.
void eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
static unsigned SubIdx2Lane(unsigned Idx)
Helper function for adjustWritemask.
CopyToReg - This node has three operands: a chain, a register number to set to this value...
bool mayLoad(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly read memory.
LLVM_READONLY MachineOperand * getNamedOperand(MachineInstr &MI, unsigned OperandName) const
Returns the operand named Op.
const TargetRegisterClass * getRegClass(unsigned Reg) const
Return the register class of the specified virtual register.
LLVM_ATTRIBUTE_ALWAYS_INLINE R Default(const T &Value) const
unsigned getAddressSpace() const
Reg
All possible values of the reg field in the ModR/M byte.
APInt bitcastToAPInt() const
bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const override
Return true if folding a constant offset with the given GlobalAddress is legal.
The memory access is dereferenceable (i.e., doesn't trap).
EVT getScalarType() const
If this is a vector type, return the element type, otherwise return this.
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
Val, OUTCHAIN = ATOMIC_SWAP(INCHAIN, ptr, amt) Val, OUTCHAIN = ATOMIC_LOAD_[OpName](INCHAIN, ptr, amt) For double-word atomic operations: ValLo, ValHi, OUTCHAIN = ATOMIC_SWAP(INCHAIN, ptr, amtLo, amtHi) ValLo, ValHi, OUTCHAIN = ATOMIC_LOAD_[OpName](INCHAIN, ptr, amtLo, amtHi) These correspond to the atomicrmw instruction.
void setOperationAction(unsigned Op, MVT VT, LegalizeAction Action)
Indicate that the specified operation does not work with the specified type and indicate what to do a...
SDVTList getVTList(EVT VT)
Return an SDVTList that represents the list of values specified.
unsigned getStoreSize() const
Return the number of bytes overwritten by a store of the specified value type.
This is an SDNode representing atomic operations.
bool getScalarizeGlobalBehavior() const
MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, MachineMemOperand::Flags f, uint64_t s, unsigned base_alignment, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr, SyncScope::ID SSID=SyncScope::System, AtomicOrdering Ordering=AtomicOrdering::NotAtomic, AtomicOrdering FailureOrdering=AtomicOrdering::NotAtomic)
getMachineMemOperand - Allocate a new MachineMemOperand.
SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override
This callback is invoked for operations that are unsupported by the target, which are registered to u...
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
This file implements a class to represent arbitrary precision integral constant values and operations...
OutputArg - This struct carries flags and a value for a single outgoing (actual) argument or outgoing...
This represents a list of ValueType's that has been intern'd by a SelectionDAG.
SDValue getExtLoad(ISD::LoadExtType ExtType, const SDLoc &dl, EVT VT, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, EVT MemVT, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
LLVM_NODISCARD bool empty() const
unsigned getNumOperands() const
Access to explicit operands of the instruction.
SDValue getMergeValues(ArrayRef< SDValue > Ops, const SDLoc &dl)
Create a MERGE_VALUES node from the given operands.
EVT getVectorElementType() const
Given a vector type, return the type of each element.
static void reservePrivateMemoryRegs(const TargetMachine &TM, MachineFunction &MF, const SIRegisterInfo &TRI, SIMachineFunctionInfo &Info)
const AMDGPUAS &AS return SrcAS
SDValue getSExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT)
Convert Op, which must be of integer type, to the integer type VT, by either sign-extending or trunca...
void RemoveOperand(unsigned i)
Erase an operand from an instruction, leaving it with one fewer operand than it started with...
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Case(const char(&S)[N], const T &Value)
bool isShuffleMaskLegal(const SmallVectorImpl< int > &, EVT) const override
Targets can use this to indicate that they only support some VECTOR_SHUFFLE operations, those with specific masks.
unsigned getLocReg() const
static void allocateSpecialInputVGPRs(CCState &CCInfo, MachineFunction &MF, const SIRegisterInfo &TRI, SIMachineFunctionInfo &Info)
Class to represent function types.
unsigned getPSInputAddr() const
[SU]INT_TO_FP - These operators convert integers (whose interpreted sign depends on the first letter)...
void computeRegisterProperties(const TargetRegisterInfo *TRI)
Once all of the register classes are added, this allows us to compute derived properties we expose...
const AMDGPUSubtarget * Subtarget
void setStackPtrOffsetReg(unsigned Reg)
bool hasStackObjects() const
Return true if there are any stack objects in this function.
unsigned getNumValues() const
Return the number of values defined/returned by this operator.
value_iterator value_end() const
Simple integer binary arithmetic operators.
static MachineBasicBlock * emitIndirectSrc(MachineInstr &MI, MachineBasicBlock &MBB, const SISubtarget &ST)
TrapHandlerAbi getTrapHandlerAbi() const
bool hasWorkGroupIDX() const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
bool enableAggressiveFMAFusion(EVT VT) const override
Return true if target always beneficiates from combining into FMA for a given value type...
static unsigned minMaxOpcToMin3Max3Opc(unsigned Opc)
ConstraintType getConstraintType(StringRef Constraint) const override
Given a constraint, return the type of constraint it is for this target.
const SDValue & getBasePtr() const
SDValue getUNDEF(EVT VT)
Return an UNDEF node. UNDEF does not have a useful SDLoc.
cmpResult
IEEE-754R 5.11: Floating Point Comparison Relations.
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out...
const APInt & getAPIntValue() const
EVT getValueType(const DataLayout &DL, Type *Ty, bool AllowUnknown=false) const
Return the EVT corresponding to this LLVM type.
EVT getMemoryVT() const
Return the type of the in-memory value.
CodeGenOpt::Level getOptLevel() const
Returns the optimization level: None, Less, Default, or Aggressive.
ISD::CondCode getFCmpCondCode(FCmpInst::Predicate Pred)
getFCmpCondCode - Return the ISD condition code corresponding to the given LLVM IR floating-point con...
SDValue getTargetConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isOpaque=false)
READCYCLECOUNTER - This corresponds to the readcyclecounter intrinsic.
void addMemOperand(MachineFunction &MF, MachineMemOperand *MO)
Add a MachineMemOperand to the machine instruction.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
Generation getGeneration() const
instr_iterator insert(instr_iterator I, MachineInstr *M)
Insert MI into the instruction list before I, possibly inside a bundle.
unsigned getUndefRegState(bool B)
void markPSInputAllocated(unsigned Index)
RESULT = INTRINSIC_WO_CHAIN(INTRINSICID, arg1, arg2, ...) This node represents a target intrinsic fun...
size_t size() const
size - Get the array size.
static SDValue emitNonHSAIntrinsicError(SelectionDAG &DAG, const SDLoc &DL, EVT VT)
MachineBasicBlock * CreateMachineBasicBlock(const BasicBlock *bb=nullptr)
CreateMachineBasicBlock - Allocate a new MachineBasicBlock.
const DataLayout & getDataLayout() const
bool bitsLE(EVT VT) const
Return true if this has no more bits than VT.
const SIRegisterInfo & getRegisterInfo() const
Class to represent pointers.
const BasicBlock * getBasicBlock() const
Return the LLVM basic block that this instance corresponded to originally.
This class is used to represent ISD::STORE nodes.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
FP_TO_[US]INT - Convert a floating point value to a signed or unsigned integer.
uint32_t FloatToBits(float Float)
This function takes a float and returns the bit equivalent 32-bit integer.
Flag
These should be considered private to the implementation of the MCInstrDesc class.
const MachineBasicBlock * getParent() const
BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a vector with the specified, possibly variable...
bool isPSInputAllocated(unsigned Index) const
static APInt getHighBitsSet(unsigned numBits, unsigned hiBitsSet)
Get a value with high bits set.
static bool isFlatGlobalAddrSpace(unsigned AS, AMDGPUAS AMDGPUASI)
SDNode * getNode() const
get the SDNode which holds the desired result
constexpr uint64_t MinAlign(uint64_t A, uint64_t B)
A and B are either alignments or offsets.
virtual void finalizeLowering(MachineFunction &MF) const
Execute target specific actions to finalize target lowering.
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
unsigned getStoreSize() const
Return the number of bytes overwritten by a store of the specified value type.
static bool fp16SrcZerosHighBits(unsigned Opc)
bool isTypeLegal(EVT VT) const
Return true if the target has native support for the specified value type.
A switch()-like statement whose cases are string literals.
Type * getParamType(unsigned i) const
Parameter type accessors.
initializer< Ty > init(const Ty &Val)
OUTCHAIN = INTRINSIC_VOID(INCHAIN, INTRINSICID, arg1, arg2, ...) This node represents a target intrin...
unsigned UnsafeFPMath
UnsafeFPMath - This flag is enabled when the -enable-unsafe-fp-math flag is specified on the command ...
FPOpFusion::FPOpFusionMode AllowFPOpFusion
AllowFPOpFusion - This flag is set by the -fuse-fp-ops=xxx option.
Control flow instructions. These all have token chains.
const SDValue & getBasePtr() const
std::pair< SDValue, SDValue > expandUnalignedLoad(LoadSDNode *LD, SelectionDAG &DAG) const
Expands an unaligned load to 2 half-size loads for an integer, and possibly more for vectors...
constexpr bool isUInt< 8 >(uint64_t x)
unsigned const MachineRegisterInfo * MRI
std::size_t countTrailingZeros(T Val, ZeroBehavior ZB=ZB_Width)
Count number of 0's from the least significant bit to the most stopping at the first 1...
unsigned getVectorNumElements() const
bool hasFloatingPointExceptions() const
Return true if target supports floating point exceptions.
unsigned addWorkGroupInfo()
const SDValue & getOperand(unsigned i) const
The instances of the Type class are immutable: once they are created, they are never changed...
bool isCompareAndSwap() const
Returns true if this SDNode represents cmpxchg atomic operation, false otherwise. ...
This is an important class for using LLVM in a threaded context.
FunctionType * getFunctionType() const
Returns the FunctionType for me.
void addRegisterClass(MVT VT, const TargetRegisterClass *RC)
Add the specified register class as an available regclass for the specified value type...
Simple binary floating point operators.
void setTargetDAGCombine(ISD::NodeType NT)
Targets should invoke this method for each target independent node that they want to provide a custom...
unsigned getPreloadedValue(const MachineFunction &MF, enum PreloadedValue Value) const
Returns the physical register that Value is stored in.
SDValue getMemIntrinsicNode(unsigned Opcode, const SDLoc &dl, SDVTList VTList, ArrayRef< SDValue > Ops, EVT MemVT, MachinePointerInfo PtrInfo, unsigned Align=0, bool Vol=false, bool ReadMem=true, bool WriteMem=true, unsigned Size=0)
Creates a MemIntrinsicNode that may produce a result and takes a list of operands.
bool sge(const APInt &RHS) const
Signed greather or equal comparison.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
SDNode * PostISelFolding(MachineSDNode *N, SelectionDAG &DAG) const override
Fold the instructions after selecting them.
bool isVector() const
Return true if this is a vector value type.
const SDNodeFlags getFlags() const
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
LoadExtType
LoadExtType enum - This enum defines the three variants of LOADEXT (load with extension).
INSERT_VECTOR_ELT(VECTOR, VAL, IDX) - Returns VECTOR with the element at IDX replaced with VAL...
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
const MachineOperand & getOperand(unsigned i) const
static MachineBasicBlock * emitIndirectDst(MachineInstr &MI, MachineBasicBlock &MBB, const SISubtarget &ST)
unsigned getLiveInVirtReg(unsigned PReg) const
getLiveInVirtReg - If PReg is a live-in physical register, return the corresponding live-in physical ...
EVT getOptimalMemOpType(uint64_t Size, unsigned DstAlign, unsigned SrcAlign, bool IsMemset, bool ZeroMemset, bool MemcpyStrSrc, MachineFunction &MF) const override
Returns the target specific optimal type for load and store operations as a result of memset...
bool isEntryFunctionCC(CallingConv::ID CC)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
bool hasUnalignedScratchAccess() const
SI DAG Lowering interface definition.
bool hasDispatchPtr() const
virtual std::pair< unsigned, const TargetRegisterClass * > getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI, StringRef Constraint, MVT VT) const
Given a physical register constraint (e.g.
This file declares a class to represent arbitrary precision floating point values and provide a varie...
This class provides iterator support for SDUse operands that use a specific SDNode.
SITargetLowering(const TargetMachine &tm, const SISubtarget &STI)
bool hasKernargSegmentPtr() const
bool hasAllowReciprocal() const
bool isBeforeLegalize() const
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
unsigned addQueuePtr(const SIRegisterInfo &TRI)
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
bool hasWorkItemIDX() const
bool uge(const APInt &RHS) const
Unsigned greater or equal comparison.
unsigned getOpcode() const
static unsigned getMOVRELDPseudo(const SIRegisterInfo &TRI, const TargetRegisterClass *VecRC)
TRAP - Trapping instruction.
bool hasFP32Denormals() const
Value * getOperand(unsigned i) const
uint64_t getDefaultRsrcDataFormat() const
AssertSext, AssertZext - These nodes record if a register contains a value that has already been zero...
DEBUGTRAP - Trap intended to get the attention of a debugger.
#define FP_DENORM_FLUSH_IN_FLUSH_OUT
void RemoveDeadNode(SDNode *N)
Remove the specified node from the system.
self_iterator getIterator()
The memory access is non-temporal.
CondCode getSetCCSwappedOperands(CondCode Operation)
Return the operation corresponding to (Y op X) when given the operation for (X op Y)...
static MVT getVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
static std::pair< unsigned, int > computeIndirectRegAndOffset(const SIRegisterInfo &TRI, const TargetRegisterClass *SuperRC, unsigned VecReg, int Offset)
uint64_t getConstantOperandVal(unsigned Num) const
Helper method returns the integer value of a ConstantSDNode operand.
int CreateFixedObject(uint64_t Size, int64_t SPOffset, bool Immutable, bool isAliased=false)
Create a new object at a fixed location on the stack.
use_iterator use_begin() const
Provide iteration support to walk over all uses of an SDNode.
The AMDGPU TargetMachine interface definition for hw codgen targets.
const SDValue & getValue() const
void AddPromotedToType(unsigned Opc, MVT OrigVT, MVT DestVT)
If Opc/OrigVT is specified as being promoted, the promotion code defaults to trying a larger integer/...
bool has16BitInsts() const
static void r1(uint32_t &A, uint32_t &B, uint32_t &C, uint32_t &D, uint32_t &E, int I, uint32_t *Buf)
Bit counting operators with an undefined result for zero inputs.
Val, OUTCHAIN = ATOMIC_CMP_SWAP(INCHAIN, ptr, cmp, swap) For double-word atomic operations: ValLo...
bool MaskedValueIsZero(SDValue Op, const APInt &Mask, unsigned Depth=0) const
Return true if 'Op & Mask' is known to be zero.
X = FP_EXTEND(Y) - Extend a smaller FP type into a larger FP type.
unsigned REGION_ADDRESS
Address space for region memory.
unsigned getSubReg() const
static UndefValue * get(Type *T)
Static factory methods - Return an 'undef' object of the specified type.
const APFloat & getValueAPF() const
void setScratchWaveOffsetReg(unsigned Reg)
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
bool shouldAssumeDSOLocal(const Module &M, const GlobalValue *GV) const
unsigned countTrailingZeros() const
Count the number of trailing zero bits.
This class contains a discriminated union of information about pointers in memory operands...
bool hasFP64Denormals() const
bool hasFlatInstOffsets() const
const SDValue & getRoot() const
Return the root tag of the SelectionDAG.
unsigned addDispatchPtr(const SIRegisterInfo &TRI)
SDValue getLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr)
Loads are not normal binary operators: their result type is not determined by their operands...
Triple - Helper class for working with autoconf configuration names.
static CCAssignFn * CCAssignFnForCall(CallingConv::ID CC, bool IsVarArg)
Selects the correct CCAssignFn for a given CallingConvention value.
The memory access writes data.
bool isInlineConstant(const APInt &Imm) const
bool bitsGT(EVT VT) const
Return true if this has more bits than VT.
static bool setM0ToIndexFromSGPR(const SIInstrInfo *TII, MachineRegisterInfo &MRI, MachineInstr &MI, int Offset, bool UseGPRIdxMode, bool IsIndirectSrc)
static SDValue buildPCRelGlobalAddress(SelectionDAG &DAG, const GlobalValue *GV, const SDLoc &DL, unsigned Offset, EVT PtrVT, unsigned GAFlags=SIInstrInfo::MO_NONE)
SDValue SplitVectorStore(SDValue Op, SelectionDAG &DAG) const
Split a vector store into 2 stores of half the vector.
TokenFactor - This node takes multiple tokens as input and produces a single token result...
MVT getScalarShiftAmountTy(const DataLayout &, EVT) const override
EVT is not used in-tree, but is used by out-of-tree target.
unsigned getABITypeAlignment(Type *Ty) const
Returns the minimum ABI-required alignment for the specified type.
unsigned getReturnAddressReg(const MachineFunction &MF) const
bool memoperands_empty() const
Return true if we don't have any memory operands which described the the memory access done by this i...
Iterator for intrusive lists based on ilist_node.
CCState - This class holds information needed while lowering arguments and return values...
unsigned countPopulation(T Value)
Count the number of set bits in a value.
void addSuccessor(MachineBasicBlock *Succ, BranchProbability Prob=BranchProbability::getUnknown())
Add Succ as a successor of this MachineBasicBlock.
const DebugLoc & getDebugLoc() const
void setDesc(const MCInstrDesc &tid)
Replace the instruction descriptor (thus opcode) of the current instruction with a new one...
This is the shared class of boolean and integer constants.
TargetLoweringBase::LegalizeTypeAction getPreferredVectorAction(EVT VT) const override
Return the preferred vector type legalization action.
Returns platform specific canonical encoding of a floating point number.
static bool isKnownNeverSNan(SelectionDAG &DAG, SDValue Op)
SDValue SplitVectorLoad(SDValue Op, SelectionDAG &DAG) const
Split a vector load into 2 loads of half the vector.
bool isInfinity() const
Return true if the value is an infinity.
EXTRACT_VECTOR_ELT(VECTOR, IDX) - Returns a single element from VECTOR identified by the (potentially...
SDNode * UpdateNodeOperands(SDNode *N, SDValue Op)
Mutate the specified node in-place to have the specified operands.
const SIRegisterInfo * getRegisterInfo() const override
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
SDValue getZExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT)
Convert Op, which must be of integer type, to the integer type VT, by either zero-extending or trunca...
ADDRSPACECAST - This operator converts between pointers of different address spaces.
MachineOperand class - Representation of each machine instruction operand.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Calling convention used for Mesa pixel shaders.
Type * getType() const
All values are typed, get the type of this value.
SDValue getBuildVector(EVT VT, const SDLoc &DL, ArrayRef< SDValue > Ops)
Return an ISD::BUILD_VECTOR node.
MDNode * getMetadata(unsigned KindID) const
Get the metadata of given kind attached to this Instruction.
CCValAssign - Represent assignment of one arg/retval to a location.
AMDGPUAS getAMDGPUAS() const
SDNode * legalizeTargetIndependentNode(SDNode *Node, SelectionDAG &DAG) const
Legalize target independent instructions (e.g.
BRCOND - Conditional branch.
An SDNode that represents everything that will be needed to construct a MachineInstr.
const SDValue & getChain() const
Byte Swap and Counting operators.
FP16_TO_FP, FP_TO_FP16 - These operators are used to perform promotions and truncation for half-preci...
static SDValue getFPBinOp(SelectionDAG &DAG, unsigned Opcode, const SDLoc &SL, EVT VT, SDValue A, SDValue B, SDValue GlueChain)
MachineMemOperand * getMemOperand() const
Return a MachineMemOperand object describing the memory reference performed by operation.
This is an abstract virtual class for memory operations.
LLVM_READNONE bool isKernel(CallingConv::ID CC)
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
bool isZero() const
This is just a convenience method to make client code smaller for a common code.
Represents one node in the SelectionDAG.
const fltSemantics & getFltSemantics() const
SDValue LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl< ISD::InputArg > &Ins, const SDLoc &DL, SelectionDAG &DAG, SmallVectorImpl< SDValue > &InVals) const override
This hook must be implemented to lower the incoming (formal) arguments, described by the Ins array...
bool hasApertureRegs() const
SDValue getNOT(const SDLoc &DL, SDValue Val, EVT VT)
Create a bitwise NOT operation as (XOR Val, -1).
static bool canFoldOffset(unsigned OffsetSize, unsigned AS, const SISubtarget &STI)
Return true if the given offset Size in bytes can be folded into the immediate offsets of a memory in...
SDValue getCopyToReg(SDValue Chain, const SDLoc &dl, unsigned Reg, SDValue N)
static SDNode * findUser(SDValue Value, unsigned Opcode)
Helper function for LowerBRCOND.
static bool allUsesHaveSourceMods(const SDNode *N, unsigned CostThreshold=4)
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
Value * getArgOperand(unsigned i) const
getArgOperand/setArgOperand - Return/set the i-th call argument.
ISD::LoadExtType getExtensionType() const
Return whether this is a plain node, or one of the varieties of value-extending loads.
static EVT getVectorVT(LLVMContext &Context, EVT VT, unsigned NumElements, bool IsScalable=false)
Returns the EVT that represents a vector NumElements in length, where each element is of type VT...
Target - Wrapper for Target specific information.
Class for arbitrary precision integers.
const Value * getValue() const
Return the base address of the memory access.
SDValue getConstantFP(double Val, const SDLoc &DL, EVT VT, bool isTarget=false)
Create a ConstantFPSDNode wrapping a constant value.
bool isShader(CallingConv::ID cc)
Select(COND, TRUEVAL, FALSEVAL).
Interface for the AMDGPU Implementation of the Intrinsic Info class.
op_iterator op_begin() const
void finalizeLowering(MachineFunction &MF) const override
Execute target specific actions to finalize target lowering.
static use_iterator use_end()
SDValue copyToM0(SelectionDAG &DAG, SDValue Chain, const SDLoc &DL, SDValue V) const
ZERO_EXTEND - Used for integer types, zeroing the new bits.
bool CanLowerReturn(CallingConv::ID CallConv, MachineFunction &MF, bool isVarArg, const SmallVectorImpl< ISD::OutputArg > &Outs, LLVMContext &Context) const override
This hook should be implemented to check whether the return values described by the Outs array can fi...
AddrMode
ARM Addressing Modes.
unsigned getVectorNumElements() const
ANY_EXTEND - Used for integer types. The high bits are undefined.
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
void replaceRegWith(unsigned FromReg, unsigned ToReg)
replaceRegWith - Replace all instances of FromReg with ToReg in the machine function.
FMINNAN/FMAXNAN - Behave identically to FMINNUM/FMAXNUM, except that when a single input is NaN...
virtual TargetLoweringBase::LegalizeTypeAction getPreferredVectorAction(EVT VT) const
Return the preferred vector type legalization action.
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
bool allowsMisalignedMemoryAccesses(EVT VT, unsigned AS, unsigned Align, bool *IsFast) const override
Determine if the target supports unaligned memory accesses.
void AdjustInstrPostInstrSelection(MachineInstr &MI, SDNode *Node) const override
Assign the register class depending on the number of bits set in the writemask.
bool isEntryFunction() const
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
static bool isVOP3(const MachineInstr &MI)
static APInt getBitsSet(unsigned numBits, unsigned loBit, unsigned hiBit)
Get a value with a block of bits set.
unsigned addPrivateSegmentBuffer(const SIRegisterInfo &TRI)
Flags
Flags values. These may be or'd together.
bool isNoopAddrSpaceCast(unsigned SrcAS, unsigned DestAS) const override
Returns true if a cast between SrcAS and DestAS is a noop.
llvm_unreachable("Unknown RegBank!")
unsigned getAddressSpace() const
Return the address space for the associated pointer.
unsigned addFlatScratchInit(const SIRegisterInfo &TRI)
static CCAssignFn * CCAssignFnForReturn(CallingConv::ID CC, bool IsVarArg)
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
The memory access reads data.
bool supportsMinMaxDenormModes() const
static MachinePointerInfo getFixedStack(MachineFunction &MF, int FI, int64_t Offset=0)
Return a MachinePointerInfo record that refers to the specified FrameIndex.
bool isCheapAddrSpaceCast(unsigned SrcAS, unsigned DestAS) const override
Returns true if a cast from SrcAS to DestAS is "cheap", such that e.g.
static std::vector< std::string > Flags
const SISubtarget * getSubtarget() const
Representation of each machine instruction.
static bool isPhysicalRegister(unsigned Reg)
Return true if the specified register number is in the physical register namespace.
ConstantFPSDNode * isConstOrConstSplatFP(SDValue V)
Returns the SDNode if it is a constant splat BuildVector or constant float.
These are IR-level optimization flags that may be propagated to SDNodes.
PointerType * getType() const
Global values are always pointers.
static SDValue buildSMovImm32(SelectionDAG &DAG, const SDLoc &DL, uint64_t Val)
SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool IsVarArg, const SmallVectorImpl< ISD::OutputArg > &Outs, const SmallVectorImpl< SDValue > &OutVals, const SDLoc &DL, SelectionDAG &DAG) const override
This hook must be implemented to lower outgoing return values, described by the Outs array...
unsigned PartOffset
Offset in bytes of current output value relative to the beginning of original argument.
This class keeps track of the SPI_SP_INPUT_ADDR config register, which tells the hardware which inter...
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
Interface definition for SIInstrInfo.
constexpr bool isShiftedMask_64(uint64_t Value)
Return true if the argument contains a non-empty sequence of ones with the remainder zero (64 bit ver...
static bool isCanonicalized(SelectionDAG &DAG, SDValue Op, const SISubtarget *ST, unsigned MaxDepth=5)
Bitwise operators - logical and, logical or, logical xor.
bool hasAnyUseOfValue(unsigned Value) const
Return true if there are any use of the indicated value.
void splice(iterator Where, MachineBasicBlock *Other, iterator From)
Take an instruction from MBB 'Other' at the position From, and insert it into this MBB right before '...
SDValue getCopyFromReg(SDValue Chain, const SDLoc &dl, unsigned Reg, EVT VT)
unsigned getMaxPrivateElementSize() const
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
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...
static bool isClampZeroToOne(SDValue A, SDValue B)
bool isMemOpHasNoClobberedMemOperand(const SDNode *N) const
unsigned getSizeInBits() const
Return the size of the specified value type in bits.
unsigned FLAT_ADDRESS
Address space for flat memory.
void ReplaceAllUsesWith(SDValue From, SDValue Op)
Modify anything using 'From' to use 'To' instead.
static cl::opt< bool > EnableVGPRIndexMode("amdgpu-vgpr-index-mode", cl::desc("Use GPR indexing mode instead of movrel for vector indexing"), cl::init(false))
void AnalyzeReturn(const SmallVectorImpl< ISD::OutputArg > &Outs, CCAssignFn Fn)
AnalyzeReturn - Analyze the returned values of a return, incorporating info about the result values i...
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
The memory access always returns the same value (or traps).
bool isAllocated(unsigned Reg) const
isAllocated - Return true if the specified register (or an alias) is allocated.
void clearKillFlags(unsigned Reg) const
clearKillFlags - Iterate over all the uses of the given register and clear the kill flag from the Mac...
bool enableDX10Clamp() const
op_iterator op_end() const
unsigned getExplicitKernelArgOffset(const MachineFunction &MF) const
Returns the offset in bytes from the start of the input buffer of the first explicit kernel argument...
bool shouldEmitConstantsToTextSection(const Triple &TT)
void analyzeFormalArgumentsCompute(CCState &State, const SmallVectorImpl< ISD::InputArg > &Ins) const
The SelectionDAGBuilder will automatically promote function arguments with illegal types...
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
bool hasUnsafeAlgebra() const
bool isUniformMMO(const MachineMemOperand *MMO)
unsigned addWorkGroupIDZ()
unsigned getWavefrontSize() const
static void r0(uint32_t &A, uint32_t &B, uint32_t &C, uint32_t &D, uint32_t &E, int I, uint32_t *Buf)
FSINCOS - Compute both fsin and fcos as a single operation.
static const unsigned CONSTANT_ADDRESS
Address space for constant memory (VTX2)
void diagnose(const DiagnosticInfo &DI)
Report a message to the currently installed diagnostic handler.
uint64_t getTypeStoreSize(Type *Ty) const
Returns the maximum number of bytes that may be overwritten by storing the specified type...
static APFloat getLargest(const fltSemantics &Sem, bool Negative=false)
Returns the largest finite number in the given semantics.
constexpr bool isUInt< 16 >(uint64_t x)
void setSimpleHint(unsigned VReg, unsigned PrefReg)
Specify the preferred register allocation hint for the specified virtual register.
EVT getValueType() const
Return the ValueType of the referenced return value.
SDValue getConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isTarget=false, bool isOpaque=false)
Create a ConstantSDNode wrapping a constant value.
SDValue getCondCode(ISD::CondCode Cond)
static bool isFrameIndexOp(SDValue Op)
static MachineBasicBlock::iterator loadM0FromVGPR(const SIInstrInfo *TII, MachineBasicBlock &MBB, MachineInstr &MI, unsigned InitResultReg, unsigned PhiReg, int Offset, bool UseGPRIdxMode)
bool hasWorkItemIDY() const
static const unsigned GLOBAL_ADDRESS
Address space for global memory (RAT0, VTX0).
void setABIArgOffset(unsigned NewOffset)
CONCAT_VECTORS(VECTOR0, VECTOR1, ...) - Given a number of values of vector type with the same length ...
unsigned getReg() const
getReg - Returns the register number.
unsigned addPrivateSegmentWaveByteOffset()
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void insert(iterator MBBI, MachineBasicBlock *MBB)
SDValue getFrameIndex(int FI, EVT VT, bool isTarget=false)
LegalizeTypeAction
This enum indicates whether a types are legal for a target, and if not, what action should be used to...
bool allowsMemoryAccess(LLVMContext &Context, const DataLayout &DL, EVT VT, unsigned AddrSpace=0, unsigned Alignment=1, bool *Fast=nullptr) const
Return true if the target supports a memory access of this type for the given address space and align...
MVT getPointerTy(const DataLayout &DL, uint32_t AS=0) const
Return the pointer type for the given address space, defaults to the pointer type from the data layou...
void setSchedulingPreference(Sched::Preference Pref)
Specify the target scheduling preference.
constexpr uint32_t Hi_32(uint64_t Value)
Return the high 32 bits of a 64 bit value.
SDValue CreateLiveInRegister(SelectionDAG &DAG, const TargetRegisterClass *RC, unsigned Reg, EVT VT, const SDLoc &SL, bool RawReg=false) const
Helper function that adds Reg to the LiveIn list of the DAG's MachineFunction.
Module * getParent()
Get the module that this global value is contained inside of...
LLVM Value Representation.
FMA - Perform a * b + c with no intermediate rounding step.
unsigned reservedPrivateSegmentBufferReg(const MachineFunction &MF) const
Return the end register initially reserved for the scratch buffer in case spilling is needed...
SDValue getRegister(unsigned Reg, EVT VT)
unsigned getFrameOffsetReg() const
const MachineInstrBuilder & addMBB(MachineBasicBlock *MBB, unsigned char TargetFlags=0) const
EVT changeTypeToInteger()
Return the type converted to an equivalently sized integer or vector with integer element type...
SDValue getValueType(EVT)
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.
bool hasVOP3PInsts() const
const TargetLowering & getTargetLoweringInfo() const
SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override
This method will be invoked for all target nodes and for any target-independent nodes that the target...
void ReplaceAllUsesOfValueWith(SDValue From, SDValue To)
Replace any uses of From with To, leaving uses of other values produced by From.Val alone...
static EVT getEquivalentMemType(LLVMContext &Context, EVT VT)
cmpResult compare(const APFloat &RHS) const
Primary interface to the complete machine description for the target machine.
unsigned getStackPtrOffsetReg() const
void setRegClass(unsigned Reg, const TargetRegisterClass *RC)
setRegClass - Set the register class of the specified virtual register.
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...
std::pair< unsigned, unsigned > getFlatWorkGroupSizes(const Function &F) const
SetCC operator - This evaluates to a true value iff the condition is true.
uint32_t getImplicitParameterOffset(const AMDGPUMachineFunction *MFI, const ImplicitParameter Param) const
Helper function that returns the byte offset of the given type of implicit parameter.
bool hasMin3Max3_16() const
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml","ocaml 3.10-compatible collector")
bool hasFP16Denormals() const
unsigned getLocMemOffset() const
MVT getVectorElementType() const
bool isTypeDesirableForOp(unsigned Op, EVT VT) const override
Return true if the target has native support for the specified value type and it is 'desirable' to us...
SDValue getEntryNode() const
Return the token chain corresponding to the entry of the function.
OUTCHAIN = ATOMIC_STORE(INCHAIN, ptr, val) This corresponds to "store atomic" instruction.
TRUNCATE - Completely drop the high bits.
static void Split(std::vector< std::string > &V, StringRef S)
Splits a string of comma separated items in to a vector of strings.
unsigned getAlignment() const
unsigned AllocateReg(unsigned Reg)
AllocateReg - Attempt to allocate one register.
unsigned addWorkGroupIDX()
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
const MachineInstrBuilder & addReg(unsigned RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr &MI, MachineBasicBlock *BB) const override
This method should be implemented by targets that mark instructions with the 'usesCustomInserter' fla...
FNEG, FABS, FSQRT, FSIN, FCOS, FPOWI, FPOW, FLOG, FLOG2, FLOG10, FEXP, FEXP2, FCEIL, FTRUNC, FRINT, FNEARBYINT, FROUND, FFLOOR - Perform various unary floating point operations.
static void processShaderInputArgs(SmallVectorImpl< ISD::InputArg > &Splits, CallingConv::ID CallConv, ArrayRef< ISD::InputArg > Ins, BitVector &Skipped, FunctionType *FType, SIMachineFunctionInfo *Info)
static EVT getIntegerVT(LLVMContext &Context, unsigned BitWidth)
Returns the EVT that represents an integer with the given number of bits.
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 ...
static IntegerType * getInt8Ty(LLVMContext &C)
Val, OUTCHAIN = ATOMIC_LOAD(INCHAIN, ptr) This corresponds to "load atomic" instruction.
const fltSemantics & getSemantics() const
SCALAR_TO_VECTOR(VAL) - This represents the operation of loading a scalar value into element 0 of the...
static APFloat getQNaN(const fltSemantics &Sem, bool Negative=false, const APInt *payload=nullptr)
Factory for QNaN values.
bool shouldConvertConstantLoadToIntImm(const APInt &Imm, Type *Ty) const override
Return true if it is beneficial to convert a load of a constant to just the constant itself...
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
unsigned PRIVATE_ADDRESS
Address space for private memory.
Carry-using nodes for multiple precision addition and subtraction.
bool isMachineOpcode() const
Test if this node has a post-isel opcode, directly corresponding to a MachineInstr opcode...
static MachineBasicBlock::iterator emitLoadM0FromVGPRLoop(const SIInstrInfo *TII, MachineRegisterInfo &MRI, MachineBasicBlock &OrigBB, MachineBasicBlock &LoopBB, const DebugLoc &DL, const MachineOperand &IdxReg, unsigned InitReg, unsigned ResultReg, unsigned PhiReg, unsigned InitSaveExecReg, int Offset, bool UseGPRIdxMode)
A wrapper class for inspecting calls to intrinsic functions.
unsigned getRegisterByName(const char *RegName, EVT VT, SelectionDAG &DAG) const override
Return the register ID of the name passed in.
unsigned getMachineOpcode() const
This may only be called if isMachineOpcode returns true.
bool hasPrivateSegmentWaveByteOffset() const
SDValue getTargetGlobalAddress(const GlobalValue *GV, const SDLoc &DL, EVT VT, int64_t offset=0, unsigned char TargetFlags=0)
bool hasPrivateSegmentBuffer() const
MachineBasicBlock * splitKillBlock(MachineInstr &MI, MachineBasicBlock *BB) const
uint64_t getZExtValue() const
SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override
This callback is invoked for operations that are unsupported by the target, which are registered to u...
unsigned getVectorNumElements() const
Given a vector type, return the number of elements it contains.
This class is used to represent ISD::LOAD nodes.