65 #define DEBUG_TYPE "nvptx-lower"
77 cl::desc(
"NVPTX Specific: FMA contraction (0: don't do it"
78 " 1: do it 2: do it aggressively"),
83 cl::desc(
"NVPTX Specifies: 0 use div.approx, 1 use div.full, 2 use"
84 " IEEE Compliant F32 div.rnd if available."),
89 cl::desc(
"NVPTX Specific: 0 use sqrt.approx, 1 use sqrt.rn."),
94 cl::desc(
"NVPTX Specific: Flush f32 subnormals to sign-preserving zero."),
167 uint64_t StartingOffset = 0) {
172 for (
unsigned i = 0, e = TempVTs.
size(); i != e; ++i) {
174 uint64_t Off = TempOffsets[i];
183 if (EltVT ==
MVT::f16 && NumElts % 2 == 0) {
187 for (
unsigned j = 0; j != NumElts; ++j) {
216 if (AccessSize > ParamAlignment)
219 if (Offsets[Idx] & (AccessSize - 1))
222 EVT EltVT = ValueVTs[Idx];
226 if (EltSize >= AccessSize)
229 unsigned NumElts = AccessSize / EltSize;
231 if (AccessSize != EltSize * NumElts)
235 if (Idx + NumElts > ValueVTs.
size())
239 if (NumElts != 4 && NumElts != 2)
242 for (
unsigned j = Idx + 1; j < Idx + NumElts; ++j) {
244 if (ValueVTs[j] != EltVT)
248 if (Offsets[j] - Offsets[j - 1] != EltSize)
276 unsigned ParamAlignment) {
283 for (
int I = 0,
E = ValueVTs.
size();
I !=
E; ++
I) {
286 for (
unsigned AccessSize : {16, 8, 4, 2}) {
288 I, AccessSize, ValueVTs, Offsets, ParamAlignment);
297 assert(
I + 1 <
E &&
"Not enough elements.");
303 assert(
I + 3 <
E &&
"Not enough elements.");
587 return "NVPTXISD::CALL";
589 return "NVPTXISD::RET_FLAG";
591 return "NVPTXISD::LOAD_PARAM";
593 return "NVPTXISD::Wrapper";
595 return "NVPTXISD::DeclareParam";
597 return "NVPTXISD::DeclareScalarParam";
599 return "NVPTXISD::DeclareRet";
601 return "NVPTXISD::DeclareScalarRet";
603 return "NVPTXISD::DeclareRetParam";
605 return "NVPTXISD::PrintCall";
607 return "NVPTXISD::PrintConvergentCall";
609 return "NVPTXISD::PrintCallUni";
611 return "NVPTXISD::PrintConvergentCallUni";
613 return "NVPTXISD::LoadParam";
615 return "NVPTXISD::LoadParamV2";
617 return "NVPTXISD::LoadParamV4";
619 return "NVPTXISD::StoreParam";
621 return "NVPTXISD::StoreParamV2";
623 return "NVPTXISD::StoreParamV4";
625 return "NVPTXISD::StoreParamS32";
627 return "NVPTXISD::StoreParamU32";
629 return "NVPTXISD::CallArgBegin";
631 return "NVPTXISD::CallArg";
633 return "NVPTXISD::LastCallArg";
635 return "NVPTXISD::CallArgEnd";
637 return "NVPTXISD::CallVoid";
639 return "NVPTXISD::CallVal";
641 return "NVPTXISD::CallSymbol";
643 return "NVPTXISD::Prototype";
645 return "NVPTXISD::MoveParam";
647 return "NVPTXISD::StoreRetval";
649 return "NVPTXISD::StoreRetvalV2";
651 return "NVPTXISD::StoreRetvalV4";
653 return "NVPTXISD::PseudoUseParam";
655 return "NVPTXISD::RETURN";
657 return "NVPTXISD::CallSeqBegin";
659 return "NVPTXISD::CallSeqEnd";
661 return "NVPTXISD::CallPrototype";
663 return "NVPTXISD::LoadV2";
665 return "NVPTXISD::LoadV4";
667 return "NVPTXISD::LDGV2";
669 return "NVPTXISD::LDGV4";
671 return "NVPTXISD::LDUV2";
673 return "NVPTXISD::LDUV4";
675 return "NVPTXISD::StoreV2";
677 return "NVPTXISD::StoreV4";
679 return "NVPTXISD::FUN_SHFL_CLAMP";
681 return "NVPTXISD::FUN_SHFR_CLAMP";
683 return "NVPTXISD::IMAD";
685 return "NVPTXISD::SETP_F16X2";
687 return "NVPTXISD::Dummy";
689 return "NVPTXISD::MUL_WIDE_SIGNED";
691 return "NVPTXISD::MUL_WIDE_UNSIGNED";
695 return "NVPTXISD::Tex1DFloatFloatLevel";
697 return "NVPTXISD::Tex1DFloatFloatGrad";
701 return "NVPTXISD::Tex1DS32FloatLevel";
703 return "NVPTXISD::Tex1DS32FloatGrad";
707 return "NVPTXISD::Tex1DU32FloatLevel";
709 return "NVPTXISD::Tex1DU32FloatGrad";
713 return "NVPTXISD::Tex1DArrayFloatFloatLevel";
715 return "NVPTXISD::Tex1DArrayFloatFloatGrad";
719 return "NVPTXISD::Tex1DArrayS32FloatLevel";
721 return "NVPTXISD::Tex1DArrayS32FloatGrad";
725 return "NVPTXISD::Tex1DArrayU32FloatLevel";
727 return "NVPTXISD::Tex1DArrayU32FloatGrad";
731 return "NVPTXISD::Tex2DFloatFloatLevel";
733 return "NVPTXISD::Tex2DFloatFloatGrad";
737 return "NVPTXISD::Tex2DS32FloatLevel";
739 return "NVPTXISD::Tex2DS32FloatGrad";
743 return "NVPTXISD::Tex2DU32FloatLevel";
745 return "NVPTXISD::Tex2DU32FloatGrad";
749 return "NVPTXISD::Tex2DArrayFloatFloatLevel";
751 return "NVPTXISD::Tex2DArrayFloatFloatGrad";
755 return "NVPTXISD::Tex2DArrayS32FloatLevel";
757 return "NVPTXISD::Tex2DArrayS32FloatGrad";
761 return "NVPTXISD::Tex2DArrayU32FloatLevel";
763 return "NVPTXISD::Tex2DArrayU32FloatGrad";
767 return "NVPTXISD::Tex3DFloatFloatLevel";
769 return "NVPTXISD::Tex3DFloatFloatGrad";
773 return "NVPTXISD::Tex3DS32FloatLevel";
775 return "NVPTXISD::Tex3DS32FloatGrad";
779 return "NVPTXISD::Tex3DU32FloatLevel";
781 return "NVPTXISD::Tex3DU32FloatGrad";
784 return "NVPTXISD::TexCubeFloatFloatLevel";
787 return "NVPTXISD::TexCubeS32FloatLevel";
790 return "NVPTXISD::TexCubeU32FloatLevel";
792 return "NVPTXISD::TexCubeArrayFloatFloat";
794 return "NVPTXISD::TexCubeArrayFloatFloatLevel";
796 return "NVPTXISD::TexCubeArrayS32Float";
798 return "NVPTXISD::TexCubeArrayS32FloatLevel";
800 return "NVPTXISD::TexCubeArrayU32Float";
802 return "NVPTXISD::TexCubeArrayU32FloatLevel";
804 return "NVPTXISD::Tld4R2DFloatFloat";
806 return "NVPTXISD::Tld4G2DFloatFloat";
808 return "NVPTXISD::Tld4B2DFloatFloat";
810 return "NVPTXISD::Tld4A2DFloatFloat";
812 return "NVPTXISD::Tld4R2DS64Float";
814 return "NVPTXISD::Tld4G2DS64Float";
816 return "NVPTXISD::Tld4B2DS64Float";
818 return "NVPTXISD::Tld4A2DS64Float";
820 return "NVPTXISD::Tld4R2DU64Float";
822 return "NVPTXISD::Tld4G2DU64Float";
824 return "NVPTXISD::Tld4B2DU64Float";
826 return "NVPTXISD::Tld4A2DU64Float";
829 return "NVPTXISD::TexUnified1DFloatS32";
831 return "NVPTXISD::TexUnified1DFloatFloat";
833 return "NVPTXISD::TexUnified1DFloatFloatLevel";
835 return "NVPTXISD::TexUnified1DFloatFloatGrad";
837 return "NVPTXISD::TexUnified1DS32S32";
839 return "NVPTXISD::TexUnified1DS32Float";
841 return "NVPTXISD::TexUnified1DS32FloatLevel";
843 return "NVPTXISD::TexUnified1DS32FloatGrad";
845 return "NVPTXISD::TexUnified1DU32S32";
847 return "NVPTXISD::TexUnified1DU32Float";
849 return "NVPTXISD::TexUnified1DU32FloatLevel";
851 return "NVPTXISD::TexUnified1DU32FloatGrad";
853 return "NVPTXISD::TexUnified1DArrayFloatS32";
855 return "NVPTXISD::TexUnified1DArrayFloatFloat";
857 return "NVPTXISD::TexUnified1DArrayFloatFloatLevel";
859 return "NVPTXISD::TexUnified1DArrayFloatFloatGrad";
861 return "NVPTXISD::TexUnified1DArrayS32S32";
863 return "NVPTXISD::TexUnified1DArrayS32Float";
865 return "NVPTXISD::TexUnified1DArrayS32FloatLevel";
867 return "NVPTXISD::TexUnified1DArrayS32FloatGrad";
869 return "NVPTXISD::TexUnified1DArrayU32S32";
871 return "NVPTXISD::TexUnified1DArrayU32Float";
873 return "NVPTXISD::TexUnified1DArrayU32FloatLevel";
875 return "NVPTXISD::TexUnified1DArrayU32FloatGrad";
877 return "NVPTXISD::TexUnified2DFloatS32";
879 return "NVPTXISD::TexUnified2DFloatFloat";
881 return "NVPTXISD::TexUnified2DFloatFloatLevel";
883 return "NVPTXISD::TexUnified2DFloatFloatGrad";
885 return "NVPTXISD::TexUnified2DS32S32";
887 return "NVPTXISD::TexUnified2DS32Float";
889 return "NVPTXISD::TexUnified2DS32FloatLevel";
891 return "NVPTXISD::TexUnified2DS32FloatGrad";
893 return "NVPTXISD::TexUnified2DU32S32";
895 return "NVPTXISD::TexUnified2DU32Float";
897 return "NVPTXISD::TexUnified2DU32FloatLevel";
899 return "NVPTXISD::TexUnified2DU32FloatGrad";
901 return "NVPTXISD::TexUnified2DArrayFloatS32";
903 return "NVPTXISD::TexUnified2DArrayFloatFloat";
905 return "NVPTXISD::TexUnified2DArrayFloatFloatLevel";
907 return "NVPTXISD::TexUnified2DArrayFloatFloatGrad";
909 return "NVPTXISD::TexUnified2DArrayS32S32";
911 return "NVPTXISD::TexUnified2DArrayS32Float";
913 return "NVPTXISD::TexUnified2DArrayS32FloatLevel";
915 return "NVPTXISD::TexUnified2DArrayS32FloatGrad";
917 return "NVPTXISD::TexUnified2DArrayU32S32";
919 return "NVPTXISD::TexUnified2DArrayU32Float";
921 return "NVPTXISD::TexUnified2DArrayU32FloatLevel";
923 return "NVPTXISD::TexUnified2DArrayU32FloatGrad";
925 return "NVPTXISD::TexUnified3DFloatS32";
927 return "NVPTXISD::TexUnified3DFloatFloat";
929 return "NVPTXISD::TexUnified3DFloatFloatLevel";
931 return "NVPTXISD::TexUnified3DFloatFloatGrad";
933 return "NVPTXISD::TexUnified3DS32S32";
935 return "NVPTXISD::TexUnified3DS32Float";
937 return "NVPTXISD::TexUnified3DS32FloatLevel";
939 return "NVPTXISD::TexUnified3DS32FloatGrad";
941 return "NVPTXISD::TexUnified3DU32S32";
943 return "NVPTXISD::TexUnified3DU32Float";
945 return "NVPTXISD::TexUnified3DU32FloatLevel";
947 return "NVPTXISD::TexUnified3DU32FloatGrad";
949 return "NVPTXISD::TexUnifiedCubeFloatFloat";
951 return "NVPTXISD::TexUnifiedCubeFloatFloatLevel";
953 return "NVPTXISD::TexUnifiedCubeS32Float";
955 return "NVPTXISD::TexUnifiedCubeS32FloatLevel";
957 return "NVPTXISD::TexUnifiedCubeU32Float";
959 return "NVPTXISD::TexUnifiedCubeU32FloatLevel";
961 return "NVPTXISD::TexUnifiedCubeArrayFloatFloat";
963 return "NVPTXISD::TexUnifiedCubeArrayFloatFloatLevel";
965 return "NVPTXISD::TexUnifiedCubeArrayS32Float";
967 return "NVPTXISD::TexUnifiedCubeArrayS32FloatLevel";
969 return "NVPTXISD::TexUnifiedCubeArrayU32Float";
971 return "NVPTXISD::TexUnifiedCubeArrayU32FloatLevel";
973 return "NVPTXISD::Tld4UnifiedR2DFloatFloat";
975 return "NVPTXISD::Tld4UnifiedG2DFloatFloat";
977 return "NVPTXISD::Tld4UnifiedB2DFloatFloat";
979 return "NVPTXISD::Tld4UnifiedA2DFloatFloat";
981 return "NVPTXISD::Tld4UnifiedR2DS64Float";
983 return "NVPTXISD::Tld4UnifiedG2DS64Float";
985 return "NVPTXISD::Tld4UnifiedB2DS64Float";
987 return "NVPTXISD::Tld4UnifiedA2DS64Float";
989 return "NVPTXISD::Tld4UnifiedR2DU64Float";
991 return "NVPTXISD::Tld4UnifiedG2DU64Float";
993 return "NVPTXISD::Tld4UnifiedB2DU64Float";
995 return "NVPTXISD::Tld4UnifiedA2DU64Float";
1192 bool Reciprocal)
const {
1194 (Enabled == ReciprocalEstimate::Unspecified && !
usePrecSqrtF32())))
1197 if (ExtraSteps == ReciprocalEstimate::Unspecified)
1213 if (Reciprocal || ExtraSteps > 0) {
1215 return MakeIntrinsicCall(Ftz ? Intrinsic::nvvm_rsqrt_approx_ftz_f
1216 : Intrinsic::nvvm_rsqrt_approx_f);
1218 return MakeIntrinsicCall(Intrinsic::nvvm_rsqrt_approx_d);
1223 return MakeIntrinsicCall(Ftz ? Intrinsic::nvvm_sqrt_approx_ftz_f
1224 : Intrinsic::nvvm_sqrt_approx_f);
1233 MakeIntrinsicCall(Intrinsic::nvvm_rsqrt_approx_d));
1241 const GlobalValue *GV = cast<GlobalAddressSDNode>(
Op)->getGlobal();
1254 assert(isABI &&
"Non-ABI compilation is not supported");
1258 std::stringstream O;
1267 if (
auto *ITy = dyn_cast<IntegerType>(retTy)) {
1268 size = ITy->getBitWidth();
1271 "Floating point type expected here");
1280 O <<
".param .b" << size <<
" _";
1281 }
else if (isa<PointerType>(retTy)) {
1282 O <<
".param .b" << PtrVT.getSizeInBits() <<
" _";
1285 O <<
".param .align " << retAlignment <<
" .b8 _["
1297 for (
unsigned i = 0, e = Args.size(); i != e; ++i, ++OIdx) {
1298 Type *Ty = Args[i].Ty;
1304 if (!Outs[OIdx].
Flags.isByVal()) {
1309 if (!
getAlign(*CallI, i + 1, align))
1312 O <<
".param .align " << align <<
" .b8 ";
1314 O <<
"[" << sz <<
"]";
1318 if (
unsigned len = vtparts.
size())
1325 "type mismatch between callee prototype and arguments");
1328 if (isa<IntegerType>(Ty)) {
1332 }
else if (isa<PointerType>(Ty)) {
1333 sz = PtrVT.getSizeInBits();
1341 O <<
".param .b" << sz <<
" ";
1346 assert(PTy &&
"Param with byval attribute should be a pointer type");
1347 Type *ETy = PTy->getElementType();
1349 unsigned align = Outs[OIdx].Flags.getByValAlign();
1351 O <<
".param .align " << align <<
" .b8 ";
1353 O <<
"[" << sz <<
"]";
1359 unsigned NVPTXTargetLowering::getArgumentAlignment(
SDValue Callee,
1361 Type *Ty,
unsigned Idx,
1371 if (!DirectCallee) {
1375 assert(CalleeI &&
"Call target is not a function or derived value?");
1378 if (isa<CallInst>(CalleeI)) {
1380 if (
getAlign(*cast<CallInst>(CalleeI), Idx, Align))
1383 const Value *CalleeV = cast<CallInst>(CalleeI)->getCalledValue();
1385 while (isa<ConstantExpr>(CalleeV)) {
1390 CalleeV = cast<ConstantExpr>(CalleeV)->getOperand(0);
1395 if (isa<Function>(CalleeV))
1396 DirectCallee = CalleeV;
1403 if (
getAlign(*cast<Function>(DirectCallee), Idx, Align))
1427 assert(isABI &&
"Non-ABI compilation is not supported");
1435 unsigned paramCount = 0;
1448 for (
unsigned i = 0, e = Args.size(); i != e; ++i, ++OIdx) {
1449 EVT VT = Outs[OIdx].VT;
1450 Type *Ty = Args[i].Ty;
1452 if (!Outs[OIdx].
Flags.isByVal()) {
1457 getArgumentAlignment(Callee, CS, Ty, paramCount + 1, DL);
1478 SDValue DeclareScalarParamOps[] = {
1483 DeclareScalarParamOps);
1492 bool ExtendIntegerParam =
1497 for (
unsigned j = 0, je = VTs.
size(); j != je; ++j) {
1500 assert(StoreOperands.
empty() &&
"Unfinished preceeding store.");
1507 SDValue StVal = OutVals[OIdx];
1508 if (ExtendIntegerParam) {
1509 assert(VTs.
size() == 1 &&
"Scalar can't have multiple parts.");
1524 unsigned NumElts = StoreOperands.
size() - 3;
1544 EVT TheStoreType = ExtendIntegerParam ?
MVT::i32 : VTs[j];
1556 StoreOperands.
clear();
1560 assert(StoreOperands.
empty() &&
"Unfinished parameter store.");
1571 assert(PTy &&
"Type of a byval parameter should be pointer");
1575 unsigned sz = Outs[OIdx].Flags.getByValSize();
1577 unsigned ArgAlign = Outs[OIdx].Flags.getByValAlign();
1593 for (
unsigned j = 0, je = VTs.
size(); j != je; ++j) {
1594 EVT elemtype = VTs[j];
1595 int curOffset = Offsets[j];
1606 SDValue CopyParamOps[] = { Chain,
1611 CopyParamOps, elemtype,
1622 unsigned retAlignment = 0;
1625 if (Ins.
size() > 0) {
1650 retAlignment = getArgumentAlignment(Callee, CS, RetTy, 0, DL);
1652 SDValue DeclareRetOps[] = { Chain,
1671 std::string Proto =
getPrototype(DL, RetTy, Args, Outs, retAlignment, CS);
1672 const char *ProtoStr =
1690 Chain = DAG.
getNode(Opcode, dl, PrintCallVTs, PrintCallOps);
1695 SDValue CallVoidOps[] = { Chain, Callee, InFlag };
1701 SDValue CallArgBeginOps[] = { Chain, InFlag };
1706 for (
unsigned i = 0, e = paramCount; i != e; ++i) {
1715 Chain = DAG.
getNode(opcode, dl, CallArgVTs, CallArgOps);
1719 SDValue CallArgEndOps[] = { Chain,
1727 SDValue PrototypeOps[] = { Chain,
1735 if (Ins.
size() > 0) {
1741 unsigned RetAlign = getArgumentAlignment(Callee, CS, RetTy, 0, DL);
1750 bool ExtendIntegerRetVal =
1753 for (
unsigned i = 0, e = VTs.
size(); i != e; ++i) {
1754 bool needTruncate =
false;
1755 EVT TheLoadType = VTs[i];
1756 EVT EltType = Ins[i].VT;
1758 if (ExtendIntegerRetVal) {
1761 needTruncate =
true;
1763 if (VTs[i].isInteger())
1764 needTruncate =
true;
1770 assert(VecIdx == -1 && LoadVTs.
empty() &&
"Orphaned operand list.");
1777 unsigned NumElts = LoadVTs.
size();
1799 Op, dl, DAG.
getVTList(LoadVTs), LoadOperands, TheLoadType,
1803 for (
unsigned j = 0; j < NumElts; ++j) {
1810 InFlag = RetVal.
getValue(NumElts + 1);
1841 for (
unsigned i = 0; i < NumOperands; ++i) {
1846 for (
unsigned j = 0; j < NumSubElem; ++j) {
1873 cast<ConstantFPSDNode>(Op->
getOperand(0))->getValueAPF().bitcastToAPInt();
1875 cast<ConstantFPSDNode>(Op->
getOperand(1))->getValueAPF().bitcastToAPInt();
1885 if (isa<ConstantSDNode>(Index.
getNode()))
1975 unsigned VTBits = VT.getSizeInBits();
2036 return LowerBUILD_VECTOR(Op, DAG);
2040 return LowerEXTRACT_VECTOR_ELT(Op, DAG);
2042 return LowerCONCAT_VECTORS(Op, DAG);
2044 return LowerSTORE(Op, DAG);
2046 return LowerLOAD(Op, DAG);
2048 return LowerShiftLeftParts(Op, DAG);
2051 return LowerShiftRightParts(Op, DAG);
2053 return LowerSelect(Op, DAG);
2077 return LowerLOADi1(Op, DAG);
2105 "Custom lowering for i1 load only");
2122 return LowerSTOREi1(Op, DAG);
2132 return LowerSTOREVector(Op, DAG);
2174 unsigned PrefAlign =
2176 if (Align < PrefAlign) {
2185 unsigned Opcode = 0;
2192 bool NeedExt =
false;
2196 bool StoreF16x2 =
false;
2224 for (
unsigned i = 0; i < NumElts; ++i) {
2234 for (
unsigned i = 0; i < NumElts; ++i) {
2277 NVPTXTargetLowering::getParamSymbol(
SelectionDAG &DAG,
int idx,
EVT v)
const {
2278 std::string ParamSym;
2284 std::string *SavedStr =
2292 static const char *
const specialTypes[] = {
"struct._image2d_t",
2293 "struct._image3d_t",
2294 "struct._sampler_t" };
2306 if (!STy || STy->isLiteral())
2310 STy->getName()) !=
std::end(specialTypes);
2326 std::vector<SDValue> OutChains;
2329 assert(isABI &&
"Non-ABI compilation is not supported");
2333 std::vector<Type *> argTypes;
2334 std::vector<const Argument *> theArgs;
2336 theArgs.push_back(&
I);
2337 argTypes.push_back(
I.getType());
2348 unsigned InsIdx = 0;
2351 for (
unsigned i = 0, e = theArgs.size(); i != e; ++i, ++idx, ++InsIdx) {
2352 Type *Ty = argTypes[i];
2362 "Only kernels can have image/sampler params");
2367 if (theArgs[i]->use_empty()) {
2373 assert(vtparts.
size() > 0 &&
"empty aggregate type not expected");
2374 for (
unsigned parti = 0, parte = vtparts.
size(); parti != parte;
2379 if (vtparts.
size() > 0)
2386 for (
unsigned parti = 0; parti < NumRegs; ++parti) {
2403 bool aggregateIsPacked =
false;
2404 if (
StructType *STy = dyn_cast<StructType>(Ty))
2405 aggregateIsPacked = STy->isPacked();
2410 assert(VTs.
size() > 0 &&
"Unexpected empty type.");
2414 SDValue Arg = getParamSymbol(DAG, idx, PtrVT);
2416 for (
unsigned parti = 0, parte = VTs.
size(); parti != parte; ++parti) {
2418 assert(VecIdx == -1 &&
"Orphaned vector.");
2423 if (VectorInfo[parti] &
PVF_LAST) {
2424 unsigned NumElts = parti - VecIdx + 1;
2425 EVT EltVT = VTs[parti];
2443 DAG.
getLoad(VecVT, dl, Root, VecAddr,
2449 for (
unsigned j = 0; j < NumElts; ++j) {
2460 if (Ins[InsIdx].VT.isInteger() &&
2464 Elt = DAG.
getNode(Extend, dl, Ins[InsIdx].VT, Elt);
2487 assert(ObjectVT == Ins[InsIdx].VT &&
2488 "Ins type did not match function type");
2489 SDValue Arg = getParamSymbol(DAG, idx, PtrVT);
2504 if (!OutChains.empty())
2520 assert(isABI &&
"Non-ABI compilation is not supported");
2528 assert(VTs.
size() == OutVals.
size() &&
"Bad return value decomposition");
2536 bool ExtendIntegerRetVal =
2540 for (
unsigned i = 0, e = VTs.
size(); i != e; ++i) {
2543 assert(StoreOperands.
empty() &&
"Orphaned operand list.");
2549 if (ExtendIntegerRetVal) {
2565 unsigned NumElts = StoreOperands.
size() - 2;
2582 EVT TheStoreType = ExtendIntegerRetVal ?
MVT::i32 : VTs[i];
2584 StoreOperands, TheStoreType,
2589 StoreOperands.
clear();
2597 SDValue Op, std::string &Constraint, std::vector<SDValue> &Ops,
2599 if (Constraint.length() > 1)
2606 switch (Intrinsic) {
2610 case Intrinsic::nvvm_tex_1d_v4f32_s32:
2612 case Intrinsic::nvvm_tex_1d_v4f32_f32:
2614 case Intrinsic::nvvm_tex_1d_level_v4f32_f32:
2616 case Intrinsic::nvvm_tex_1d_grad_v4f32_f32:
2618 case Intrinsic::nvvm_tex_1d_v4s32_s32:
2620 case Intrinsic::nvvm_tex_1d_v4s32_f32:
2622 case Intrinsic::nvvm_tex_1d_level_v4s32_f32:
2624 case Intrinsic::nvvm_tex_1d_grad_v4s32_f32:
2626 case Intrinsic::nvvm_tex_1d_v4u32_s32:
2628 case Intrinsic::nvvm_tex_1d_v4u32_f32:
2630 case Intrinsic::nvvm_tex_1d_level_v4u32_f32:
2632 case Intrinsic::nvvm_tex_1d_grad_v4u32_f32:
2635 case Intrinsic::nvvm_tex_1d_array_v4f32_s32:
2637 case Intrinsic::nvvm_tex_1d_array_v4f32_f32:
2639 case Intrinsic::nvvm_tex_1d_array_level_v4f32_f32:
2641 case Intrinsic::nvvm_tex_1d_array_grad_v4f32_f32:
2643 case Intrinsic::nvvm_tex_1d_array_v4s32_s32:
2645 case Intrinsic::nvvm_tex_1d_array_v4s32_f32:
2647 case Intrinsic::nvvm_tex_1d_array_level_v4s32_f32:
2649 case Intrinsic::nvvm_tex_1d_array_grad_v4s32_f32:
2651 case Intrinsic::nvvm_tex_1d_array_v4u32_s32:
2653 case Intrinsic::nvvm_tex_1d_array_v4u32_f32:
2655 case Intrinsic::nvvm_tex_1d_array_level_v4u32_f32:
2657 case Intrinsic::nvvm_tex_1d_array_grad_v4u32_f32:
2660 case Intrinsic::nvvm_tex_2d_v4f32_s32:
2662 case Intrinsic::nvvm_tex_2d_v4f32_f32:
2664 case Intrinsic::nvvm_tex_2d_level_v4f32_f32:
2666 case Intrinsic::nvvm_tex_2d_grad_v4f32_f32:
2668 case Intrinsic::nvvm_tex_2d_v4s32_s32:
2670 case Intrinsic::nvvm_tex_2d_v4s32_f32:
2672 case Intrinsic::nvvm_tex_2d_level_v4s32_f32:
2674 case Intrinsic::nvvm_tex_2d_grad_v4s32_f32:
2676 case Intrinsic::nvvm_tex_2d_v4u32_s32:
2678 case Intrinsic::nvvm_tex_2d_v4u32_f32:
2680 case Intrinsic::nvvm_tex_2d_level_v4u32_f32:
2682 case Intrinsic::nvvm_tex_2d_grad_v4u32_f32:
2685 case Intrinsic::nvvm_tex_2d_array_v4f32_s32:
2687 case Intrinsic::nvvm_tex_2d_array_v4f32_f32:
2689 case Intrinsic::nvvm_tex_2d_array_level_v4f32_f32:
2691 case Intrinsic::nvvm_tex_2d_array_grad_v4f32_f32:
2693 case Intrinsic::nvvm_tex_2d_array_v4s32_s32:
2695 case Intrinsic::nvvm_tex_2d_array_v4s32_f32:
2697 case Intrinsic::nvvm_tex_2d_array_level_v4s32_f32:
2699 case Intrinsic::nvvm_tex_2d_array_grad_v4s32_f32:
2701 case Intrinsic::nvvm_tex_2d_array_v4u32_s32:
2703 case Intrinsic::nvvm_tex_2d_array_v4u32_f32:
2705 case Intrinsic::nvvm_tex_2d_array_level_v4u32_f32:
2707 case Intrinsic::nvvm_tex_2d_array_grad_v4u32_f32:
2710 case Intrinsic::nvvm_tex_3d_v4f32_s32:
2712 case Intrinsic::nvvm_tex_3d_v4f32_f32:
2714 case Intrinsic::nvvm_tex_3d_level_v4f32_f32:
2716 case Intrinsic::nvvm_tex_3d_grad_v4f32_f32:
2718 case Intrinsic::nvvm_tex_3d_v4s32_s32:
2720 case Intrinsic::nvvm_tex_3d_v4s32_f32:
2722 case Intrinsic::nvvm_tex_3d_level_v4s32_f32:
2724 case Intrinsic::nvvm_tex_3d_grad_v4s32_f32:
2726 case Intrinsic::nvvm_tex_3d_v4u32_s32:
2728 case Intrinsic::nvvm_tex_3d_v4u32_f32:
2730 case Intrinsic::nvvm_tex_3d_level_v4u32_f32:
2732 case Intrinsic::nvvm_tex_3d_grad_v4u32_f32:
2735 case Intrinsic::nvvm_tex_cube_v4f32_f32:
2737 case Intrinsic::nvvm_tex_cube_level_v4f32_f32:
2739 case Intrinsic::nvvm_tex_cube_v4s32_f32:
2741 case Intrinsic::nvvm_tex_cube_level_v4s32_f32:
2743 case Intrinsic::nvvm_tex_cube_v4u32_f32:
2745 case Intrinsic::nvvm_tex_cube_level_v4u32_f32:
2748 case Intrinsic::nvvm_tex_cube_array_v4f32_f32:
2750 case Intrinsic::nvvm_tex_cube_array_level_v4f32_f32:
2752 case Intrinsic::nvvm_tex_cube_array_v4s32_f32:
2754 case Intrinsic::nvvm_tex_cube_array_level_v4s32_f32:
2756 case Intrinsic::nvvm_tex_cube_array_v4u32_f32:
2758 case Intrinsic::nvvm_tex_cube_array_level_v4u32_f32:
2761 case Intrinsic::nvvm_tld4_r_2d_v4f32_f32:
2763 case Intrinsic::nvvm_tld4_g_2d_v4f32_f32:
2765 case Intrinsic::nvvm_tld4_b_2d_v4f32_f32:
2767 case Intrinsic::nvvm_tld4_a_2d_v4f32_f32:
2769 case Intrinsic::nvvm_tld4_r_2d_v4s32_f32:
2771 case Intrinsic::nvvm_tld4_g_2d_v4s32_f32:
2773 case Intrinsic::nvvm_tld4_b_2d_v4s32_f32:
2775 case Intrinsic::nvvm_tld4_a_2d_v4s32_f32:
2777 case Intrinsic::nvvm_tld4_r_2d_v4u32_f32:
2779 case Intrinsic::nvvm_tld4_g_2d_v4u32_f32:
2781 case Intrinsic::nvvm_tld4_b_2d_v4u32_f32:
2783 case Intrinsic::nvvm_tld4_a_2d_v4u32_f32:
2786 case Intrinsic::nvvm_tex_unified_1d_v4f32_s32:
2788 case Intrinsic::nvvm_tex_unified_1d_v4f32_f32:
2790 case Intrinsic::nvvm_tex_unified_1d_level_v4f32_f32:
2792 case Intrinsic::nvvm_tex_unified_1d_grad_v4f32_f32:
2794 case Intrinsic::nvvm_tex_unified_1d_v4s32_s32:
2796 case Intrinsic::nvvm_tex_unified_1d_v4s32_f32:
2798 case Intrinsic::nvvm_tex_unified_1d_level_v4s32_f32:
2800 case Intrinsic::nvvm_tex_unified_1d_grad_v4s32_f32:
2802 case Intrinsic::nvvm_tex_unified_1d_v4u32_s32:
2804 case Intrinsic::nvvm_tex_unified_1d_v4u32_f32:
2806 case Intrinsic::nvvm_tex_unified_1d_level_v4u32_f32:
2808 case Intrinsic::nvvm_tex_unified_1d_grad_v4u32_f32:
2811 case Intrinsic::nvvm_tex_unified_1d_array_v4f32_s32:
2813 case Intrinsic::nvvm_tex_unified_1d_array_v4f32_f32:
2815 case Intrinsic::nvvm_tex_unified_1d_array_level_v4f32_f32:
2817 case Intrinsic::nvvm_tex_unified_1d_array_grad_v4f32_f32:
2819 case Intrinsic::nvvm_tex_unified_1d_array_v4s32_s32:
2821 case Intrinsic::nvvm_tex_unified_1d_array_v4s32_f32:
2823 case Intrinsic::nvvm_tex_unified_1d_array_level_v4s32_f32:
2825 case Intrinsic::nvvm_tex_unified_1d_array_grad_v4s32_f32:
2827 case Intrinsic::nvvm_tex_unified_1d_array_v4u32_s32:
2829 case Intrinsic::nvvm_tex_unified_1d_array_v4u32_f32:
2831 case Intrinsic::nvvm_tex_unified_1d_array_level_v4u32_f32:
2833 case Intrinsic::nvvm_tex_unified_1d_array_grad_v4u32_f32:
2836 case Intrinsic::nvvm_tex_unified_2d_v4f32_s32:
2838 case Intrinsic::nvvm_tex_unified_2d_v4f32_f32:
2840 case Intrinsic::nvvm_tex_unified_2d_level_v4f32_f32:
2842 case Intrinsic::nvvm_tex_unified_2d_grad_v4f32_f32:
2844 case Intrinsic::nvvm_tex_unified_2d_v4s32_s32:
2846 case Intrinsic::nvvm_tex_unified_2d_v4s32_f32:
2848 case Intrinsic::nvvm_tex_unified_2d_level_v4s32_f32:
2850 case Intrinsic::nvvm_tex_unified_2d_grad_v4s32_f32:
2852 case Intrinsic::nvvm_tex_unified_2d_v4u32_s32:
2854 case Intrinsic::nvvm_tex_unified_2d_v4u32_f32:
2856 case Intrinsic::nvvm_tex_unified_2d_level_v4u32_f32:
2858 case Intrinsic::nvvm_tex_unified_2d_grad_v4u32_f32:
2861 case Intrinsic::nvvm_tex_unified_2d_array_v4f32_s32:
2863 case Intrinsic::nvvm_tex_unified_2d_array_v4f32_f32:
2865 case Intrinsic::nvvm_tex_unified_2d_array_level_v4f32_f32:
2867 case Intrinsic::nvvm_tex_unified_2d_array_grad_v4f32_f32:
2869 case Intrinsic::nvvm_tex_unified_2d_array_v4s32_s32:
2871 case Intrinsic::nvvm_tex_unified_2d_array_v4s32_f32:
2873 case Intrinsic::nvvm_tex_unified_2d_array_level_v4s32_f32:
2875 case Intrinsic::nvvm_tex_unified_2d_array_grad_v4s32_f32:
2877 case Intrinsic::nvvm_tex_unified_2d_array_v4u32_s32:
2879 case Intrinsic::nvvm_tex_unified_2d_array_v4u32_f32:
2881 case Intrinsic::nvvm_tex_unified_2d_array_level_v4u32_f32:
2883 case Intrinsic::nvvm_tex_unified_2d_array_grad_v4u32_f32:
2886 case Intrinsic::nvvm_tex_unified_3d_v4f32_s32:
2888 case Intrinsic::nvvm_tex_unified_3d_v4f32_f32:
2890 case Intrinsic::nvvm_tex_unified_3d_level_v4f32_f32:
2892 case Intrinsic::nvvm_tex_unified_3d_grad_v4f32_f32:
2894 case Intrinsic::nvvm_tex_unified_3d_v4s32_s32:
2896 case Intrinsic::nvvm_tex_unified_3d_v4s32_f32:
2898 case Intrinsic::nvvm_tex_unified_3d_level_v4s32_f32:
2900 case Intrinsic::nvvm_tex_unified_3d_grad_v4s32_f32:
2902 case Intrinsic::nvvm_tex_unified_3d_v4u32_s32:
2904 case Intrinsic::nvvm_tex_unified_3d_v4u32_f32:
2906 case Intrinsic::nvvm_tex_unified_3d_level_v4u32_f32:
2908 case Intrinsic::nvvm_tex_unified_3d_grad_v4u32_f32:
2911 case Intrinsic::nvvm_tex_unified_cube_v4f32_f32:
2913 case Intrinsic::nvvm_tex_unified_cube_level_v4f32_f32:
2915 case Intrinsic::nvvm_tex_unified_cube_v4s32_f32:
2917 case Intrinsic::nvvm_tex_unified_cube_level_v4s32_f32:
2919 case Intrinsic::nvvm_tex_unified_cube_v4u32_f32:
2921 case Intrinsic::nvvm_tex_unified_cube_level_v4u32_f32:
2924 case Intrinsic::nvvm_tex_unified_cube_array_v4f32_f32:
2926 case Intrinsic::nvvm_tex_unified_cube_array_level_v4f32_f32:
2928 case Intrinsic::nvvm_tex_unified_cube_array_v4s32_f32:
2930 case Intrinsic::nvvm_tex_unified_cube_array_level_v4s32_f32:
2932 case Intrinsic::nvvm_tex_unified_cube_array_v4u32_f32:
2934 case Intrinsic::nvvm_tex_unified_cube_array_level_v4u32_f32:
2937 case Intrinsic::nvvm_tld4_unified_r_2d_v4f32_f32:
2939 case Intrinsic::nvvm_tld4_unified_g_2d_v4f32_f32:
2941 case Intrinsic::nvvm_tld4_unified_b_2d_v4f32_f32:
2943 case Intrinsic::nvvm_tld4_unified_a_2d_v4f32_f32:
2945 case Intrinsic::nvvm_tld4_unified_r_2d_v4s32_f32:
2947 case Intrinsic::nvvm_tld4_unified_g_2d_v4s32_f32:
2949 case Intrinsic::nvvm_tld4_unified_b_2d_v4s32_f32:
2951 case Intrinsic::nvvm_tld4_unified_a_2d_v4s32_f32:
2953 case Intrinsic::nvvm_tld4_unified_r_2d_v4u32_f32:
2955 case Intrinsic::nvvm_tld4_unified_g_2d_v4u32_f32:
2957 case Intrinsic::nvvm_tld4_unified_b_2d_v4u32_f32:
2959 case Intrinsic::nvvm_tld4_unified_a_2d_v4u32_f32:
2965 switch (Intrinsic) {
2968 case Intrinsic::nvvm_suld_1d_i8_clamp:
2970 case Intrinsic::nvvm_suld_1d_i16_clamp:
2972 case Intrinsic::nvvm_suld_1d_i32_clamp:
2974 case Intrinsic::nvvm_suld_1d_i64_clamp:
2976 case Intrinsic::nvvm_suld_1d_v2i8_clamp:
2978 case Intrinsic::nvvm_suld_1d_v2i16_clamp:
2980 case Intrinsic::nvvm_suld_1d_v2i32_clamp:
2982 case Intrinsic::nvvm_suld_1d_v2i64_clamp:
2984 case Intrinsic::nvvm_suld_1d_v4i8_clamp:
2986 case Intrinsic::nvvm_suld_1d_v4i16_clamp:
2988 case Intrinsic::nvvm_suld_1d_v4i32_clamp:
2990 case Intrinsic::nvvm_suld_1d_array_i8_clamp:
2992 case Intrinsic::nvvm_suld_1d_array_i16_clamp:
2994 case Intrinsic::nvvm_suld_1d_array_i32_clamp:
2996 case Intrinsic::nvvm_suld_1d_array_i64_clamp:
2998 case Intrinsic::nvvm_suld_1d_array_v2i8_clamp:
3000 case Intrinsic::nvvm_suld_1d_array_v2i16_clamp:
3002 case Intrinsic::nvvm_suld_1d_array_v2i32_clamp:
3004 case Intrinsic::nvvm_suld_1d_array_v2i64_clamp:
3006 case Intrinsic::nvvm_suld_1d_array_v4i8_clamp:
3008 case Intrinsic::nvvm_suld_1d_array_v4i16_clamp:
3010 case Intrinsic::nvvm_suld_1d_array_v4i32_clamp:
3012 case Intrinsic::nvvm_suld_2d_i8_clamp:
3014 case Intrinsic::nvvm_suld_2d_i16_clamp:
3016 case Intrinsic::nvvm_suld_2d_i32_clamp:
3018 case Intrinsic::nvvm_suld_2d_i64_clamp:
3020 case Intrinsic::nvvm_suld_2d_v2i8_clamp:
3022 case Intrinsic::nvvm_suld_2d_v2i16_clamp:
3024 case Intrinsic::nvvm_suld_2d_v2i32_clamp:
3026 case Intrinsic::nvvm_suld_2d_v2i64_clamp:
3028 case Intrinsic::nvvm_suld_2d_v4i8_clamp:
3030 case Intrinsic::nvvm_suld_2d_v4i16_clamp:
3032 case Intrinsic::nvvm_suld_2d_v4i32_clamp:
3034 case Intrinsic::nvvm_suld_2d_array_i8_clamp:
3036 case Intrinsic::nvvm_suld_2d_array_i16_clamp:
3038 case Intrinsic::nvvm_suld_2d_array_i32_clamp:
3040 case Intrinsic::nvvm_suld_2d_array_i64_clamp:
3042 case Intrinsic::nvvm_suld_2d_array_v2i8_clamp:
3044 case Intrinsic::nvvm_suld_2d_array_v2i16_clamp:
3046 case Intrinsic::nvvm_suld_2d_array_v2i32_clamp:
3048 case Intrinsic::nvvm_suld_2d_array_v2i64_clamp:
3050 case Intrinsic::nvvm_suld_2d_array_v4i8_clamp:
3052 case Intrinsic::nvvm_suld_2d_array_v4i16_clamp:
3054 case Intrinsic::nvvm_suld_2d_array_v4i32_clamp:
3056 case Intrinsic::nvvm_suld_3d_i8_clamp:
3058 case Intrinsic::nvvm_suld_3d_i16_clamp:
3060 case Intrinsic::nvvm_suld_3d_i32_clamp:
3062 case Intrinsic::nvvm_suld_3d_i64_clamp:
3064 case Intrinsic::nvvm_suld_3d_v2i8_clamp:
3066 case Intrinsic::nvvm_suld_3d_v2i16_clamp:
3068 case Intrinsic::nvvm_suld_3d_v2i32_clamp:
3070 case Intrinsic::nvvm_suld_3d_v2i64_clamp:
3072 case Intrinsic::nvvm_suld_3d_v4i8_clamp:
3074 case Intrinsic::nvvm_suld_3d_v4i16_clamp:
3076 case Intrinsic::nvvm_suld_3d_v4i32_clamp:
3078 case Intrinsic::nvvm_suld_1d_i8_trap:
3080 case Intrinsic::nvvm_suld_1d_i16_trap:
3082 case Intrinsic::nvvm_suld_1d_i32_trap:
3084 case Intrinsic::nvvm_suld_1d_i64_trap:
3086 case Intrinsic::nvvm_suld_1d_v2i8_trap:
3088 case Intrinsic::nvvm_suld_1d_v2i16_trap:
3090 case Intrinsic::nvvm_suld_1d_v2i32_trap:
3092 case Intrinsic::nvvm_suld_1d_v2i64_trap:
3094 case Intrinsic::nvvm_suld_1d_v4i8_trap:
3096 case Intrinsic::nvvm_suld_1d_v4i16_trap:
3098 case Intrinsic::nvvm_suld_1d_v4i32_trap:
3100 case Intrinsic::nvvm_suld_1d_array_i8_trap:
3102 case Intrinsic::nvvm_suld_1d_array_i16_trap:
3104 case Intrinsic::nvvm_suld_1d_array_i32_trap:
3106 case Intrinsic::nvvm_suld_1d_array_i64_trap:
3108 case Intrinsic::nvvm_suld_1d_array_v2i8_trap:
3110 case Intrinsic::nvvm_suld_1d_array_v2i16_trap:
3112 case Intrinsic::nvvm_suld_1d_array_v2i32_trap:
3114 case Intrinsic::nvvm_suld_1d_array_v2i64_trap:
3116 case Intrinsic::nvvm_suld_1d_array_v4i8_trap:
3118 case Intrinsic::nvvm_suld_1d_array_v4i16_trap:
3120 case Intrinsic::nvvm_suld_1d_array_v4i32_trap:
3122 case Intrinsic::nvvm_suld_2d_i8_trap:
3124 case Intrinsic::nvvm_suld_2d_i16_trap:
3126 case Intrinsic::nvvm_suld_2d_i32_trap:
3128 case Intrinsic::nvvm_suld_2d_i64_trap:
3130 case Intrinsic::nvvm_suld_2d_v2i8_trap:
3132 case Intrinsic::nvvm_suld_2d_v2i16_trap:
3134 case Intrinsic::nvvm_suld_2d_v2i32_trap:
3136 case Intrinsic::nvvm_suld_2d_v2i64_trap:
3138 case Intrinsic::nvvm_suld_2d_v4i8_trap:
3140 case Intrinsic::nvvm_suld_2d_v4i16_trap:
3142 case Intrinsic::nvvm_suld_2d_v4i32_trap:
3144 case Intrinsic::nvvm_suld_2d_array_i8_trap:
3146 case Intrinsic::nvvm_suld_2d_array_i16_trap:
3148 case Intrinsic::nvvm_suld_2d_array_i32_trap:
3150 case Intrinsic::nvvm_suld_2d_array_i64_trap:
3152 case Intrinsic::nvvm_suld_2d_array_v2i8_trap:
3154 case Intrinsic::nvvm_suld_2d_array_v2i16_trap:
3156 case Intrinsic::nvvm_suld_2d_array_v2i32_trap:
3158 case Intrinsic::nvvm_suld_2d_array_v2i64_trap:
3160 case Intrinsic::nvvm_suld_2d_array_v4i8_trap:
3162 case Intrinsic::nvvm_suld_2d_array_v4i16_trap:
3164 case Intrinsic::nvvm_suld_2d_array_v4i32_trap:
3166 case Intrinsic::nvvm_suld_3d_i8_trap:
3168 case Intrinsic::nvvm_suld_3d_i16_trap:
3170 case Intrinsic::nvvm_suld_3d_i32_trap:
3172 case Intrinsic::nvvm_suld_3d_i64_trap:
3174 case Intrinsic::nvvm_suld_3d_v2i8_trap:
3176 case Intrinsic::nvvm_suld_3d_v2i16_trap:
3178 case Intrinsic::nvvm_suld_3d_v2i32_trap:
3180 case Intrinsic::nvvm_suld_3d_v2i64_trap:
3182 case Intrinsic::nvvm_suld_3d_v4i8_trap:
3184 case Intrinsic::nvvm_suld_3d_v4i16_trap:
3186 case Intrinsic::nvvm_suld_3d_v4i32_trap:
3188 case Intrinsic::nvvm_suld_1d_i8_zero:
3190 case Intrinsic::nvvm_suld_1d_i16_zero:
3192 case Intrinsic::nvvm_suld_1d_i32_zero:
3194 case Intrinsic::nvvm_suld_1d_i64_zero:
3196 case Intrinsic::nvvm_suld_1d_v2i8_zero:
3198 case Intrinsic::nvvm_suld_1d_v2i16_zero:
3200 case Intrinsic::nvvm_suld_1d_v2i32_zero:
3202 case Intrinsic::nvvm_suld_1d_v2i64_zero:
3204 case Intrinsic::nvvm_suld_1d_v4i8_zero:
3206 case Intrinsic::nvvm_suld_1d_v4i16_zero:
3208 case Intrinsic::nvvm_suld_1d_v4i32_zero:
3210 case Intrinsic::nvvm_suld_1d_array_i8_zero:
3212 case Intrinsic::nvvm_suld_1d_array_i16_zero:
3214 case Intrinsic::nvvm_suld_1d_array_i32_zero:
3216 case Intrinsic::nvvm_suld_1d_array_i64_zero:
3218 case Intrinsic::nvvm_suld_1d_array_v2i8_zero:
3220 case Intrinsic::nvvm_suld_1d_array_v2i16_zero:
3222 case Intrinsic::nvvm_suld_1d_array_v2i32_zero:
3224 case Intrinsic::nvvm_suld_1d_array_v2i64_zero:
3226 case Intrinsic::nvvm_suld_1d_array_v4i8_zero:
3228 case Intrinsic::nvvm_suld_1d_array_v4i16_zero:
3230 case Intrinsic::nvvm_suld_1d_array_v4i32_zero:
3232 case Intrinsic::nvvm_suld_2d_i8_zero:
3234 case Intrinsic::nvvm_suld_2d_i16_zero:
3236 case Intrinsic::nvvm_suld_2d_i32_zero:
3238 case Intrinsic::nvvm_suld_2d_i64_zero:
3240 case Intrinsic::nvvm_suld_2d_v2i8_zero:
3242 case Intrinsic::nvvm_suld_2d_v2i16_zero:
3244 case Intrinsic::nvvm_suld_2d_v2i32_zero:
3246 case Intrinsic::nvvm_suld_2d_v2i64_zero:
3248 case Intrinsic::nvvm_suld_2d_v4i8_zero:
3250 case Intrinsic::nvvm_suld_2d_v4i16_zero:
3252 case Intrinsic::nvvm_suld_2d_v4i32_zero:
3254 case Intrinsic::nvvm_suld_2d_array_i8_zero:
3256 case Intrinsic::nvvm_suld_2d_array_i16_zero:
3258 case Intrinsic::nvvm_suld_2d_array_i32_zero:
3260 case Intrinsic::nvvm_suld_2d_array_i64_zero:
3262 case Intrinsic::nvvm_suld_2d_array_v2i8_zero:
3264 case Intrinsic::nvvm_suld_2d_array_v2i16_zero:
3266 case Intrinsic::nvvm_suld_2d_array_v2i32_zero:
3268 case Intrinsic::nvvm_suld_2d_array_v2i64_zero:
3270 case Intrinsic::nvvm_suld_2d_array_v4i8_zero:
3272 case Intrinsic::nvvm_suld_2d_array_v4i16_zero:
3274 case Intrinsic::nvvm_suld_2d_array_v4i32_zero:
3276 case Intrinsic::nvvm_suld_3d_i8_zero:
3278 case Intrinsic::nvvm_suld_3d_i16_zero:
3280 case Intrinsic::nvvm_suld_3d_i32_zero:
3282 case Intrinsic::nvvm_suld_3d_i64_zero:
3284 case Intrinsic::nvvm_suld_3d_v2i8_zero:
3286 case Intrinsic::nvvm_suld_3d_v2i16_zero:
3288 case Intrinsic::nvvm_suld_3d_v2i32_zero:
3290 case Intrinsic::nvvm_suld_3d_v2i64_zero:
3292 case Intrinsic::nvvm_suld_3d_v4i8_zero:
3294 case Intrinsic::nvvm_suld_3d_v4i16_zero:
3296 case Intrinsic::nvvm_suld_3d_v4i32_zero:
3308 switch (Intrinsic) {
3312 case Intrinsic::nvvm_atomic_load_add_f32:
3313 case Intrinsic::nvvm_atomic_load_inc_32:
3314 case Intrinsic::nvvm_atomic_load_dec_32:
3316 case Intrinsic::nvvm_atomic_add_gen_f_cta:
3317 case Intrinsic::nvvm_atomic_add_gen_f_sys:
3318 case Intrinsic::nvvm_atomic_add_gen_i_cta:
3319 case Intrinsic::nvvm_atomic_add_gen_i_sys:
3320 case Intrinsic::nvvm_atomic_and_gen_i_cta:
3321 case Intrinsic::nvvm_atomic_and_gen_i_sys:
3322 case Intrinsic::nvvm_atomic_cas_gen_i_cta:
3323 case Intrinsic::nvvm_atomic_cas_gen_i_sys:
3324 case Intrinsic::nvvm_atomic_dec_gen_i_cta:
3325 case Intrinsic::nvvm_atomic_dec_gen_i_sys:
3326 case Intrinsic::nvvm_atomic_inc_gen_i_cta:
3327 case Intrinsic::nvvm_atomic_inc_gen_i_sys:
3328 case Intrinsic::nvvm_atomic_max_gen_i_cta:
3329 case Intrinsic::nvvm_atomic_max_gen_i_sys:
3330 case Intrinsic::nvvm_atomic_min_gen_i_cta:
3331 case Intrinsic::nvvm_atomic_min_gen_i_sys:
3332 case Intrinsic::nvvm_atomic_or_gen_i_cta:
3333 case Intrinsic::nvvm_atomic_or_gen_i_sys:
3334 case Intrinsic::nvvm_atomic_exch_gen_i_cta:
3335 case Intrinsic::nvvm_atomic_exch_gen_i_sys:
3336 case Intrinsic::nvvm_atomic_xor_gen_i_cta:
3337 case Intrinsic::nvvm_atomic_xor_gen_i_sys: {
3350 case Intrinsic::nvvm_ldu_global_i:
3351 case Intrinsic::nvvm_ldu_global_f:
3352 case Intrinsic::nvvm_ldu_global_p: {
3355 if (Intrinsic == Intrinsic::nvvm_ldu_global_i)
3357 else if(Intrinsic == Intrinsic::nvvm_ldu_global_p)
3370 case Intrinsic::nvvm_ldg_global_i:
3371 case Intrinsic::nvvm_ldg_global_f:
3372 case Intrinsic::nvvm_ldg_global_p: {
3376 if (Intrinsic == Intrinsic::nvvm_ldg_global_i)
3378 else if(Intrinsic == Intrinsic::nvvm_ldg_global_p)
3392 case Intrinsic::nvvm_tex_1d_v4f32_s32:
3393 case Intrinsic::nvvm_tex_1d_v4f32_f32:
3394 case Intrinsic::nvvm_tex_1d_level_v4f32_f32:
3395 case Intrinsic::nvvm_tex_1d_grad_v4f32_f32:
3396 case Intrinsic::nvvm_tex_1d_array_v4f32_s32:
3397 case Intrinsic::nvvm_tex_1d_array_v4f32_f32:
3398 case Intrinsic::nvvm_tex_1d_array_level_v4f32_f32:
3399 case Intrinsic::nvvm_tex_1d_array_grad_v4f32_f32:
3400 case Intrinsic::nvvm_tex_2d_v4f32_s32:
3401 case Intrinsic::nvvm_tex_2d_v4f32_f32:
3402 case Intrinsic::nvvm_tex_2d_level_v4f32_f32:
3403 case Intrinsic::nvvm_tex_2d_grad_v4f32_f32:
3404 case Intrinsic::nvvm_tex_2d_array_v4f32_s32:
3405 case Intrinsic::nvvm_tex_2d_array_v4f32_f32:
3406 case Intrinsic::nvvm_tex_2d_array_level_v4f32_f32:
3407 case Intrinsic::nvvm_tex_2d_array_grad_v4f32_f32:
3408 case Intrinsic::nvvm_tex_3d_v4f32_s32:
3409 case Intrinsic::nvvm_tex_3d_v4f32_f32:
3410 case Intrinsic::nvvm_tex_3d_level_v4f32_f32:
3411 case Intrinsic::nvvm_tex_3d_grad_v4f32_f32:
3412 case Intrinsic::nvvm_tex_cube_v4f32_f32:
3413 case Intrinsic::nvvm_tex_cube_level_v4f32_f32:
3414 case Intrinsic::nvvm_tex_cube_array_v4f32_f32:
3415 case Intrinsic::nvvm_tex_cube_array_level_v4f32_f32:
3416 case Intrinsic::nvvm_tld4_r_2d_v4f32_f32:
3417 case Intrinsic::nvvm_tld4_g_2d_v4f32_f32:
3418 case Intrinsic::nvvm_tld4_b_2d_v4f32_f32:
3419 case Intrinsic::nvvm_tld4_a_2d_v4f32_f32:
3420 case Intrinsic::nvvm_tex_unified_1d_v4f32_s32:
3421 case Intrinsic::nvvm_tex_unified_1d_v4f32_f32:
3422 case Intrinsic::nvvm_tex_unified_1d_level_v4f32_f32:
3423 case Intrinsic::nvvm_tex_unified_1d_grad_v4f32_f32:
3424 case Intrinsic::nvvm_tex_unified_1d_array_v4f32_s32:
3425 case Intrinsic::nvvm_tex_unified_1d_array_v4f32_f32:
3426 case Intrinsic::nvvm_tex_unified_1d_array_level_v4f32_f32:
3427 case Intrinsic::nvvm_tex_unified_1d_array_grad_v4f32_f32:
3428 case Intrinsic::nvvm_tex_unified_2d_v4f32_s32:
3429 case Intrinsic::nvvm_tex_unified_2d_v4f32_f32:
3430 case Intrinsic::nvvm_tex_unified_2d_level_v4f32_f32:
3431 case Intrinsic::nvvm_tex_unified_2d_grad_v4f32_f32:
3432 case Intrinsic::nvvm_tex_unified_2d_array_v4f32_s32:
3433 case Intrinsic::nvvm_tex_unified_2d_array_v4f32_f32:
3434 case Intrinsic::nvvm_tex_unified_2d_array_level_v4f32_f32:
3435 case Intrinsic::nvvm_tex_unified_2d_array_grad_v4f32_f32:
3436 case Intrinsic::nvvm_tex_unified_3d_v4f32_s32:
3437 case Intrinsic::nvvm_tex_unified_3d_v4f32_f32:
3438 case Intrinsic::nvvm_tex_unified_3d_level_v4f32_f32:
3439 case Intrinsic::nvvm_tex_unified_3d_grad_v4f32_f32:
3440 case Intrinsic::nvvm_tex_unified_cube_v4f32_f32:
3441 case Intrinsic::nvvm_tex_unified_cube_level_v4f32_f32:
3442 case Intrinsic::nvvm_tex_unified_cube_array_v4f32_f32:
3443 case Intrinsic::nvvm_tex_unified_cube_array_level_v4f32_f32:
3444 case Intrinsic::nvvm_tld4_unified_r_2d_v4f32_f32:
3445 case Intrinsic::nvvm_tld4_unified_g_2d_v4f32_f32:
3446 case Intrinsic::nvvm_tld4_unified_b_2d_v4f32_f32:
3447 case Intrinsic::nvvm_tld4_unified_a_2d_v4f32_f32:
3458 case Intrinsic::nvvm_tex_1d_v4s32_s32:
3459 case Intrinsic::nvvm_tex_1d_v4s32_f32:
3460 case Intrinsic::nvvm_tex_1d_level_v4s32_f32:
3461 case Intrinsic::nvvm_tex_1d_grad_v4s32_f32:
3462 case Intrinsic::nvvm_tex_1d_array_v4s32_s32:
3463 case Intrinsic::nvvm_tex_1d_array_v4s32_f32:
3464 case Intrinsic::nvvm_tex_1d_array_level_v4s32_f32:
3465 case Intrinsic::nvvm_tex_1d_array_grad_v4s32_f32:
3466 case Intrinsic::nvvm_tex_2d_v4s32_s32:
3467 case Intrinsic::nvvm_tex_2d_v4s32_f32:
3468 case Intrinsic::nvvm_tex_2d_level_v4s32_f32:
3469 case Intrinsic::nvvm_tex_2d_grad_v4s32_f32:
3470 case Intrinsic::nvvm_tex_2d_array_v4s32_s32:
3471 case Intrinsic::nvvm_tex_2d_array_v4s32_f32:
3472 case Intrinsic::nvvm_tex_2d_array_level_v4s32_f32:
3473 case Intrinsic::nvvm_tex_2d_array_grad_v4s32_f32:
3474 case Intrinsic::nvvm_tex_3d_v4s32_s32:
3475 case Intrinsic::nvvm_tex_3d_v4s32_f32:
3476 case Intrinsic::nvvm_tex_3d_level_v4s32_f32:
3477 case Intrinsic::nvvm_tex_3d_grad_v4s32_f32:
3478 case Intrinsic::nvvm_tex_cube_v4s32_f32:
3479 case Intrinsic::nvvm_tex_cube_level_v4s32_f32:
3480 case Intrinsic::nvvm_tex_cube_array_v4s32_f32:
3481 case Intrinsic::nvvm_tex_cube_array_level_v4s32_f32:
3482 case Intrinsic::nvvm_tex_cube_v4u32_f32:
3483 case Intrinsic::nvvm_tex_cube_level_v4u32_f32:
3484 case Intrinsic::nvvm_tex_cube_array_v4u32_f32:
3485 case Intrinsic::nvvm_tex_cube_array_level_v4u32_f32:
3486 case Intrinsic::nvvm_tex_1d_v4u32_s32:
3487 case Intrinsic::nvvm_tex_1d_v4u32_f32:
3488 case Intrinsic::nvvm_tex_1d_level_v4u32_f32:
3489 case Intrinsic::nvvm_tex_1d_grad_v4u32_f32:
3490 case Intrinsic::nvvm_tex_1d_array_v4u32_s32:
3491 case Intrinsic::nvvm_tex_1d_array_v4u32_f32:
3492 case Intrinsic::nvvm_tex_1d_array_level_v4u32_f32:
3493 case Intrinsic::nvvm_tex_1d_array_grad_v4u32_f32:
3494 case Intrinsic::nvvm_tex_2d_v4u32_s32:
3495 case Intrinsic::nvvm_tex_2d_v4u32_f32:
3496 case Intrinsic::nvvm_tex_2d_level_v4u32_f32:
3497 case Intrinsic::nvvm_tex_2d_grad_v4u32_f32:
3498 case Intrinsic::nvvm_tex_2d_array_v4u32_s32:
3499 case Intrinsic::nvvm_tex_2d_array_v4u32_f32:
3500 case Intrinsic::nvvm_tex_2d_array_level_v4u32_f32:
3501 case Intrinsic::nvvm_tex_2d_array_grad_v4u32_f32:
3502 case Intrinsic::nvvm_tex_3d_v4u32_s32:
3503 case Intrinsic::nvvm_tex_3d_v4u32_f32:
3504 case Intrinsic::nvvm_tex_3d_level_v4u32_f32:
3505 case Intrinsic::nvvm_tex_3d_grad_v4u32_f32:
3506 case Intrinsic::nvvm_tld4_r_2d_v4s32_f32:
3507 case Intrinsic::nvvm_tld4_g_2d_v4s32_f32:
3508 case Intrinsic::nvvm_tld4_b_2d_v4s32_f32:
3509 case Intrinsic::nvvm_tld4_a_2d_v4s32_f32:
3510 case Intrinsic::nvvm_tld4_r_2d_v4u32_f32:
3511 case Intrinsic::nvvm_tld4_g_2d_v4u32_f32:
3512 case Intrinsic::nvvm_tld4_b_2d_v4u32_f32:
3513 case Intrinsic::nvvm_tld4_a_2d_v4u32_f32:
3514 case Intrinsic::nvvm_tex_unified_1d_v4s32_s32:
3515 case Intrinsic::nvvm_tex_unified_1d_v4s32_f32:
3516 case Intrinsic::nvvm_tex_unified_1d_level_v4s32_f32:
3517 case Intrinsic::nvvm_tex_unified_1d_grad_v4s32_f32:
3518 case Intrinsic::nvvm_tex_unified_1d_array_v4s32_s32:
3519 case Intrinsic::nvvm_tex_unified_1d_array_v4s32_f32:
3520 case Intrinsic::nvvm_tex_unified_1d_array_level_v4s32_f32:
3521 case Intrinsic::nvvm_tex_unified_1d_array_grad_v4s32_f32:
3522 case Intrinsic::nvvm_tex_unified_2d_v4s32_s32:
3523 case Intrinsic::nvvm_tex_unified_2d_v4s32_f32:
3524 case Intrinsic::nvvm_tex_unified_2d_level_v4s32_f32:
3525 case Intrinsic::nvvm_tex_unified_2d_grad_v4s32_f32:
3526 case Intrinsic::nvvm_tex_unified_2d_array_v4s32_s32:
3527 case Intrinsic::nvvm_tex_unified_2d_array_v4s32_f32:
3528 case Intrinsic::nvvm_tex_unified_2d_array_level_v4s32_f32:
3529 case Intrinsic::nvvm_tex_unified_2d_array_grad_v4s32_f32:
3530 case Intrinsic::nvvm_tex_unified_3d_v4s32_s32:
3531 case Intrinsic::nvvm_tex_unified_3d_v4s32_f32:
3532 case Intrinsic::nvvm_tex_unified_3d_level_v4s32_f32:
3533 case Intrinsic::nvvm_tex_unified_3d_grad_v4s32_f32:
3534 case Intrinsic::nvvm_tex_unified_1d_v4u32_s32:
3535 case Intrinsic::nvvm_tex_unified_1d_v4u32_f32:
3536 case Intrinsic::nvvm_tex_unified_1d_level_v4u32_f32:
3537 case Intrinsic::nvvm_tex_unified_1d_grad_v4u32_f32:
3538 case Intrinsic::nvvm_tex_unified_1d_array_v4u32_s32:
3539 case Intrinsic::nvvm_tex_unified_1d_array_v4u32_f32:
3540 case Intrinsic::nvvm_tex_unified_1d_array_level_v4u32_f32:
3541 case Intrinsic::nvvm_tex_unified_1d_array_grad_v4u32_f32:
3542 case Intrinsic::nvvm_tex_unified_2d_v4u32_s32:
3543 case Intrinsic::nvvm_tex_unified_2d_v4u32_f32:
3544 case Intrinsic::nvvm_tex_unified_2d_level_v4u32_f32:
3545 case Intrinsic::nvvm_tex_unified_2d_grad_v4u32_f32:
3546 case Intrinsic::nvvm_tex_unified_2d_array_v4u32_s32:
3547 case Intrinsic::nvvm_tex_unified_2d_array_v4u32_f32:
3548 case Intrinsic::nvvm_tex_unified_2d_array_level_v4u32_f32:
3549 case Intrinsic::nvvm_tex_unified_2d_array_grad_v4u32_f32:
3550 case Intrinsic::nvvm_tex_unified_3d_v4u32_s32:
3551 case Intrinsic::nvvm_tex_unified_3d_v4u32_f32:
3552 case Intrinsic::nvvm_tex_unified_3d_level_v4u32_f32:
3553 case Intrinsic::nvvm_tex_unified_3d_grad_v4u32_f32:
3554 case Intrinsic::nvvm_tex_unified_cube_v4s32_f32:
3555 case Intrinsic::nvvm_tex_unified_cube_level_v4s32_f32:
3556 case Intrinsic::nvvm_tex_unified_cube_array_v4s32_f32:
3557 case Intrinsic::nvvm_tex_unified_cube_array_level_v4s32_f32:
3558 case Intrinsic::nvvm_tex_unified_cube_v4u32_f32:
3559 case Intrinsic::nvvm_tex_unified_cube_level_v4u32_f32:
3560 case Intrinsic::nvvm_tex_unified_cube_array_v4u32_f32:
3561 case Intrinsic::nvvm_tex_unified_cube_array_level_v4u32_f32:
3562 case Intrinsic::nvvm_tld4_unified_r_2d_v4s32_f32:
3563 case Intrinsic::nvvm_tld4_unified_g_2d_v4s32_f32:
3564 case Intrinsic::nvvm_tld4_unified_b_2d_v4s32_f32:
3565 case Intrinsic::nvvm_tld4_unified_a_2d_v4s32_f32:
3566 case Intrinsic::nvvm_tld4_unified_r_2d_v4u32_f32:
3567 case Intrinsic::nvvm_tld4_unified_g_2d_v4u32_f32:
3568 case Intrinsic::nvvm_tld4_unified_b_2d_v4u32_f32:
3569 case Intrinsic::nvvm_tld4_unified_a_2d_v4u32_f32:
3580 case Intrinsic::nvvm_suld_1d_i8_clamp:
3581 case Intrinsic::nvvm_suld_1d_v2i8_clamp:
3582 case Intrinsic::nvvm_suld_1d_v4i8_clamp:
3583 case Intrinsic::nvvm_suld_1d_array_i8_clamp:
3584 case Intrinsic::nvvm_suld_1d_array_v2i8_clamp:
3585 case Intrinsic::nvvm_suld_1d_array_v4i8_clamp:
3586 case Intrinsic::nvvm_suld_2d_i8_clamp:
3587 case Intrinsic::nvvm_suld_2d_v2i8_clamp:
3588 case Intrinsic::nvvm_suld_2d_v4i8_clamp:
3589 case Intrinsic::nvvm_suld_2d_array_i8_clamp:
3590 case Intrinsic::nvvm_suld_2d_array_v2i8_clamp:
3591 case Intrinsic::nvvm_suld_2d_array_v4i8_clamp:
3592 case Intrinsic::nvvm_suld_3d_i8_clamp:
3593 case Intrinsic::nvvm_suld_3d_v2i8_clamp:
3594 case Intrinsic::nvvm_suld_3d_v4i8_clamp:
3595 case Intrinsic::nvvm_suld_1d_i8_trap:
3596 case Intrinsic::nvvm_suld_1d_v2i8_trap:
3597 case Intrinsic::nvvm_suld_1d_v4i8_trap:
3598 case Intrinsic::nvvm_suld_1d_array_i8_trap:
3599 case Intrinsic::nvvm_suld_1d_array_v2i8_trap:
3600 case Intrinsic::nvvm_suld_1d_array_v4i8_trap:
3601 case Intrinsic::nvvm_suld_2d_i8_trap:
3602 case Intrinsic::nvvm_suld_2d_v2i8_trap:
3603 case Intrinsic::nvvm_suld_2d_v4i8_trap:
3604 case Intrinsic::nvvm_suld_2d_array_i8_trap:
3605 case Intrinsic::nvvm_suld_2d_array_v2i8_trap:
3606 case Intrinsic::nvvm_suld_2d_array_v4i8_trap:
3607 case Intrinsic::nvvm_suld_3d_i8_trap:
3608 case Intrinsic::nvvm_suld_3d_v2i8_trap:
3609 case Intrinsic::nvvm_suld_3d_v4i8_trap:
3610 case Intrinsic::nvvm_suld_1d_i8_zero:
3611 case Intrinsic::nvvm_suld_1d_v2i8_zero:
3612 case Intrinsic::nvvm_suld_1d_v4i8_zero:
3613 case Intrinsic::nvvm_suld_1d_array_i8_zero:
3614 case Intrinsic::nvvm_suld_1d_array_v2i8_zero:
3615 case Intrinsic::nvvm_suld_1d_array_v4i8_zero:
3616 case Intrinsic::nvvm_suld_2d_i8_zero:
3617 case Intrinsic::nvvm_suld_2d_v2i8_zero:
3618 case Intrinsic::nvvm_suld_2d_v4i8_zero:
3619 case Intrinsic::nvvm_suld_2d_array_i8_zero:
3620 case Intrinsic::nvvm_suld_2d_array_v2i8_zero:
3621 case Intrinsic::nvvm_suld_2d_array_v4i8_zero:
3622 case Intrinsic::nvvm_suld_3d_i8_zero:
3623 case Intrinsic::nvvm_suld_3d_v2i8_zero:
3624 case Intrinsic::nvvm_suld_3d_v4i8_zero:
3635 case Intrinsic::nvvm_suld_1d_i16_clamp:
3636 case Intrinsic::nvvm_suld_1d_v2i16_clamp:
3637 case Intrinsic::nvvm_suld_1d_v4i16_clamp:
3638 case Intrinsic::nvvm_suld_1d_array_i16_clamp:
3639 case Intrinsic::nvvm_suld_1d_array_v2i16_clamp:
3640 case Intrinsic::nvvm_suld_1d_array_v4i16_clamp:
3641 case Intrinsic::nvvm_suld_2d_i16_clamp:
3642 case Intrinsic::nvvm_suld_2d_v2i16_clamp:
3643 case Intrinsic::nvvm_suld_2d_v4i16_clamp:
3644 case Intrinsic::nvvm_suld_2d_array_i16_clamp:
3645 case Intrinsic::nvvm_suld_2d_array_v2i16_clamp:
3646 case Intrinsic::nvvm_suld_2d_array_v4i16_clamp:
3647 case Intrinsic::nvvm_suld_3d_i16_clamp:
3648 case Intrinsic::nvvm_suld_3d_v2i16_clamp:
3649 case Intrinsic::nvvm_suld_3d_v4i16_clamp:
3650 case Intrinsic::nvvm_suld_1d_i16_trap:
3651 case Intrinsic::nvvm_suld_1d_v2i16_trap:
3652 case Intrinsic::nvvm_suld_1d_v4i16_trap:
3653 case Intrinsic::nvvm_suld_1d_array_i16_trap:
3654 case Intrinsic::nvvm_suld_1d_array_v2i16_trap:
3655 case Intrinsic::nvvm_suld_1d_array_v4i16_trap:
3656 case Intrinsic::nvvm_suld_2d_i16_trap:
3657 case Intrinsic::nvvm_suld_2d_v2i16_trap:
3658 case Intrinsic::nvvm_suld_2d_v4i16_trap:
3659 case Intrinsic::nvvm_suld_2d_array_i16_trap:
3660 case Intrinsic::nvvm_suld_2d_array_v2i16_trap:
3661 case Intrinsic::nvvm_suld_2d_array_v4i16_trap:
3662 case Intrinsic::nvvm_suld_3d_i16_trap:
3663 case Intrinsic::nvvm_suld_3d_v2i16_trap:
3664 case Intrinsic::nvvm_suld_3d_v4i16_trap:
3665 case Intrinsic::nvvm_suld_1d_i16_zero:
3666 case Intrinsic::nvvm_suld_1d_v2i16_zero:
3667 case Intrinsic::nvvm_suld_1d_v4i16_zero:
3668 case Intrinsic::nvvm_suld_1d_array_i16_zero:
3669 case Intrinsic::nvvm_suld_1d_array_v2i16_zero:
3670 case Intrinsic::nvvm_suld_1d_array_v4i16_zero:
3671 case Intrinsic::nvvm_suld_2d_i16_zero:
3672 case Intrinsic::nvvm_suld_2d_v2i16_zero:
3673 case Intrinsic::nvvm_suld_2d_v4i16_zero:
3674 case Intrinsic::nvvm_suld_2d_array_i16_zero:
3675 case Intrinsic::nvvm_suld_2d_array_v2i16_zero:
3676 case Intrinsic::nvvm_suld_2d_array_v4i16_zero:
3677 case Intrinsic::nvvm_suld_3d_i16_zero:
3678 case Intrinsic::nvvm_suld_3d_v2i16_zero:
3679 case Intrinsic::nvvm_suld_3d_v4i16_zero:
3690 case Intrinsic::nvvm_suld_1d_i32_clamp:
3691 case Intrinsic::nvvm_suld_1d_v2i32_clamp:
3692 case Intrinsic::nvvm_suld_1d_v4i32_clamp:
3693 case Intrinsic::nvvm_suld_1d_array_i32_clamp:
3694 case Intrinsic::nvvm_suld_1d_array_v2i32_clamp:
3695 case Intrinsic::nvvm_suld_1d_array_v4i32_clamp:
3696 case Intrinsic::nvvm_suld_2d_i32_clamp:
3697 case Intrinsic::nvvm_suld_2d_v2i32_clamp:
3698 case Intrinsic::nvvm_suld_2d_v4i32_clamp:
3699 case Intrinsic::nvvm_suld_2d_array_i32_clamp:
3700 case Intrinsic::nvvm_suld_2d_array_v2i32_clamp:
3701 case Intrinsic::nvvm_suld_2d_array_v4i32_clamp:
3702 case Intrinsic::nvvm_suld_3d_i32_clamp:
3703 case Intrinsic::nvvm_suld_3d_v2i32_clamp:
3704 case Intrinsic::nvvm_suld_3d_v4i32_clamp:
3705 case Intrinsic::nvvm_suld_1d_i32_trap:
3706 case Intrinsic::nvvm_suld_1d_v2i32_trap:
3707 case Intrinsic::nvvm_suld_1d_v4i32_trap:
3708 case Intrinsic::nvvm_suld_1d_array_i32_trap:
3709 case Intrinsic::nvvm_suld_1d_array_v2i32_trap:
3710 case Intrinsic::nvvm_suld_1d_array_v4i32_trap:
3711 case Intrinsic::nvvm_suld_2d_i32_trap:
3712 case Intrinsic::nvvm_suld_2d_v2i32_trap:
3713 case Intrinsic::nvvm_suld_2d_v4i32_trap:
3714 case Intrinsic::nvvm_suld_2d_array_i32_trap:
3715 case Intrinsic::nvvm_suld_2d_array_v2i32_trap:
3716 case Intrinsic::nvvm_suld_2d_array_v4i32_trap:
3717 case Intrinsic::nvvm_suld_3d_i32_trap:
3718 case Intrinsic::nvvm_suld_3d_v2i32_trap:
3719 case Intrinsic::nvvm_suld_3d_v4i32_trap:
3720 case Intrinsic::nvvm_suld_1d_i32_zero:
3721 case Intrinsic::nvvm_suld_1d_v2i32_zero:
3722 case Intrinsic::nvvm_suld_1d_v4i32_zero:
3723 case Intrinsic::nvvm_suld_1d_array_i32_zero:
3724 case Intrinsic::nvvm_suld_1d_array_v2i32_zero:
3725 case Intrinsic::nvvm_suld_1d_array_v4i32_zero:
3726 case Intrinsic::nvvm_suld_2d_i32_zero:
3727 case Intrinsic::nvvm_suld_2d_v2i32_zero:
3728 case Intrinsic::nvvm_suld_2d_v4i32_zero:
3729 case Intrinsic::nvvm_suld_2d_array_i32_zero:
3730 case Intrinsic::nvvm_suld_2d_array_v2i32_zero:
3731 case Intrinsic::nvvm_suld_2d_array_v4i32_zero:
3732 case Intrinsic::nvvm_suld_3d_i32_zero:
3733 case Intrinsic::nvvm_suld_3d_v2i32_zero:
3734 case Intrinsic::nvvm_suld_3d_v4i32_zero:
3745 case Intrinsic::nvvm_suld_1d_i64_clamp:
3746 case Intrinsic::nvvm_suld_1d_v2i64_clamp:
3747 case Intrinsic::nvvm_suld_1d_array_i64_clamp:
3748 case Intrinsic::nvvm_suld_1d_array_v2i64_clamp:
3749 case Intrinsic::nvvm_suld_2d_i64_clamp:
3750 case Intrinsic::nvvm_suld_2d_v2i64_clamp:
3751 case Intrinsic::nvvm_suld_2d_array_i64_clamp:
3752 case Intrinsic::nvvm_suld_2d_array_v2i64_clamp:
3753 case Intrinsic::nvvm_suld_3d_i64_clamp:
3754 case Intrinsic::nvvm_suld_3d_v2i64_clamp:
3755 case Intrinsic::nvvm_suld_1d_i64_trap:
3756 case Intrinsic::nvvm_suld_1d_v2i64_trap:
3757 case Intrinsic::nvvm_suld_1d_array_i64_trap:
3758 case Intrinsic::nvvm_suld_1d_array_v2i64_trap:
3759 case Intrinsic::nvvm_suld_2d_i64_trap:
3760 case Intrinsic::nvvm_suld_2d_v2i64_trap:
3761 case Intrinsic::nvvm_suld_2d_array_i64_trap:
3762 case Intrinsic::nvvm_suld_2d_array_v2i64_trap:
3763 case Intrinsic::nvvm_suld_3d_i64_trap:
3764 case Intrinsic::nvvm_suld_3d_v2i64_trap:
3765 case Intrinsic::nvvm_suld_1d_i64_zero:
3766 case Intrinsic::nvvm_suld_1d_v2i64_zero:
3767 case Intrinsic::nvvm_suld_1d_array_i64_zero:
3768 case Intrinsic::nvvm_suld_1d_array_v2i64_zero:
3769 case Intrinsic::nvvm_suld_2d_i64_zero:
3770 case Intrinsic::nvvm_suld_2d_v2i64_zero:
3771 case Intrinsic::nvvm_suld_2d_array_i64_zero:
3772 case Intrinsic::nvvm_suld_2d_array_v2i64_zero:
3773 case Intrinsic::nvvm_suld_3d_i64_zero:
3774 case Intrinsic::nvvm_suld_3d_v2i64_zero:
3795 unsigned AS)
const {
3832 if (Constraint.
size() == 1) {
3833 switch (Constraint[0]) {
3851 std::pair<unsigned, const TargetRegisterClass *>
3855 if (Constraint.
size() == 1) {
3856 switch (Constraint[0]) {
3858 return std::make_pair(0U, &NVPTX::Int1RegsRegClass);
3860 return std::make_pair(0U, &NVPTX::Int16RegsRegClass);
3862 return std::make_pair(0U, &NVPTX::Int16RegsRegClass);
3864 return std::make_pair(0U, &NVPTX::Int32RegsRegClass);
3867 return std::make_pair(0U, &NVPTX::Int64RegsRegClass);
3869 return std::make_pair(0U, &NVPTX::Float32RegsRegClass);
3871 return std::make_pair(0U, &NVPTX::Float64RegsRegClass);
3961 int nonAddCount = 0;
3979 if (orderNo - orderNo2 < 500)
3984 bool opIsLive =
false;
3988 if (isa<ConstantSDNode>(left) || isa<ConstantSDNode>(right))
3995 if (orderNo3 > orderNo) {
4005 if (orderNo3 > orderNo) {
4051 if (isa<ConstantSDNode>(Val)) {
4075 if (MaskVal != 0xff) {
4102 if (AExt.
getNode() !=
nullptr) {
4135 if (U->getOpcode() == DivOpc && U->getOperand(0) == Num &&
4140 DAG.
getNode(DivOpc, DL, VT, Num, Den),
4193 if (LHSSign == Unknown)
4196 IsSigned = (LHSSign ==
Signed);
4200 const APInt &Val = CI->getAPIntValue();
4202 return Val.
isIntN(OptSize);
4211 return LHSSign == RHSSign;
4233 if (isa<ConstantSDNode>(LHS)) {
4247 if (ShiftAmt.
sge(0) && ShiftAmt.
slt(BitWidth)) {
4248 APInt MulVal =
APInt(BitWidth, 1) << ShiftAmt;
4282 return DCI.
DAG.
getNode(Opc, DL, MulType, TruncLHS, TruncRHS);
4333 DAGCombinerInfo &DCI)
const {
4391 unsigned PrefAlign =
4393 if (Align < PrefAlign) {
4408 bool NeedTrunc =
false;
4414 unsigned Opcode = 0;
4416 bool LoadF16x2 =
false;
4460 for (
unsigned i = 0; i < NumElts; ++i) {
4470 for (
unsigned i = 0; i < NumElts; ++i) {
4493 unsigned IntrinNo = cast<ConstantSDNode>(Intrin.
getNode())->getZExtValue();
4497 case Intrinsic::nvvm_ldg_global_i:
4498 case Intrinsic::nvvm_ldg_global_f:
4499 case Intrinsic::nvvm_ldg_global_p:
4500 case Intrinsic::nvvm_ldu_global_i:
4501 case Intrinsic::nvvm_ldu_global_f:
4502 case Intrinsic::nvvm_ldu_global_p: {
4515 bool NeedTrunc =
false;
4521 unsigned Opcode = 0;
4531 case Intrinsic::nvvm_ldg_global_i:
4532 case Intrinsic::nvvm_ldg_global_f:
4533 case Intrinsic::nvvm_ldg_global_p:
4536 case Intrinsic::nvvm_ldu_global_i:
4537 case Intrinsic::nvvm_ldu_global_f:
4538 case Intrinsic::nvvm_ldu_global_p:
4548 case Intrinsic::nvvm_ldg_global_i:
4549 case Intrinsic::nvvm_ldg_global_f:
4550 case Intrinsic::nvvm_ldg_global_p:
4553 case Intrinsic::nvvm_ldu_global_i:
4554 case Intrinsic::nvvm_ldu_global_f:
4555 case Intrinsic::nvvm_ldu_global_p:
4582 for (
unsigned i = 0; i < NumElts; ++i) {
4600 "Custom handling of non-i8 ldu/ldg?");
4617 NewLD.getValue(0)));
4624 void NVPTXTargetLowering::ReplaceNodeResults(
4639 void NVPTXSection::anchor() {}
static unsigned getBitWidth(Type *Ty, const DataLayout &DL)
Returns the bitwidth of the given scalar or pointer type.
BITCAST - This operator converts between integer, vector and FP values, as if the value was stored to...
Instances of this class represent a uniqued identifier for a section in the current translation unit...
void push_back(const T &Elt)
A parsed version of the target data layout string in and methods for querying it. ...
const_iterator end(StringRef path)
Get end iterator over path.
FMINNUM/FMAXNUM - Perform floating-point minimum or maximum on two values.
SDValue getValue(unsigned R) const
This represents an addressing mode of: BaseGV + BaseOffs + BaseReg + Scale*ScaleReg If BaseGV is null...
void setLoadExtAction(unsigned ExtType, MVT ValVT, MVT MemVT, LegalizeAction Action)
Indicate that the specified load with extension does not work with the specified type and indicate wh...
bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM, Type *Ty, unsigned AS) const override
isLegalAddressingMode - Return true if the addressing mode represented by AM is legal for this target...
This SDNode is used for target intrinsics that touch memory and need an associated MachineMemOperand...
virtual ConstraintType getConstraintType(StringRef Constraint) const
Given a constraint, return the type of constraint it is for this target.
Flags getFlags() const
Return the raw flags of the source value,.
LLVMContext * getContext() const
This class represents an incoming formal argument to a Function.
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
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 CombineTo(SDNode *N, ArrayRef< SDValue > To, bool AddTo=true)
SDValue getCALLSEQ_END(SDValue Chain, SDValue Op1, SDValue Op2, SDValue InGlue, const SDLoc &DL)
Return a new CALLSEQ_END node, which always must have a glue result (to ensure it's not CSE'd)...
static unsigned CanMergeParamLoadStoresStartingAt(unsigned Idx, uint32_t AccessSize, const SmallVectorImpl< EVT > &ValueVTs, const SmallVectorImpl< uint64_t > &Offsets, unsigned ParamAlignment)
uint64_t GreatestCommonDivisor64(uint64_t A, uint64_t B)
Return the greatest common divisor of the values using Euclid's algorithm.
bool getAlign(const Function &F, unsigned index, unsigned &align)
EXTRACT_SUBVECTOR(VECTOR, IDX) - Returns a subvector from VECTOR (an vector value) starting with the ...
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.
unsigned getNumRegisters(LLVMContext &Context, EVT VT) const
Return the number of registers that this ValueType will eventually require.
MCSection * DwarfPubTypesSection
bool hasOneUse() const
Return true if there is exactly one use of this node.
A Module instance is used to store all the information related to an LLVM module. ...
const TargetMachine & getTargetMachine() const
static cl::opt< unsigned > FMAContractLevelOpt("nvptx-fma-level", cl::ZeroOrMore, cl::Hidden, cl::desc("NVPTX Specific: FMA contraction (0: don't do it"" 1: do it 2: do it aggressively"), cl::init(2))
Carry-setting nodes for multiple precision addition and subtraction.
MCSection * TextSection
Section directive for standard text.
MCSection * StaticCtorSection
This section contains the static constructor pointer list.
This class represents a function call, abstracting a target machine's calling convention.
static PointerType * get(Type *ElementType, unsigned AddressSpace)
This constructs a pointer to an object of the specified type in a numbered address space...
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
std::string getPrototype(const DataLayout &DL, Type *, const ArgListTy &, const SmallVectorImpl< ISD::OutputArg > &, unsigned retAlignment, const ImmutableCallSite *CS) const
static bool IsMulWideOperandDemotable(SDValue Op, unsigned OptSize, OperandSignedness &S)
IsMulWideOperandDemotable - Checks if the provided DAG node is an operand that can be demoted to OptS...
static bool isImageOrSamplerVal(const Value *arg, const Module *context)
Function Alias Analysis Results
Type * getTypeForEVT(LLVMContext &Context) const
This method returns an LLVM type corresponding to the specified EVT.
unsigned getNumOperands() const
Return the number of values used by this operation.
void setBooleanVectorContents(BooleanContent Ty)
Specify how the target extends the result of a vector boolean value from a vector of i1 to a wider ty...
MCSection * getDataSection() const
unsigned getNumOperands() const
unsigned getValueSizeInBits() const
Returns the size of the value in bits.
const SDValue & getOperand(unsigned Num) const
ConstraintType getConstraintType(StringRef Constraint) const override
getConstraintType - Given a constraint letter, return the type of constraint it is for this target...
Attribute getFnAttribute(Attribute::AttrKind Kind) const
Return the attribute for the given attribute kind.
const Function * getFunction() const
getFunction - Return the LLVM function that this machine code represents
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 getTargetExternalSymbol(const char *Sym, EVT VT, unsigned char TargetFlags=0)
SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
const SDValue & setRoot(SDValue N)
Set the current root tag of the SelectionDAG.
const SDValue & getBasePtr() const
SDValue LowerCall(CallLoweringInfo &CLI, SmallVectorImpl< SDValue > &InVals) const override
This hook must be implemented to lower calls into the specified DAG.
void LowerAsmOperandForConstraint(SDValue Op, std::string &Constraint, std::vector< SDValue > &Ops, SelectionDAG &DAG) const override
Lower the specified operand into the Ops vector.
Select with condition operator - This selects between a true value and a false value (ops #2 and #3) ...
uint64_t getTypeAllocSizeInBits(Type *Ty) const
Returns the offset in bits between successive objects of the specified type, including alignment padd...
void setTruncStoreAction(MVT ValVT, MVT MemVT, LegalizeAction Action)
Indicate that the specified truncating store does not work with the specified type and indicate what ...
RESULT,OUTCHAIN = INTRINSIC_W_CHAIN(INCHAIN, INTRINSICID, arg1, ...) This node represents a target in...
static Constant * getNullValue(Type *Ty)
Constructor to create a '0' constant of arbitrary type.
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...
MCSection * SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
SDValue expandUnalignedStore(StoreSDNode *ST, SelectionDAG &DAG) const
Expands an unaligned store to 2 half-size stores for integer values, and possibly more for vectors...
SHL_PARTS/SRA_PARTS/SRL_PARTS - These operators are used for expanded integer shift operations...
bool isVector() const
Return true if this is a vector value type.
SDValue getIntPtrConstant(uint64_t Val, const SDLoc &DL, bool isTarget=false)
static SDValue PerformREMCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, CodeGenOpt::Level OptLevel)
static unsigned int uniqueCallSite
static bool AreMulWideOperandsDemotable(SDValue LHS, SDValue RHS, unsigned OptSize, bool &IsSigned)
AreMulWideOperandsDemotable - Checks if the given LHS and RHS operands can be demoted to OptSize bits...
SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const
static cl::opt< bool > UsePrecSqrtF32("nvptx-prec-sqrtf32", cl::Hidden, cl::desc("NVPTX Specific: 0 use sqrt.approx, 1 use sqrt.rn."), cl::init(true))
Shift and rotation operations.
static void ComputePTXValueVTs(const TargetLowering &TLI, const DataLayout &DL, Type *Ty, SmallVectorImpl< EVT > &ValueVTs, SmallVectorImpl< uint64_t > *Offsets=nullptr, uint64_t StartingOffset=0)
ComputePTXValueVTs - For the given Type Ty, returns the set of primitive EVTs that compose it...
Class to represent struct types.
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
ABS - Determine the unsigned absolute value of a signed integer value of the same bitwidth...
MachineFunction & getMachineFunction() const
MCSection * DwarfLineSection
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This file contains the simple types necessary to represent the attributes associated with functions a...
void addBypassSlowDiv(unsigned int SlowBitWidth, unsigned int FastBitWidth)
Tells the code generator which bitwidths to bypass.
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.
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...
bool isIntN(unsigned N) const
Check if this APInt has an N-bits unsigned integer value.
SDVTList getVTList(EVT VT)
Return an SDVTList that represents the list of values specified.
FRAMEADDR, RETURNADDR - These nodes represent llvm.frameaddress and llvm.returnaddress on the DAG...
static void ReplaceLoadVector(SDNode *N, SelectionDAG &DAG, SmallVectorImpl< SDValue > &Results)
ReplaceVectorLoad - Convert vector loads into multi-output scalar loads.
void setJumpIsExpensive(bool isExpensive=true)
Tells the code generator not to expand logic operations on comparison predicates into separate sequen...
MCSection * DwarfFrameSection
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
bool isInteger() const
Return true if this is an integer or a vector integer type.
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.
LLVM_NODISCARD bool empty() const
SmallVector< ISD::InputArg, 32 > Ins
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.
void assign(size_type NumElts, const T &Elt)
APInt shl(unsigned shiftAmt) const
Left-shift function.
A constant value that is initialized with an expression using other constant values.
bool isKernelFunction(const Function &F)
unsigned getIROrder() const
Return the node ordering.
const MCSection * DwarfDebugInlineSection
void computeRegisterProperties(const TargetRegisterInfo *TRI)
Once all of the register classes are added, this allows us to compute derived properties we expose...
[SU]INT_TO_FP - These operators convert integers (whose interpreted sign depends on the first letter)...
unsigned int getSmVersion() const
bool isHalfTy() const
Return true if this is 'half', a 16-bit IEEE fp type.
bool hasParamAttribute(unsigned ArgNo, Attribute::AttrKind Kind) const
Equivalent to hasAttribute(ArgNo + FirstArgIndex, Kind).
Simple integer binary arithmetic operators.
MCSection * StaticDtorSection
This section contains the static destructor pointer list.
SmallVector< ISD::OutputArg, 32 > Outs
TypeID getTypeID() const
Return the type id for the type.
bool isFloatingPointTy() const
Return true if this is one of the six floating-point types.
AttributeSet getAttributes(unsigned Index) const
The attributes for the specified index are returned.
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...
const SDValue & getBasePtr() const
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.
static SDValue PerformADDCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, const NVPTXSubtarget &Subtarget, CodeGenOpt::Level OptLevel)
PerformADDCombine - Target-specific dag combine xforms for ISD::ADD.
void setIROrder(unsigned Order)
Set the node ordering.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
static SDValue PerformANDCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI)
RESULT = INTRINSIC_WO_CHAIN(INTRINSICID, arg1, arg2, ...) This node represents a target intrinsic fun...
const DataLayout & getDataLayout() const
void ComputeValueVTs(const TargetLowering &TLI, const DataLayout &DL, Type *Ty, SmallVectorImpl< EVT > &ValueVTs, SmallVectorImpl< uint64_t > *Offsets=nullptr, uint64_t StartingOffset=0)
ComputeValueVTs - Given an LLVM IR type, compute a sequence of EVTs that represent all the individual...
MCSection * DataSection
Section directive for standard data.
Class to represent pointers.
UNDEF - An undefined node.
This class is used to represent ISD::STORE nodes.
static SDValue PerformADDCombineWithOperands(SDNode *N, SDValue N0, SDValue N1, TargetLowering::DAGCombinerInfo &DCI, const NVPTXSubtarget &Subtarget, CodeGenOpt::Level OptLevel)
PerformADDCombineWithOperands - Try DAG combinations for an ADD with operands N0 and N1...
FP_TO_[US]INT - Convert a floating point value to a signed or unsigned integer.
static cl::opt< int > UsePrecDivF32("nvptx-prec-divf32", cl::ZeroOrMore, cl::Hidden, cl::desc("NVPTX Specifies: 0 use div.approx, 1 use div.full, 2 use"" IEEE Compliant F32 div.rnd if available."), cl::init(2))
BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a vector with the specified, possibly variable...
bool isSized(SmallPtrSetImpl< Type * > *Visited=nullptr) const
Return true if it makes sense to take the size of this type.
SDNode * getNode() const
get the SDNode which holds the desired result
unsigned getStoreSize() const
Return the number of bytes overwritten by a store of the specified value type.
Type * getReturnType() const
Returns the type of the ret val.
initializer< Ty > init(const Ty &Val)
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.
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...
bool allowFMA(MachineFunction &MF, CodeGenOpt::Level OptLevel) const
constexpr bool isPowerOf2_32(uint32_t Value)
Return true if the argument is a power of two > 0.
const SDValue & getOperand(unsigned i) const
The instances of the Type class are immutable: once they are created, they are never changed...
void addRegisterClass(MVT VT, const TargetRegisterClass *RC)
Add the specified register class as an available regclass for the specified value type...
static cl::opt< bool > sched4reg("nvptx-sched4reg", cl::desc("NVPTX Specific: schedule for register pressue"), cl::init(false))
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...
bool isVectorTy() const
True if this is an instance of VectorType.
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.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
const NVPTXTargetLowering * getTargetLowering() const override
Carry-using nodes for multiple precision addition and subtraction.
SDValue getCALLSEQ_START(SDValue Chain, uint64_t InSize, uint64_t OutSize, const SDLoc &DL)
Return a new CALLSEQ_START node, that starts new call frame, in which InSize bytes are set up inside ...
void setBooleanContents(BooleanContent Ty)
Specify how the target extends the result of integer and floating point boolean values from i1 to a w...
MCSection * DwarfStrSection
static unsigned getOpcForSurfaceInstr(unsigned Intrinsic)
virtual std::pair< unsigned, const TargetRegisterClass * > getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI, StringRef Constraint, MVT VT) const
Given a physical register constraint (e.g.
This class provides iterator support for SDUse operands that use a specific SDNode.
std::pair< unsigned, const TargetRegisterClass * > getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI, StringRef Constraint, MVT VT) const override
Given a physical register constraint (e.g.
unsigned getOpcode() const
TRAP - Trapping instruction.
ManagedStringPool * getManagedStrPool() const
SectionKind - This is a simple POD value that classifies the properties of a section.
bool allowUnsafeFPMath(MachineFunction &MF) const
static mvt_range vector_valuetypes()
use_iterator use_begin() const
Provide iteration support to walk over all uses of an SDNode.
const SDValue & getValue() const
unsigned MaxStoresPerMemmove
Specify maximum bytes of store instructions per memmove call.
const char * getTargetNodeName(unsigned Opcode) const override
This method returns the name of a target specific DAG node.
static void ReplaceINTRINSIC_W_CHAIN(SDNode *N, SelectionDAG &DAG, SmallVectorImpl< SDValue > &Results)
std::vector< ArgListEntry > ArgListTy
bool isPointerTy() const
True if this is an instance of PointerType.
static SDValue PerformSHLCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, CodeGenOpt::Level OptLevel)
PerformSHLCombine - Runs PTX-specific DAG combine patterns on SHL nodes.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
This structure contains all information that is necessary for lowering calls.
MCSection * DwarfInfoSection
This class contains a discriminated union of information about pointers in memory operands...
bool usePrecSqrtF32() const
static bool IsPTXVectorType(MVT VT)
const SDValue & getRoot() const
Return the root tag of the SelectionDAG.
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...
MCSection * DwarfAbbrevSection
const MachinePointerInfo & getPointerInfo() const
static SDValue TryMULWIDECombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI)
TryMULWIDECombine - Attempt to replace a multiply of M bits with a multiply of M/2 bits that produces...
MCSection * EHFrameSection
EH frame section.
LegalizeAction
This enum indicates whether operations are valid for a target, and if not, what action should be used...
TokenFactor - This node takes multiple tokens as input and produces a single token result...
unsigned getABITypeAlignment(Type *Ty) const
Returns the minimum ABI-required alignment for the specified type.
TargetLoweringBase::LegalizeTypeAction getPreferredVectorAction(EVT VT) const override
Return the preferred vector type legalization action.
SmallVectorImpl< T >::const_pointer c_str(SmallVectorImpl< T > &str)
auto find(R &&Range, const T &Val) -> decltype(std::begin(Range))
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly...
InstrTy * getInstruction() const
std::string * getManagedString(const char *S)
bool getTgtMemIntrinsic(IntrinsicInfo &Info, const CallInst &I, unsigned Intrinsic) const override
Given an intrinsic, checks if on the target the intrinsic will need to map to a MemIntrinsicNode (tou...
SDValue getSqrtEstimate(SDValue Operand, SelectionDAG &DAG, int Enabled, int &ExtraSteps, bool &UseOneConst, bool Reciprocal) const override
Hooks for building estimates in place of slower divisions and square roots.
EXTRACT_VECTOR_ELT(VECTOR, IDX) - Returns a single element from VECTOR identified by the (potentially...
uint64_t getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
const Module * getModule() const
Return the module owning the function this instruction belongs to or nullptr it the function does not...
int getDivF32Level() const
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Module.h This file contains the declarations for the Module class.
Type * getType() const
All values are typed, get the type of this value.
NVPTXTargetLowering(const NVPTXTargetMachine &TM, const NVPTXSubtarget &STI)
SDValue getBuildVector(EVT VT, const SDLoc &DL, ArrayRef< SDValue > Ops)
Return an ISD::BUILD_VECTOR node.
MCSection * DwarfRangesSection
const SDValue & getChain() const
Byte Swap and Counting operators.
MachineMemOperand * getMemOperand() const
Return a MachineMemOperand object describing the memory reference performed by operation.
This is an abstract virtual class for memory operations.
MCSection * DwarfARangesSection
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
Represents one node in the SelectionDAG.
static mvt_range integer_valuetypes()
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...
Class for arbitrary precision integers.
bool isCast() const
Return true if this is a convert constant expression.
bool isSignedIntN(unsigned N) const
Check if this APInt has an N-bits signed integer value.
static SDValue PerformMULCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, CodeGenOpt::Level OptLevel)
PerformMULCombine - Runs PTX-specific DAG combine patterns on MUL nodes.
iterator_range< use_iterator > uses()
Select(COND, TRUEVAL, FALSEVAL).
op_iterator op_begin() const
bool isIntegerTy() const
True if this is an instance of IntegerType.
static use_iterator use_end()
ZERO_EXTEND - Used for integer types, zeroing the new bits.
ANY_EXTEND - Used for integer types. The high bits are undefined.
static cl::opt< bool > FtzEnabled("nvptx-f32ftz", cl::ZeroOrMore, cl::Hidden, cl::desc("NVPTX Specific: Flush f32 subnormals to sign-preserving zero."), cl::init(false))
FCOPYSIGN(X, Y) - Return the value of X with the sign of Y.
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.
llvm_unreachable("Unknown RegBank!")
unsigned getAddressSpace() const
Return the address space for the associated pointer.
BR_JT - Jumptable branch.
static std::vector< std::string > Flags
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
SmallVector< SDValue, 32 > OutVals
MCSection * LSDASection
If exception handling is supported by the target, this is the section the Language Specific Data Area...
Bitwise operators - logical and, logical or, logical xor.
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
bool isAggregateType() const
Return true if the type is an aggregate type.
virtual void LowerAsmOperandForConstraint(SDValue Op, std::string &Constraint, std::vector< SDValue > &Ops, SelectionDAG &DAG) const
Lower the specified operand into the Ops vector.
SMUL_LOHI/UMUL_LOHI - Multiply two integers of type iN, producing a signed/unsigned value of type i[2...
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...
static SDValue PerformSETCCCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI)
SIGN_EXTEND_INREG - This operator atomically performs a SHL/SRA pair to sign extend a small value in ...
Represents a section in PTX PTX does not have sections.
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
Establish a view to a call site for examination.
unsigned getSizeInBits() const
Return the size of the specified value type in bits.
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).
op_iterator op_end() const
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
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 MaxStoresPerMemcpy
Specify maximum bytes of store instructions per memcpy call.
static SmallVector< ParamVectorizationFlags, 16 > VectorizePTXValueVTs(const SmallVectorImpl< EVT > &ValueVTs, const SmallVectorImpl< uint64_t > &Offsets, unsigned ParamAlignment)
bool useF32FTZ(const MachineFunction &MF) const
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.
CONCAT_VECTORS(VECTOR0, VECTOR1, ...) - Given a number of values of vector type with the same length ...
StringRef getValueAsString() const
Return the attribute's value as a string.
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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...
bool isSimple() const
Test if the given EVT is simple (as opposed to being extended).
A raw_ostream that writes to an std::string.
FunTy * getCalledFunction() const
Return the function being called if this is a direct call, otherwise return null (if it's an indirect...
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.
unsigned getPrimitiveSizeInBits() const LLVM_READONLY
Return the basic size of this type if it is a primitive type.
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.
SDValue getSelectCC(const SDLoc &DL, SDValue LHS, SDValue RHS, SDValue True, SDValue False, ISD::CondCode Cond)
Helper function to make it easier to build SelectCC's if you just have an ISD::CondCode instead of an...
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.
static const Function * getParent(const Value *V)
const TargetLowering & getTargetLoweringInfo() const
Primary interface to the complete machine description for the target machine.
MCSection * BSSSection
Section that is default initialized to zero.
~NVPTXTargetObjectFile() override
StringRef - Represent a constant reference to a string, i.e.
APInt zext(unsigned width) const
Zero extend to a new width.
SetCC operator - This evaluates to a true value iff the condition is true.
MCSection * ReadOnlySection
Section that is readonly and can contain arbitrary initialized data.
unsigned MaxStoresPerMemset
Specify maximum number of store instructions per memset call.
bool allowFP16Math() const
MCSection * DwarfMacinfoSection
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
TRUNCATE - Completely drop the high bits.
unsigned getAlignment() const
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.
MCSection * DwarfLocSection
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
static unsigned getOpcForTextureInstr(unsigned Intrinsic)
bool isMachineOpcode() const
Test if this node has a post-isel opcode, directly corresponding to a MachineInstr opcode...
This file describes how to lower LLVM code to machine code.
unsigned getMachineOpcode() const
This may only be called if isMachineOpcode returns true.
SDValue getTargetGlobalAddress(const GlobalValue *GV, const SDLoc &DL, EVT VT, int64_t offset=0, unsigned char TargetFlags=0)
const NVPTXRegisterInfo * getRegisterInfo() const override
uint64_t getZExtValue() const
bool slt(const APInt &RHS) const
Signed less than comparison.
unsigned getVectorNumElements() const
Given a vector type, return the number of elements it contains.
This class is used to represent ISD::LOAD nodes.
const NVPTXTargetMachine * nvTM