42 #include "llvm/IR/IntrinsicsNVPTX.h" 64 #define DEBUG_TYPE "nvptx-lower" 76 cl::desc(
"NVPTX Specific: FMA contraction (0: don't do it" 77 " 1: do it 2: do it aggressively"),
82 cl::desc(
"NVPTX Specifies: 0 use div.approx, 1 use div.full, 2 use" 83 " IEEE Compliant F32 div.rnd if available."),
88 cl::desc(
"NVPTX Specific: 0 use sqrt.approx, 1 use sqrt.rn."),
93 cl::desc(
"NVPTX Specific: Flush f32 subnormals to sign-preserving zero."),
166 uint64_t StartingOffset = 0) {
176 Offsets->push_back(StartingOffset + 0);
177 Offsets->push_back(StartingOffset + 8);
184 if (
StructType *STy = dyn_cast<StructType>(Ty)) {
187 for(
auto *EI : STy->elements()) {
189 StartingOffset + SL->getElementOffset(ElementNum));
196 for (
unsigned i = 0,
e = TempVTs.
size(); i !=
e; ++i) {
198 uint64_t Off = TempOffsets[i];
207 if (EltVT ==
MVT::f16 && NumElts % 2 == 0) {
211 for (
unsigned j = 0; j != NumElts; ++j) {
240 if (AccessSize > ParamAlignment)
243 if (Offsets[Idx] & (AccessSize - 1))
246 EVT EltVT = ValueVTs[Idx];
250 if (EltSize >= AccessSize)
253 unsigned NumElts = AccessSize / EltSize;
255 if (AccessSize != EltSize * NumElts)
259 if (Idx + NumElts > ValueVTs.
size())
263 if (NumElts != 4 && NumElts != 2)
266 for (
unsigned j = Idx + 1; j < Idx + NumElts; ++j) {
268 if (ValueVTs[j] != EltVT)
272 if (Offsets[j] - Offsets[j - 1] != EltSize)
300 unsigned ParamAlignment) {
307 for (
int I = 0,
E = ValueVTs.
size();
I !=
E; ++
I) {
310 for (
unsigned AccessSize : {16, 8, 4, 2}) {
312 I, AccessSize, ValueVTs, Offsets, ParamAlignment);
321 assert(
I + 1 <
E &&
"Not enough elements.");
327 assert(
I + 3 <
E &&
"Not enough elements.");
597 return "NVPTXISD::CALL";
599 return "NVPTXISD::RET_FLAG";
601 return "NVPTXISD::LOAD_PARAM";
603 return "NVPTXISD::Wrapper";
605 return "NVPTXISD::DeclareParam";
607 return "NVPTXISD::DeclareScalarParam";
609 return "NVPTXISD::DeclareRet";
611 return "NVPTXISD::DeclareScalarRet";
613 return "NVPTXISD::DeclareRetParam";
615 return "NVPTXISD::PrintCall";
617 return "NVPTXISD::PrintConvergentCall";
619 return "NVPTXISD::PrintCallUni";
621 return "NVPTXISD::PrintConvergentCallUni";
623 return "NVPTXISD::LoadParam";
625 return "NVPTXISD::LoadParamV2";
627 return "NVPTXISD::LoadParamV4";
629 return "NVPTXISD::StoreParam";
631 return "NVPTXISD::StoreParamV2";
633 return "NVPTXISD::StoreParamV4";
635 return "NVPTXISD::StoreParamS32";
637 return "NVPTXISD::StoreParamU32";
639 return "NVPTXISD::CallArgBegin";
641 return "NVPTXISD::CallArg";
643 return "NVPTXISD::LastCallArg";
645 return "NVPTXISD::CallArgEnd";
647 return "NVPTXISD::CallVoid";
649 return "NVPTXISD::CallVal";
651 return "NVPTXISD::CallSymbol";
653 return "NVPTXISD::Prototype";
655 return "NVPTXISD::MoveParam";
657 return "NVPTXISD::StoreRetval";
659 return "NVPTXISD::StoreRetvalV2";
661 return "NVPTXISD::StoreRetvalV4";
663 return "NVPTXISD::PseudoUseParam";
665 return "NVPTXISD::RETURN";
667 return "NVPTXISD::CallSeqBegin";
669 return "NVPTXISD::CallSeqEnd";
671 return "NVPTXISD::CallPrototype";
673 return "NVPTXISD::ProxyReg";
675 return "NVPTXISD::LoadV2";
677 return "NVPTXISD::LoadV4";
679 return "NVPTXISD::LDGV2";
681 return "NVPTXISD::LDGV4";
683 return "NVPTXISD::LDUV2";
685 return "NVPTXISD::LDUV4";
687 return "NVPTXISD::StoreV2";
689 return "NVPTXISD::StoreV4";
691 return "NVPTXISD::FUN_SHFL_CLAMP";
693 return "NVPTXISD::FUN_SHFR_CLAMP";
695 return "NVPTXISD::IMAD";
697 return "NVPTXISD::SETP_F16X2";
699 return "NVPTXISD::Dummy";
701 return "NVPTXISD::MUL_WIDE_SIGNED";
703 return "NVPTXISD::MUL_WIDE_UNSIGNED";
707 return "NVPTXISD::Tex1DFloatFloatLevel";
709 return "NVPTXISD::Tex1DFloatFloatGrad";
713 return "NVPTXISD::Tex1DS32FloatLevel";
715 return "NVPTXISD::Tex1DS32FloatGrad";
719 return "NVPTXISD::Tex1DU32FloatLevel";
721 return "NVPTXISD::Tex1DU32FloatGrad";
725 return "NVPTXISD::Tex1DArrayFloatFloatLevel";
727 return "NVPTXISD::Tex1DArrayFloatFloatGrad";
731 return "NVPTXISD::Tex1DArrayS32FloatLevel";
733 return "NVPTXISD::Tex1DArrayS32FloatGrad";
737 return "NVPTXISD::Tex1DArrayU32FloatLevel";
739 return "NVPTXISD::Tex1DArrayU32FloatGrad";
743 return "NVPTXISD::Tex2DFloatFloatLevel";
745 return "NVPTXISD::Tex2DFloatFloatGrad";
749 return "NVPTXISD::Tex2DS32FloatLevel";
751 return "NVPTXISD::Tex2DS32FloatGrad";
755 return "NVPTXISD::Tex2DU32FloatLevel";
757 return "NVPTXISD::Tex2DU32FloatGrad";
761 return "NVPTXISD::Tex2DArrayFloatFloatLevel";
763 return "NVPTXISD::Tex2DArrayFloatFloatGrad";
767 return "NVPTXISD::Tex2DArrayS32FloatLevel";
769 return "NVPTXISD::Tex2DArrayS32FloatGrad";
773 return "NVPTXISD::Tex2DArrayU32FloatLevel";
775 return "NVPTXISD::Tex2DArrayU32FloatGrad";
779 return "NVPTXISD::Tex3DFloatFloatLevel";
781 return "NVPTXISD::Tex3DFloatFloatGrad";
785 return "NVPTXISD::Tex3DS32FloatLevel";
787 return "NVPTXISD::Tex3DS32FloatGrad";
791 return "NVPTXISD::Tex3DU32FloatLevel";
793 return "NVPTXISD::Tex3DU32FloatGrad";
796 return "NVPTXISD::TexCubeFloatFloatLevel";
799 return "NVPTXISD::TexCubeS32FloatLevel";
802 return "NVPTXISD::TexCubeU32FloatLevel";
804 return "NVPTXISD::TexCubeArrayFloatFloat";
806 return "NVPTXISD::TexCubeArrayFloatFloatLevel";
808 return "NVPTXISD::TexCubeArrayS32Float";
810 return "NVPTXISD::TexCubeArrayS32FloatLevel";
812 return "NVPTXISD::TexCubeArrayU32Float";
814 return "NVPTXISD::TexCubeArrayU32FloatLevel";
816 return "NVPTXISD::Tld4R2DFloatFloat";
818 return "NVPTXISD::Tld4G2DFloatFloat";
820 return "NVPTXISD::Tld4B2DFloatFloat";
822 return "NVPTXISD::Tld4A2DFloatFloat";
824 return "NVPTXISD::Tld4R2DS64Float";
826 return "NVPTXISD::Tld4G2DS64Float";
828 return "NVPTXISD::Tld4B2DS64Float";
830 return "NVPTXISD::Tld4A2DS64Float";
832 return "NVPTXISD::Tld4R2DU64Float";
834 return "NVPTXISD::Tld4G2DU64Float";
836 return "NVPTXISD::Tld4B2DU64Float";
838 return "NVPTXISD::Tld4A2DU64Float";
841 return "NVPTXISD::TexUnified1DFloatS32";
843 return "NVPTXISD::TexUnified1DFloatFloat";
845 return "NVPTXISD::TexUnified1DFloatFloatLevel";
847 return "NVPTXISD::TexUnified1DFloatFloatGrad";
849 return "NVPTXISD::TexUnified1DS32S32";
851 return "NVPTXISD::TexUnified1DS32Float";
853 return "NVPTXISD::TexUnified1DS32FloatLevel";
855 return "NVPTXISD::TexUnified1DS32FloatGrad";
857 return "NVPTXISD::TexUnified1DU32S32";
859 return "NVPTXISD::TexUnified1DU32Float";
861 return "NVPTXISD::TexUnified1DU32FloatLevel";
863 return "NVPTXISD::TexUnified1DU32FloatGrad";
865 return "NVPTXISD::TexUnified1DArrayFloatS32";
867 return "NVPTXISD::TexUnified1DArrayFloatFloat";
869 return "NVPTXISD::TexUnified1DArrayFloatFloatLevel";
871 return "NVPTXISD::TexUnified1DArrayFloatFloatGrad";
873 return "NVPTXISD::TexUnified1DArrayS32S32";
875 return "NVPTXISD::TexUnified1DArrayS32Float";
877 return "NVPTXISD::TexUnified1DArrayS32FloatLevel";
879 return "NVPTXISD::TexUnified1DArrayS32FloatGrad";
881 return "NVPTXISD::TexUnified1DArrayU32S32";
883 return "NVPTXISD::TexUnified1DArrayU32Float";
885 return "NVPTXISD::TexUnified1DArrayU32FloatLevel";
887 return "NVPTXISD::TexUnified1DArrayU32FloatGrad";
889 return "NVPTXISD::TexUnified2DFloatS32";
891 return "NVPTXISD::TexUnified2DFloatFloat";
893 return "NVPTXISD::TexUnified2DFloatFloatLevel";
895 return "NVPTXISD::TexUnified2DFloatFloatGrad";
897 return "NVPTXISD::TexUnified2DS32S32";
899 return "NVPTXISD::TexUnified2DS32Float";
901 return "NVPTXISD::TexUnified2DS32FloatLevel";
903 return "NVPTXISD::TexUnified2DS32FloatGrad";
905 return "NVPTXISD::TexUnified2DU32S32";
907 return "NVPTXISD::TexUnified2DU32Float";
909 return "NVPTXISD::TexUnified2DU32FloatLevel";
911 return "NVPTXISD::TexUnified2DU32FloatGrad";
913 return "NVPTXISD::TexUnified2DArrayFloatS32";
915 return "NVPTXISD::TexUnified2DArrayFloatFloat";
917 return "NVPTXISD::TexUnified2DArrayFloatFloatLevel";
919 return "NVPTXISD::TexUnified2DArrayFloatFloatGrad";
921 return "NVPTXISD::TexUnified2DArrayS32S32";
923 return "NVPTXISD::TexUnified2DArrayS32Float";
925 return "NVPTXISD::TexUnified2DArrayS32FloatLevel";
927 return "NVPTXISD::TexUnified2DArrayS32FloatGrad";
929 return "NVPTXISD::TexUnified2DArrayU32S32";
931 return "NVPTXISD::TexUnified2DArrayU32Float";
933 return "NVPTXISD::TexUnified2DArrayU32FloatLevel";
935 return "NVPTXISD::TexUnified2DArrayU32FloatGrad";
937 return "NVPTXISD::TexUnified3DFloatS32";
939 return "NVPTXISD::TexUnified3DFloatFloat";
941 return "NVPTXISD::TexUnified3DFloatFloatLevel";
943 return "NVPTXISD::TexUnified3DFloatFloatGrad";
945 return "NVPTXISD::TexUnified3DS32S32";
947 return "NVPTXISD::TexUnified3DS32Float";
949 return "NVPTXISD::TexUnified3DS32FloatLevel";
951 return "NVPTXISD::TexUnified3DS32FloatGrad";
953 return "NVPTXISD::TexUnified3DU32S32";
955 return "NVPTXISD::TexUnified3DU32Float";
957 return "NVPTXISD::TexUnified3DU32FloatLevel";
959 return "NVPTXISD::TexUnified3DU32FloatGrad";
961 return "NVPTXISD::TexUnifiedCubeFloatFloat";
963 return "NVPTXISD::TexUnifiedCubeFloatFloatLevel";
965 return "NVPTXISD::TexUnifiedCubeS32Float";
967 return "NVPTXISD::TexUnifiedCubeS32FloatLevel";
969 return "NVPTXISD::TexUnifiedCubeU32Float";
971 return "NVPTXISD::TexUnifiedCubeU32FloatLevel";
973 return "NVPTXISD::TexUnifiedCubeArrayFloatFloat";
975 return "NVPTXISD::TexUnifiedCubeArrayFloatFloatLevel";
977 return "NVPTXISD::TexUnifiedCubeArrayS32Float";
979 return "NVPTXISD::TexUnifiedCubeArrayS32FloatLevel";
981 return "NVPTXISD::TexUnifiedCubeArrayU32Float";
983 return "NVPTXISD::TexUnifiedCubeArrayU32FloatLevel";
985 return "NVPTXISD::Tld4UnifiedR2DFloatFloat";
987 return "NVPTXISD::Tld4UnifiedG2DFloatFloat";
989 return "NVPTXISD::Tld4UnifiedB2DFloatFloat";
991 return "NVPTXISD::Tld4UnifiedA2DFloatFloat";
993 return "NVPTXISD::Tld4UnifiedR2DS64Float";
995 return "NVPTXISD::Tld4UnifiedG2DS64Float";
997 return "NVPTXISD::Tld4UnifiedB2DS64Float";
999 return "NVPTXISD::Tld4UnifiedA2DS64Float";
1001 return "NVPTXISD::Tld4UnifiedR2DU64Float";
1003 return "NVPTXISD::Tld4UnifiedG2DU64Float";
1005 return "NVPTXISD::Tld4UnifiedB2DU64Float";
1007 return "NVPTXISD::Tld4UnifiedA2DU64Float";
1204 bool Reciprocal)
const {
1206 (Enabled == ReciprocalEstimate::Unspecified && !
usePrecSqrtF32())))
1209 if (ExtraSteps == ReciprocalEstimate::Unspecified)
1225 if (Reciprocal || ExtraSteps > 0) {
1227 return MakeIntrinsicCall(Ftz ? Intrinsic::nvvm_rsqrt_approx_ftz_f
1228 : Intrinsic::nvvm_rsqrt_approx_f);
1230 return MakeIntrinsicCall(Intrinsic::nvvm_rsqrt_approx_d);
1235 return MakeIntrinsicCall(Ftz ? Intrinsic::nvvm_sqrt_approx_ftz_f
1236 : Intrinsic::nvvm_sqrt_approx_f);
1245 MakeIntrinsicCall(Intrinsic::nvvm_rsqrt_approx_d));
1266 assert(isABI &&
"Non-ABI compilation is not supported");
1270 std::stringstream
O;
1279 if (
auto *ITy = dyn_cast<IntegerType>(retTy)) {
1280 size = ITy->getBitWidth();
1283 "Floating point type expected here");
1292 O <<
".param .b" << size <<
" _";
1293 }
else if (isa<PointerType>(retTy)) {
1294 O <<
".param .b" << PtrVT.getSizeInBits() <<
" _";
1297 O <<
".param .align " << retAlignment <<
" .b8 _[" 1309 for (
unsigned i = 0,
e = Args.size(); i !=
e; ++i, ++OIdx) {
1310 Type *Ty = Args[i].Ty;
1316 if (!Outs[OIdx].Flags.isByVal()) {
1321 if (!
getAlign(*CallI, i + 1, align))
1324 O <<
".param .align " << align <<
" .b8 ";
1326 O <<
"[" << sz <<
"]";
1330 if (
unsigned len = vtparts.
size())
1337 "type mismatch between callee prototype and arguments");
1340 if (isa<IntegerType>(Ty)) {
1344 }
else if (isa<PointerType>(Ty)) {
1345 sz = PtrVT.getSizeInBits();
1353 O <<
".param .b" << sz <<
" ";
1358 assert(PTy &&
"Param with byval attribute should be a pointer type");
1359 Type *ETy = PTy->getElementType();
1361 unsigned align = Outs[OIdx].Flags.getByValAlign();
1363 O <<
".param .align " << align <<
" .b8 ";
1365 O <<
"[" << sz <<
"]";
1371 unsigned NVPTXTargetLowering::getArgumentAlignment(
SDValue Callee,
1373 Type *Ty,
unsigned Idx,
1383 if (!DirectCallee) {
1387 assert(CalleeI &&
"Call target is not a function or derived value?");
1390 if (isa<CallInst>(CalleeI)) {
1392 if (
getAlign(*cast<CallInst>(CalleeI), Idx, Align))
1395 const Value *CalleeV = cast<CallInst>(CalleeI)->getCalledValue();
1397 while (isa<ConstantExpr>(CalleeV)) {
1402 CalleeV = cast<ConstantExpr>(CalleeV)->getOperand(0);
1407 if (isa<Function>(CalleeV))
1408 DirectCallee = CalleeV;
1415 if (
getAlign(*cast<Function>(DirectCallee), Idx, Align))
1439 assert(isABI &&
"Non-ABI compilation is not supported");
1447 unsigned paramCount = 0;
1460 for (
unsigned i = 0,
e = Args.size(); i !=
e; ++i, ++OIdx) {
1461 EVT VT = Outs[OIdx].VT;
1462 Type *Ty = Args[i].Ty;
1464 if (!Outs[OIdx].Flags.isByVal()) {
1469 getArgumentAlignment(Callee, CS, Ty, paramCount + 1, DL);
1490 SDValue DeclareScalarParamOps[] = {
1495 DeclareScalarParamOps);
1504 bool ExtendIntegerParam =
1509 for (
unsigned j = 0, je = VTs.
size(); j != je; ++j) {
1512 assert(StoreOperands.
empty() &&
"Unfinished preceding store.");
1519 SDValue StVal = OutVals[OIdx];
1520 if (ExtendIntegerParam) {
1521 assert(VTs.
size() == 1 &&
"Scalar can't have multiple parts.");
1536 unsigned NumElts = StoreOperands.
size() - 3;
1556 EVT TheStoreType = ExtendIntegerParam ?
MVT::i32 : VTs[j];
1567 StoreOperands.
clear();
1571 assert(StoreOperands.
empty() &&
"Unfinished parameter store.");
1582 assert(PTy &&
"Type of a byval parameter should be pointer");
1586 unsigned sz = Outs[OIdx].Flags.getByValSize();
1588 unsigned ArgAlign = Outs[OIdx].Flags.getByValAlign();
1604 for (
unsigned j = 0, je = VTs.
size(); j != je; ++j) {
1605 EVT elemtype = VTs[j];
1606 int curOffset = Offsets[j];
1617 SDValue CopyParamOps[] = { Chain,
1622 CopyParamOps, elemtype,
1632 unsigned retAlignment = 0;
1635 if (Ins.
size() > 0) {
1660 retAlignment = getArgumentAlignment(Callee, CS, RetTy, 0, DL);
1662 SDValue DeclareRetOps[] = { Chain,
1677 if (isa<ExternalSymbolSDNode>(Callee)) {
1682 assert(CalleeFunc !=
nullptr &&
"Libcall callee must be set.");
1686 CalleeFunc->
addFnAttr(
"nvptx-libcall-callee",
"true");
1689 if (isIndirectCall) {
1698 std::string Proto =
getPrototype(DL, RetTy, Args, Outs, retAlignment, CS);
1699 const char *ProtoStr =
1717 Chain = DAG.
getNode(Opcode, dl, PrintCallVTs, PrintCallOps);
1722 SDValue CallVoidOps[] = { Chain, Callee, InFlag };
1728 SDValue CallArgBeginOps[] = { Chain, InFlag };
1733 for (
unsigned i = 0,
e = paramCount; i !=
e; ++i) {
1742 Chain = DAG.
getNode(opcode, dl, CallArgVTs, CallArgOps);
1746 SDValue CallArgEndOps[] = { Chain,
1752 if (isIndirectCall) {
1754 SDValue PrototypeOps[] = { Chain,
1765 if (Ins.
size() > 0) {
1771 unsigned RetAlign = getArgumentAlignment(Callee, CS, RetTy, 0, DL);
1780 bool ExtendIntegerRetVal =
1783 for (
unsigned i = 0,
e = VTs.
size(); i !=
e; ++i) {
1784 bool needTruncate =
false;
1785 EVT TheLoadType = VTs[i];
1786 EVT EltType = Ins[i].VT;
1788 if (ExtendIntegerRetVal) {
1791 needTruncate =
true;
1793 if (VTs[i].isInteger())
1794 needTruncate =
true;
1800 assert(VecIdx == -1 && LoadVTs.
empty() &&
"Orphaned operand list.");
1807 unsigned NumElts = LoadVTs.
size();
1829 Op, dl, DAG.
getVTList(LoadVTs), LoadOperands, TheLoadType,
1833 for (
unsigned j = 0; j < NumElts; ++j) {
1843 InFlag = RetVal.
getValue(NumElts + 1);
1863 for (
unsigned i = 0; i < ProxyRegOps.
size(); ++i) {
1867 { Chain, ProxyRegOps[i], InFlag }
1873 if (ProxyRegTruncates[i].hasValue()) {
1895 for (
unsigned i = 0; i < NumOperands; ++i) {
1900 for (
unsigned j = 0; j < NumSubElem; ++j) {
1927 cast<ConstantFPSDNode>(Op->
getOperand(0))->getValueAPF().bitcastToAPInt();
1929 cast<ConstantFPSDNode>(Op->
getOperand(1))->getValueAPF().bitcastToAPInt();
1939 if (isa<ConstantSDNode>(Index.
getNode()))
2082 return LowerFROUND32(Op, DAG);
2085 return LowerFROUND64(Op, DAG);
2107 const int SignBitMask = 0x80000000;
2110 const int PointFiveInBits = 0x3F000000;
2111 SDValue PointFiveWithSignRaw =
2184 return LowerBUILD_VECTOR(Op, DAG);
2188 return LowerEXTRACT_VECTOR_ELT(Op, DAG);
2190 return LowerCONCAT_VECTORS(Op, DAG);
2192 return LowerSTORE(Op, DAG);
2194 return LowerLOAD(Op, DAG);
2196 return LowerShiftLeftParts(Op, DAG);
2199 return LowerShiftRightParts(Op, DAG);
2201 return LowerSelect(Op, DAG);
2203 return LowerFROUND(Op, DAG);
2227 return LowerLOADi1(Op, DAG);
2255 "Custom lowering for i1 load only");
2272 return LowerSTOREi1(Op, DAG);
2282 return LowerSTOREVector(Op, DAG);
2324 unsigned PrefAlign =
2326 if (Align < PrefAlign) {
2335 unsigned Opcode = 0;
2342 bool NeedExt =
false;
2346 bool StoreF16x2 =
false;
2374 for (
unsigned i = 0; i < NumElts; ++i) {
2384 for (
unsigned i = 0; i < NumElts; ++i) {
2427 NVPTXTargetLowering::getParamSymbol(
SelectionDAG &DAG,
int idx,
EVT v)
const {
2428 std::string ParamSym;
2434 std::string *SavedStr =
2442 static const char *
const specialTypes[] = {
"struct._image2d_t",
2443 "struct._image3d_t",
2444 "struct._sampler_t" };
2456 if (!STy || STy->isLiteral())
2460 STy->getName()) !=
std::end(specialTypes);
2476 std::vector<SDValue> OutChains;
2479 assert(isABI &&
"Non-ABI compilation is not supported");
2483 std::vector<Type *> argTypes;
2484 std::vector<const Argument *> theArgs;
2486 theArgs.push_back(&
I);
2487 argTypes.push_back(
I.getType());
2498 unsigned InsIdx = 0;
2501 for (
unsigned i = 0,
e = theArgs.size(); i !=
e; ++i, ++idx, ++InsIdx) {
2502 Type *Ty = argTypes[i];
2512 "Only kernels can have image/sampler params");
2517 if (theArgs[i]->use_empty()) {
2523 assert(vtparts.
size() > 0 &&
"empty aggregate type not expected");
2524 for (
unsigned parti = 0, parte = vtparts.
size(); parti != parte;
2529 if (vtparts.
size() > 0)
2536 for (
unsigned parti = 0; parti < NumRegs; ++parti) {
2553 bool aggregateIsPacked =
false;
2554 if (
StructType *STy = dyn_cast<StructType>(Ty))
2555 aggregateIsPacked = STy->isPacked();
2560 assert(VTs.
size() > 0 &&
"Unexpected empty type.");
2564 SDValue Arg = getParamSymbol(DAG, idx, PtrVT);
2566 for (
unsigned parti = 0, parte = VTs.
size(); parti != parte; ++parti) {
2568 assert(VecIdx == -1 &&
"Orphaned vector.");
2573 if (VectorInfo[parti] &
PVF_LAST) {
2574 unsigned NumElts = parti - VecIdx + 1;
2575 EVT EltVT = VTs[parti];
2593 DAG.
getLoad(VecVT, dl, Root, VecAddr,
2599 for (
unsigned j = 0; j < NumElts; ++j) {
2610 if (Ins[InsIdx].VT.isInteger() &&
2614 Elt = DAG.
getNode(Extend, dl, Ins[InsIdx].VT, Elt);
2637 assert(ObjectVT == Ins[InsIdx].VT &&
2638 "Ins type did not match function type");
2639 SDValue Arg = getParamSymbol(DAG, idx, PtrVT);
2654 if (!OutChains.empty())
2670 assert(isABI &&
"Non-ABI compilation is not supported");
2678 assert(VTs.
size() == OutVals.
size() &&
"Bad return value decomposition");
2686 bool ExtendIntegerRetVal =
2690 for (
unsigned i = 0,
e = VTs.
size(); i !=
e; ++i) {
2693 assert(StoreOperands.
empty() &&
"Orphaned operand list.");
2699 if (ExtendIntegerRetVal) {
2715 unsigned NumElts = StoreOperands.
size() - 2;
2732 EVT TheStoreType = ExtendIntegerRetVal ?
MVT::i32 : VTs[i];
2734 StoreOperands, TheStoreType,
2738 StoreOperands.
clear();
2746 SDValue Op, std::string &Constraint, std::vector<SDValue> &Ops,
2748 if (Constraint.length() > 1)
2755 switch (Intrinsic) {
2759 case Intrinsic::nvvm_tex_1d_v4f32_s32:
2761 case Intrinsic::nvvm_tex_1d_v4f32_f32:
2763 case Intrinsic::nvvm_tex_1d_level_v4f32_f32:
2765 case Intrinsic::nvvm_tex_1d_grad_v4f32_f32:
2767 case Intrinsic::nvvm_tex_1d_v4s32_s32:
2769 case Intrinsic::nvvm_tex_1d_v4s32_f32:
2771 case Intrinsic::nvvm_tex_1d_level_v4s32_f32:
2773 case Intrinsic::nvvm_tex_1d_grad_v4s32_f32:
2775 case Intrinsic::nvvm_tex_1d_v4u32_s32:
2777 case Intrinsic::nvvm_tex_1d_v4u32_f32:
2779 case Intrinsic::nvvm_tex_1d_level_v4u32_f32:
2781 case Intrinsic::nvvm_tex_1d_grad_v4u32_f32:
2784 case Intrinsic::nvvm_tex_1d_array_v4f32_s32:
2786 case Intrinsic::nvvm_tex_1d_array_v4f32_f32:
2788 case Intrinsic::nvvm_tex_1d_array_level_v4f32_f32:
2790 case Intrinsic::nvvm_tex_1d_array_grad_v4f32_f32:
2792 case Intrinsic::nvvm_tex_1d_array_v4s32_s32:
2794 case Intrinsic::nvvm_tex_1d_array_v4s32_f32:
2796 case Intrinsic::nvvm_tex_1d_array_level_v4s32_f32:
2798 case Intrinsic::nvvm_tex_1d_array_grad_v4s32_f32:
2800 case Intrinsic::nvvm_tex_1d_array_v4u32_s32:
2802 case Intrinsic::nvvm_tex_1d_array_v4u32_f32:
2804 case Intrinsic::nvvm_tex_1d_array_level_v4u32_f32:
2806 case Intrinsic::nvvm_tex_1d_array_grad_v4u32_f32:
2809 case Intrinsic::nvvm_tex_2d_v4f32_s32:
2811 case Intrinsic::nvvm_tex_2d_v4f32_f32:
2813 case Intrinsic::nvvm_tex_2d_level_v4f32_f32:
2815 case Intrinsic::nvvm_tex_2d_grad_v4f32_f32:
2817 case Intrinsic::nvvm_tex_2d_v4s32_s32:
2819 case Intrinsic::nvvm_tex_2d_v4s32_f32:
2821 case Intrinsic::nvvm_tex_2d_level_v4s32_f32:
2823 case Intrinsic::nvvm_tex_2d_grad_v4s32_f32:
2825 case Intrinsic::nvvm_tex_2d_v4u32_s32:
2827 case Intrinsic::nvvm_tex_2d_v4u32_f32:
2829 case Intrinsic::nvvm_tex_2d_level_v4u32_f32:
2831 case Intrinsic::nvvm_tex_2d_grad_v4u32_f32:
2834 case Intrinsic::nvvm_tex_2d_array_v4f32_s32:
2836 case Intrinsic::nvvm_tex_2d_array_v4f32_f32:
2838 case Intrinsic::nvvm_tex_2d_array_level_v4f32_f32:
2840 case Intrinsic::nvvm_tex_2d_array_grad_v4f32_f32:
2842 case Intrinsic::nvvm_tex_2d_array_v4s32_s32:
2844 case Intrinsic::nvvm_tex_2d_array_v4s32_f32:
2846 case Intrinsic::nvvm_tex_2d_array_level_v4s32_f32:
2848 case Intrinsic::nvvm_tex_2d_array_grad_v4s32_f32:
2850 case Intrinsic::nvvm_tex_2d_array_v4u32_s32:
2852 case Intrinsic::nvvm_tex_2d_array_v4u32_f32:
2854 case Intrinsic::nvvm_tex_2d_array_level_v4u32_f32:
2856 case Intrinsic::nvvm_tex_2d_array_grad_v4u32_f32:
2859 case Intrinsic::nvvm_tex_3d_v4f32_s32:
2861 case Intrinsic::nvvm_tex_3d_v4f32_f32:
2863 case Intrinsic::nvvm_tex_3d_level_v4f32_f32:
2865 case Intrinsic::nvvm_tex_3d_grad_v4f32_f32:
2867 case Intrinsic::nvvm_tex_3d_v4s32_s32:
2869 case Intrinsic::nvvm_tex_3d_v4s32_f32:
2871 case Intrinsic::nvvm_tex_3d_level_v4s32_f32:
2873 case Intrinsic::nvvm_tex_3d_grad_v4s32_f32:
2875 case Intrinsic::nvvm_tex_3d_v4u32_s32:
2877 case Intrinsic::nvvm_tex_3d_v4u32_f32:
2879 case Intrinsic::nvvm_tex_3d_level_v4u32_f32:
2881 case Intrinsic::nvvm_tex_3d_grad_v4u32_f32:
2884 case Intrinsic::nvvm_tex_cube_v4f32_f32:
2886 case Intrinsic::nvvm_tex_cube_level_v4f32_f32:
2888 case Intrinsic::nvvm_tex_cube_v4s32_f32:
2890 case Intrinsic::nvvm_tex_cube_level_v4s32_f32:
2892 case Intrinsic::nvvm_tex_cube_v4u32_f32:
2894 case Intrinsic::nvvm_tex_cube_level_v4u32_f32:
2897 case Intrinsic::nvvm_tex_cube_array_v4f32_f32:
2899 case Intrinsic::nvvm_tex_cube_array_level_v4f32_f32:
2901 case Intrinsic::nvvm_tex_cube_array_v4s32_f32:
2903 case Intrinsic::nvvm_tex_cube_array_level_v4s32_f32:
2905 case Intrinsic::nvvm_tex_cube_array_v4u32_f32:
2907 case Intrinsic::nvvm_tex_cube_array_level_v4u32_f32:
2910 case Intrinsic::nvvm_tld4_r_2d_v4f32_f32:
2912 case Intrinsic::nvvm_tld4_g_2d_v4f32_f32:
2914 case Intrinsic::nvvm_tld4_b_2d_v4f32_f32:
2916 case Intrinsic::nvvm_tld4_a_2d_v4f32_f32:
2918 case Intrinsic::nvvm_tld4_r_2d_v4s32_f32:
2920 case Intrinsic::nvvm_tld4_g_2d_v4s32_f32:
2922 case Intrinsic::nvvm_tld4_b_2d_v4s32_f32:
2924 case Intrinsic::nvvm_tld4_a_2d_v4s32_f32:
2926 case Intrinsic::nvvm_tld4_r_2d_v4u32_f32:
2928 case Intrinsic::nvvm_tld4_g_2d_v4u32_f32:
2930 case Intrinsic::nvvm_tld4_b_2d_v4u32_f32:
2932 case Intrinsic::nvvm_tld4_a_2d_v4u32_f32:
2935 case Intrinsic::nvvm_tex_unified_1d_v4f32_s32:
2937 case Intrinsic::nvvm_tex_unified_1d_v4f32_f32:
2939 case Intrinsic::nvvm_tex_unified_1d_level_v4f32_f32:
2941 case Intrinsic::nvvm_tex_unified_1d_grad_v4f32_f32:
2943 case Intrinsic::nvvm_tex_unified_1d_v4s32_s32:
2945 case Intrinsic::nvvm_tex_unified_1d_v4s32_f32:
2947 case Intrinsic::nvvm_tex_unified_1d_level_v4s32_f32:
2949 case Intrinsic::nvvm_tex_unified_1d_grad_v4s32_f32:
2951 case Intrinsic::nvvm_tex_unified_1d_v4u32_s32:
2953 case Intrinsic::nvvm_tex_unified_1d_v4u32_f32:
2955 case Intrinsic::nvvm_tex_unified_1d_level_v4u32_f32:
2957 case Intrinsic::nvvm_tex_unified_1d_grad_v4u32_f32:
2960 case Intrinsic::nvvm_tex_unified_1d_array_v4f32_s32:
2962 case Intrinsic::nvvm_tex_unified_1d_array_v4f32_f32:
2964 case Intrinsic::nvvm_tex_unified_1d_array_level_v4f32_f32:
2966 case Intrinsic::nvvm_tex_unified_1d_array_grad_v4f32_f32:
2968 case Intrinsic::nvvm_tex_unified_1d_array_v4s32_s32:
2970 case Intrinsic::nvvm_tex_unified_1d_array_v4s32_f32:
2972 case Intrinsic::nvvm_tex_unified_1d_array_level_v4s32_f32:
2974 case Intrinsic::nvvm_tex_unified_1d_array_grad_v4s32_f32:
2976 case Intrinsic::nvvm_tex_unified_1d_array_v4u32_s32:
2978 case Intrinsic::nvvm_tex_unified_1d_array_v4u32_f32:
2980 case Intrinsic::nvvm_tex_unified_1d_array_level_v4u32_f32:
2982 case Intrinsic::nvvm_tex_unified_1d_array_grad_v4u32_f32:
2985 case Intrinsic::nvvm_tex_unified_2d_v4f32_s32:
2987 case Intrinsic::nvvm_tex_unified_2d_v4f32_f32:
2989 case Intrinsic::nvvm_tex_unified_2d_level_v4f32_f32:
2991 case Intrinsic::nvvm_tex_unified_2d_grad_v4f32_f32:
2993 case Intrinsic::nvvm_tex_unified_2d_v4s32_s32:
2995 case Intrinsic::nvvm_tex_unified_2d_v4s32_f32:
2997 case Intrinsic::nvvm_tex_unified_2d_level_v4s32_f32:
2999 case Intrinsic::nvvm_tex_unified_2d_grad_v4s32_f32:
3001 case Intrinsic::nvvm_tex_unified_2d_v4u32_s32:
3003 case Intrinsic::nvvm_tex_unified_2d_v4u32_f32:
3005 case Intrinsic::nvvm_tex_unified_2d_level_v4u32_f32:
3007 case Intrinsic::nvvm_tex_unified_2d_grad_v4u32_f32:
3010 case Intrinsic::nvvm_tex_unified_2d_array_v4f32_s32:
3012 case Intrinsic::nvvm_tex_unified_2d_array_v4f32_f32:
3014 case Intrinsic::nvvm_tex_unified_2d_array_level_v4f32_f32:
3016 case Intrinsic::nvvm_tex_unified_2d_array_grad_v4f32_f32:
3018 case Intrinsic::nvvm_tex_unified_2d_array_v4s32_s32:
3020 case Intrinsic::nvvm_tex_unified_2d_array_v4s32_f32:
3022 case Intrinsic::nvvm_tex_unified_2d_array_level_v4s32_f32:
3024 case Intrinsic::nvvm_tex_unified_2d_array_grad_v4s32_f32:
3026 case Intrinsic::nvvm_tex_unified_2d_array_v4u32_s32:
3028 case Intrinsic::nvvm_tex_unified_2d_array_v4u32_f32:
3030 case Intrinsic::nvvm_tex_unified_2d_array_level_v4u32_f32:
3032 case Intrinsic::nvvm_tex_unified_2d_array_grad_v4u32_f32:
3035 case Intrinsic::nvvm_tex_unified_3d_v4f32_s32:
3037 case Intrinsic::nvvm_tex_unified_3d_v4f32_f32:
3039 case Intrinsic::nvvm_tex_unified_3d_level_v4f32_f32:
3041 case Intrinsic::nvvm_tex_unified_3d_grad_v4f32_f32:
3043 case Intrinsic::nvvm_tex_unified_3d_v4s32_s32:
3045 case Intrinsic::nvvm_tex_unified_3d_v4s32_f32:
3047 case Intrinsic::nvvm_tex_unified_3d_level_v4s32_f32:
3049 case Intrinsic::nvvm_tex_unified_3d_grad_v4s32_f32:
3051 case Intrinsic::nvvm_tex_unified_3d_v4u32_s32:
3053 case Intrinsic::nvvm_tex_unified_3d_v4u32_f32:
3055 case Intrinsic::nvvm_tex_unified_3d_level_v4u32_f32:
3057 case Intrinsic::nvvm_tex_unified_3d_grad_v4u32_f32:
3060 case Intrinsic::nvvm_tex_unified_cube_v4f32_f32:
3062 case Intrinsic::nvvm_tex_unified_cube_level_v4f32_f32:
3064 case Intrinsic::nvvm_tex_unified_cube_v4s32_f32:
3066 case Intrinsic::nvvm_tex_unified_cube_level_v4s32_f32:
3068 case Intrinsic::nvvm_tex_unified_cube_v4u32_f32:
3070 case Intrinsic::nvvm_tex_unified_cube_level_v4u32_f32:
3073 case Intrinsic::nvvm_tex_unified_cube_array_v4f32_f32:
3075 case Intrinsic::nvvm_tex_unified_cube_array_level_v4f32_f32:
3077 case Intrinsic::nvvm_tex_unified_cube_array_v4s32_f32:
3079 case Intrinsic::nvvm_tex_unified_cube_array_level_v4s32_f32:
3081 case Intrinsic::nvvm_tex_unified_cube_array_v4u32_f32:
3083 case Intrinsic::nvvm_tex_unified_cube_array_level_v4u32_f32:
3086 case Intrinsic::nvvm_tld4_unified_r_2d_v4f32_f32:
3088 case Intrinsic::nvvm_tld4_unified_g_2d_v4f32_f32:
3090 case Intrinsic::nvvm_tld4_unified_b_2d_v4f32_f32:
3092 case Intrinsic::nvvm_tld4_unified_a_2d_v4f32_f32:
3094 case Intrinsic::nvvm_tld4_unified_r_2d_v4s32_f32:
3096 case Intrinsic::nvvm_tld4_unified_g_2d_v4s32_f32:
3098 case Intrinsic::nvvm_tld4_unified_b_2d_v4s32_f32:
3100 case Intrinsic::nvvm_tld4_unified_a_2d_v4s32_f32:
3102 case Intrinsic::nvvm_tld4_unified_r_2d_v4u32_f32:
3104 case Intrinsic::nvvm_tld4_unified_g_2d_v4u32_f32:
3106 case Intrinsic::nvvm_tld4_unified_b_2d_v4u32_f32:
3108 case Intrinsic::nvvm_tld4_unified_a_2d_v4u32_f32:
3114 switch (Intrinsic) {
3117 case Intrinsic::nvvm_suld_1d_i8_clamp:
3119 case Intrinsic::nvvm_suld_1d_i16_clamp:
3121 case Intrinsic::nvvm_suld_1d_i32_clamp:
3123 case Intrinsic::nvvm_suld_1d_i64_clamp:
3125 case Intrinsic::nvvm_suld_1d_v2i8_clamp:
3127 case Intrinsic::nvvm_suld_1d_v2i16_clamp:
3129 case Intrinsic::nvvm_suld_1d_v2i32_clamp:
3131 case Intrinsic::nvvm_suld_1d_v2i64_clamp:
3133 case Intrinsic::nvvm_suld_1d_v4i8_clamp:
3135 case Intrinsic::nvvm_suld_1d_v4i16_clamp:
3137 case Intrinsic::nvvm_suld_1d_v4i32_clamp:
3139 case Intrinsic::nvvm_suld_1d_array_i8_clamp:
3141 case Intrinsic::nvvm_suld_1d_array_i16_clamp:
3143 case Intrinsic::nvvm_suld_1d_array_i32_clamp:
3145 case Intrinsic::nvvm_suld_1d_array_i64_clamp:
3147 case Intrinsic::nvvm_suld_1d_array_v2i8_clamp:
3149 case Intrinsic::nvvm_suld_1d_array_v2i16_clamp:
3151 case Intrinsic::nvvm_suld_1d_array_v2i32_clamp:
3153 case Intrinsic::nvvm_suld_1d_array_v2i64_clamp:
3155 case Intrinsic::nvvm_suld_1d_array_v4i8_clamp:
3157 case Intrinsic::nvvm_suld_1d_array_v4i16_clamp:
3159 case Intrinsic::nvvm_suld_1d_array_v4i32_clamp:
3161 case Intrinsic::nvvm_suld_2d_i8_clamp:
3163 case Intrinsic::nvvm_suld_2d_i16_clamp:
3165 case Intrinsic::nvvm_suld_2d_i32_clamp:
3167 case Intrinsic::nvvm_suld_2d_i64_clamp:
3169 case Intrinsic::nvvm_suld_2d_v2i8_clamp:
3171 case Intrinsic::nvvm_suld_2d_v2i16_clamp:
3173 case Intrinsic::nvvm_suld_2d_v2i32_clamp:
3175 case Intrinsic::nvvm_suld_2d_v2i64_clamp:
3177 case Intrinsic::nvvm_suld_2d_v4i8_clamp:
3179 case Intrinsic::nvvm_suld_2d_v4i16_clamp:
3181 case Intrinsic::nvvm_suld_2d_v4i32_clamp:
3183 case Intrinsic::nvvm_suld_2d_array_i8_clamp:
3185 case Intrinsic::nvvm_suld_2d_array_i16_clamp:
3187 case Intrinsic::nvvm_suld_2d_array_i32_clamp:
3189 case Intrinsic::nvvm_suld_2d_array_i64_clamp:
3191 case Intrinsic::nvvm_suld_2d_array_v2i8_clamp:
3193 case Intrinsic::nvvm_suld_2d_array_v2i16_clamp:
3195 case Intrinsic::nvvm_suld_2d_array_v2i32_clamp:
3197 case Intrinsic::nvvm_suld_2d_array_v2i64_clamp:
3199 case Intrinsic::nvvm_suld_2d_array_v4i8_clamp:
3201 case Intrinsic::nvvm_suld_2d_array_v4i16_clamp:
3203 case Intrinsic::nvvm_suld_2d_array_v4i32_clamp:
3205 case Intrinsic::nvvm_suld_3d_i8_clamp:
3207 case Intrinsic::nvvm_suld_3d_i16_clamp:
3209 case Intrinsic::nvvm_suld_3d_i32_clamp:
3211 case Intrinsic::nvvm_suld_3d_i64_clamp:
3213 case Intrinsic::nvvm_suld_3d_v2i8_clamp:
3215 case Intrinsic::nvvm_suld_3d_v2i16_clamp:
3217 case Intrinsic::nvvm_suld_3d_v2i32_clamp:
3219 case Intrinsic::nvvm_suld_3d_v2i64_clamp:
3221 case Intrinsic::nvvm_suld_3d_v4i8_clamp:
3223 case Intrinsic::nvvm_suld_3d_v4i16_clamp:
3225 case Intrinsic::nvvm_suld_3d_v4i32_clamp:
3227 case Intrinsic::nvvm_suld_1d_i8_trap:
3229 case Intrinsic::nvvm_suld_1d_i16_trap:
3231 case Intrinsic::nvvm_suld_1d_i32_trap:
3233 case Intrinsic::nvvm_suld_1d_i64_trap:
3235 case Intrinsic::nvvm_suld_1d_v2i8_trap:
3237 case Intrinsic::nvvm_suld_1d_v2i16_trap:
3239 case Intrinsic::nvvm_suld_1d_v2i32_trap:
3241 case Intrinsic::nvvm_suld_1d_v2i64_trap:
3243 case Intrinsic::nvvm_suld_1d_v4i8_trap:
3245 case Intrinsic::nvvm_suld_1d_v4i16_trap:
3247 case Intrinsic::nvvm_suld_1d_v4i32_trap:
3249 case Intrinsic::nvvm_suld_1d_array_i8_trap:
3251 case Intrinsic::nvvm_suld_1d_array_i16_trap:
3253 case Intrinsic::nvvm_suld_1d_array_i32_trap:
3255 case Intrinsic::nvvm_suld_1d_array_i64_trap:
3257 case Intrinsic::nvvm_suld_1d_array_v2i8_trap:
3259 case Intrinsic::nvvm_suld_1d_array_v2i16_trap:
3261 case Intrinsic::nvvm_suld_1d_array_v2i32_trap:
3263 case Intrinsic::nvvm_suld_1d_array_v2i64_trap:
3265 case Intrinsic::nvvm_suld_1d_array_v4i8_trap:
3267 case Intrinsic::nvvm_suld_1d_array_v4i16_trap:
3269 case Intrinsic::nvvm_suld_1d_array_v4i32_trap:
3271 case Intrinsic::nvvm_suld_2d_i8_trap:
3273 case Intrinsic::nvvm_suld_2d_i16_trap:
3275 case Intrinsic::nvvm_suld_2d_i32_trap:
3277 case Intrinsic::nvvm_suld_2d_i64_trap:
3279 case Intrinsic::nvvm_suld_2d_v2i8_trap:
3281 case Intrinsic::nvvm_suld_2d_v2i16_trap:
3283 case Intrinsic::nvvm_suld_2d_v2i32_trap:
3285 case Intrinsic::nvvm_suld_2d_v2i64_trap:
3287 case Intrinsic::nvvm_suld_2d_v4i8_trap:
3289 case Intrinsic::nvvm_suld_2d_v4i16_trap:
3291 case Intrinsic::nvvm_suld_2d_v4i32_trap:
3293 case Intrinsic::nvvm_suld_2d_array_i8_trap:
3295 case Intrinsic::nvvm_suld_2d_array_i16_trap:
3297 case Intrinsic::nvvm_suld_2d_array_i32_trap:
3299 case Intrinsic::nvvm_suld_2d_array_i64_trap:
3301 case Intrinsic::nvvm_suld_2d_array_v2i8_trap:
3303 case Intrinsic::nvvm_suld_2d_array_v2i16_trap:
3305 case Intrinsic::nvvm_suld_2d_array_v2i32_trap:
3307 case Intrinsic::nvvm_suld_2d_array_v2i64_trap:
3309 case Intrinsic::nvvm_suld_2d_array_v4i8_trap:
3311 case Intrinsic::nvvm_suld_2d_array_v4i16_trap:
3313 case Intrinsic::nvvm_suld_2d_array_v4i32_trap:
3315 case Intrinsic::nvvm_suld_3d_i8_trap:
3317 case Intrinsic::nvvm_suld_3d_i16_trap:
3319 case Intrinsic::nvvm_suld_3d_i32_trap:
3321 case Intrinsic::nvvm_suld_3d_i64_trap:
3323 case Intrinsic::nvvm_suld_3d_v2i8_trap:
3325 case Intrinsic::nvvm_suld_3d_v2i16_trap:
3327 case Intrinsic::nvvm_suld_3d_v2i32_trap:
3329 case Intrinsic::nvvm_suld_3d_v2i64_trap:
3331 case Intrinsic::nvvm_suld_3d_v4i8_trap:
3333 case Intrinsic::nvvm_suld_3d_v4i16_trap:
3335 case Intrinsic::nvvm_suld_3d_v4i32_trap:
3337 case Intrinsic::nvvm_suld_1d_i8_zero:
3339 case Intrinsic::nvvm_suld_1d_i16_zero:
3341 case Intrinsic::nvvm_suld_1d_i32_zero:
3343 case Intrinsic::nvvm_suld_1d_i64_zero:
3345 case Intrinsic::nvvm_suld_1d_v2i8_zero:
3347 case Intrinsic::nvvm_suld_1d_v2i16_zero:
3349 case Intrinsic::nvvm_suld_1d_v2i32_zero:
3351 case Intrinsic::nvvm_suld_1d_v2i64_zero:
3353 case Intrinsic::nvvm_suld_1d_v4i8_zero:
3355 case Intrinsic::nvvm_suld_1d_v4i16_zero:
3357 case Intrinsic::nvvm_suld_1d_v4i32_zero:
3359 case Intrinsic::nvvm_suld_1d_array_i8_zero:
3361 case Intrinsic::nvvm_suld_1d_array_i16_zero:
3363 case Intrinsic::nvvm_suld_1d_array_i32_zero:
3365 case Intrinsic::nvvm_suld_1d_array_i64_zero:
3367 case Intrinsic::nvvm_suld_1d_array_v2i8_zero:
3369 case Intrinsic::nvvm_suld_1d_array_v2i16_zero:
3371 case Intrinsic::nvvm_suld_1d_array_v2i32_zero:
3373 case Intrinsic::nvvm_suld_1d_array_v2i64_zero:
3375 case Intrinsic::nvvm_suld_1d_array_v4i8_zero:
3377 case Intrinsic::nvvm_suld_1d_array_v4i16_zero:
3379 case Intrinsic::nvvm_suld_1d_array_v4i32_zero:
3381 case Intrinsic::nvvm_suld_2d_i8_zero:
3383 case Intrinsic::nvvm_suld_2d_i16_zero:
3385 case Intrinsic::nvvm_suld_2d_i32_zero:
3387 case Intrinsic::nvvm_suld_2d_i64_zero:
3389 case Intrinsic::nvvm_suld_2d_v2i8_zero:
3391 case Intrinsic::nvvm_suld_2d_v2i16_zero:
3393 case Intrinsic::nvvm_suld_2d_v2i32_zero:
3395 case Intrinsic::nvvm_suld_2d_v2i64_zero:
3397 case Intrinsic::nvvm_suld_2d_v4i8_zero:
3399 case Intrinsic::nvvm_suld_2d_v4i16_zero:
3401 case Intrinsic::nvvm_suld_2d_v4i32_zero:
3403 case Intrinsic::nvvm_suld_2d_array_i8_zero:
3405 case Intrinsic::nvvm_suld_2d_array_i16_zero:
3407 case Intrinsic::nvvm_suld_2d_array_i32_zero:
3409 case Intrinsic::nvvm_suld_2d_array_i64_zero:
3411 case Intrinsic::nvvm_suld_2d_array_v2i8_zero:
3413 case Intrinsic::nvvm_suld_2d_array_v2i16_zero:
3415 case Intrinsic::nvvm_suld_2d_array_v2i32_zero:
3417 case Intrinsic::nvvm_suld_2d_array_v2i64_zero:
3419 case Intrinsic::nvvm_suld_2d_array_v4i8_zero:
3421 case Intrinsic::nvvm_suld_2d_array_v4i16_zero:
3423 case Intrinsic::nvvm_suld_2d_array_v4i32_zero:
3425 case Intrinsic::nvvm_suld_3d_i8_zero:
3427 case Intrinsic::nvvm_suld_3d_i16_zero:
3429 case Intrinsic::nvvm_suld_3d_i32_zero:
3431 case Intrinsic::nvvm_suld_3d_i64_zero:
3433 case Intrinsic::nvvm_suld_3d_v2i8_zero:
3435 case Intrinsic::nvvm_suld_3d_v2i16_zero:
3437 case Intrinsic::nvvm_suld_3d_v2i32_zero:
3439 case Intrinsic::nvvm_suld_3d_v2i64_zero:
3441 case Intrinsic::nvvm_suld_3d_v4i8_zero:
3443 case Intrinsic::nvvm_suld_3d_v4i16_zero:
3445 case Intrinsic::nvvm_suld_3d_v4i32_zero:
3458 switch (Intrinsic) {
3461 case Intrinsic::nvvm_match_all_sync_i32p:
3462 case Intrinsic::nvvm_match_all_sync_i64p:
3472 case Intrinsic::nvvm_wmma_m16n16k16_load_a_f16_col:
3473 case Intrinsic::nvvm_wmma_m16n16k16_load_a_f16_row:
3474 case Intrinsic::nvvm_wmma_m16n16k16_load_a_f16_col_stride:
3475 case Intrinsic::nvvm_wmma_m16n16k16_load_a_f16_row_stride:
3476 case Intrinsic::nvvm_wmma_m16n16k16_load_b_f16_col:
3477 case Intrinsic::nvvm_wmma_m16n16k16_load_b_f16_row:
3478 case Intrinsic::nvvm_wmma_m16n16k16_load_b_f16_col_stride:
3479 case Intrinsic::nvvm_wmma_m16n16k16_load_b_f16_row_stride:
3480 case Intrinsic::nvvm_wmma_m32n8k16_load_a_f16_col:
3481 case Intrinsic::nvvm_wmma_m32n8k16_load_a_f16_row:
3482 case Intrinsic::nvvm_wmma_m32n8k16_load_a_f16_col_stride:
3483 case Intrinsic::nvvm_wmma_m32n8k16_load_a_f16_row_stride:
3484 case Intrinsic::nvvm_wmma_m32n8k16_load_b_f16_col:
3485 case Intrinsic::nvvm_wmma_m32n8k16_load_b_f16_row:
3486 case Intrinsic::nvvm_wmma_m32n8k16_load_b_f16_col_stride:
3487 case Intrinsic::nvvm_wmma_m32n8k16_load_b_f16_row_stride:
3488 case Intrinsic::nvvm_wmma_m8n32k16_load_a_f16_col:
3489 case Intrinsic::nvvm_wmma_m8n32k16_load_a_f16_row:
3490 case Intrinsic::nvvm_wmma_m8n32k16_load_a_f16_col_stride:
3491 case Intrinsic::nvvm_wmma_m8n32k16_load_a_f16_row_stride:
3492 case Intrinsic::nvvm_wmma_m8n32k16_load_b_f16_col:
3493 case Intrinsic::nvvm_wmma_m8n32k16_load_b_f16_row:
3494 case Intrinsic::nvvm_wmma_m8n32k16_load_b_f16_col_stride:
3495 case Intrinsic::nvvm_wmma_m8n32k16_load_b_f16_row_stride: {
3504 case Intrinsic::nvvm_wmma_m16n16k16_load_a_s8_col:
3505 case Intrinsic::nvvm_wmma_m16n16k16_load_a_s8_col_stride:
3506 case Intrinsic::nvvm_wmma_m16n16k16_load_a_u8_col_stride:
3507 case Intrinsic::nvvm_wmma_m16n16k16_load_a_u8_col:
3508 case Intrinsic::nvvm_wmma_m16n16k16_load_a_s8_row:
3509 case Intrinsic::nvvm_wmma_m16n16k16_load_a_s8_row_stride:
3510 case Intrinsic::nvvm_wmma_m16n16k16_load_a_u8_row_stride:
3511 case Intrinsic::nvvm_wmma_m16n16k16_load_a_u8_row:
3512 case Intrinsic::nvvm_wmma_m16n16k16_load_b_s8_col:
3513 case Intrinsic::nvvm_wmma_m16n16k16_load_b_s8_col_stride:
3514 case Intrinsic::nvvm_wmma_m16n16k16_load_b_u8_col_stride:
3515 case Intrinsic::nvvm_wmma_m16n16k16_load_b_u8_col:
3516 case Intrinsic::nvvm_wmma_m16n16k16_load_b_s8_row:
3517 case Intrinsic::nvvm_wmma_m16n16k16_load_b_s8_row_stride:
3518 case Intrinsic::nvvm_wmma_m16n16k16_load_b_u8_row_stride:
3519 case Intrinsic::nvvm_wmma_m16n16k16_load_b_u8_row: {
3529 case Intrinsic::nvvm_wmma_m32n8k16_load_a_s8_col:
3530 case Intrinsic::nvvm_wmma_m32n8k16_load_a_s8_col_stride:
3531 case Intrinsic::nvvm_wmma_m32n8k16_load_a_u8_col_stride:
3532 case Intrinsic::nvvm_wmma_m32n8k16_load_a_u8_col:
3533 case Intrinsic::nvvm_wmma_m32n8k16_load_a_s8_row:
3534 case Intrinsic::nvvm_wmma_m32n8k16_load_a_s8_row_stride:
3535 case Intrinsic::nvvm_wmma_m32n8k16_load_a_u8_row_stride:
3536 case Intrinsic::nvvm_wmma_m32n8k16_load_a_u8_row:
3538 case Intrinsic::nvvm_wmma_m8n32k16_load_b_s8_col:
3539 case Intrinsic::nvvm_wmma_m8n32k16_load_b_s8_col_stride:
3540 case Intrinsic::nvvm_wmma_m8n32k16_load_b_u8_col_stride:
3541 case Intrinsic::nvvm_wmma_m8n32k16_load_b_u8_col:
3542 case Intrinsic::nvvm_wmma_m8n32k16_load_b_s8_row:
3543 case Intrinsic::nvvm_wmma_m8n32k16_load_b_s8_row_stride:
3544 case Intrinsic::nvvm_wmma_m8n32k16_load_b_u8_row_stride:
3545 case Intrinsic::nvvm_wmma_m8n32k16_load_b_u8_row: {
3555 case Intrinsic::nvvm_wmma_m32n8k16_load_b_s8_col:
3556 case Intrinsic::nvvm_wmma_m32n8k16_load_b_s8_col_stride:
3557 case Intrinsic::nvvm_wmma_m32n8k16_load_b_u8_col_stride:
3558 case Intrinsic::nvvm_wmma_m32n8k16_load_b_u8_col:
3559 case Intrinsic::nvvm_wmma_m32n8k16_load_b_s8_row:
3560 case Intrinsic::nvvm_wmma_m32n8k16_load_b_s8_row_stride:
3561 case Intrinsic::nvvm_wmma_m32n8k16_load_b_u8_row_stride:
3562 case Intrinsic::nvvm_wmma_m32n8k16_load_b_u8_row:
3564 case Intrinsic::nvvm_wmma_m8n32k16_load_a_s8_col:
3565 case Intrinsic::nvvm_wmma_m8n32k16_load_a_s8_col_stride:
3566 case Intrinsic::nvvm_wmma_m8n32k16_load_a_u8_col_stride:
3567 case Intrinsic::nvvm_wmma_m8n32k16_load_a_u8_col:
3568 case Intrinsic::nvvm_wmma_m8n32k16_load_a_s8_row:
3569 case Intrinsic::nvvm_wmma_m8n32k16_load_a_s8_row_stride:
3570 case Intrinsic::nvvm_wmma_m8n32k16_load_a_u8_row_stride:
3571 case Intrinsic::nvvm_wmma_m8n32k16_load_a_u8_row:
3572 case Intrinsic::nvvm_wmma_m8n8k128_load_a_b1_row:
3573 case Intrinsic::nvvm_wmma_m8n8k128_load_a_b1_row_stride:
3574 case Intrinsic::nvvm_wmma_m8n8k128_load_b_b1_col:
3575 case Intrinsic::nvvm_wmma_m8n8k128_load_b_b1_col_stride:
3576 case Intrinsic::nvvm_wmma_m8n8k32_load_a_s4_row:
3577 case Intrinsic::nvvm_wmma_m8n8k32_load_a_s4_row_stride:
3578 case Intrinsic::nvvm_wmma_m8n8k32_load_a_u4_row_stride:
3579 case Intrinsic::nvvm_wmma_m8n8k32_load_a_u4_row:
3580 case Intrinsic::nvvm_wmma_m8n8k32_load_b_s4_col:
3581 case Intrinsic::nvvm_wmma_m8n8k32_load_b_s4_col_stride:
3582 case Intrinsic::nvvm_wmma_m8n8k32_load_b_u4_col_stride:
3583 case Intrinsic::nvvm_wmma_m8n8k32_load_b_u4_col: {
3593 case Intrinsic::nvvm_wmma_m16n16k16_load_c_f16_col:
3594 case Intrinsic::nvvm_wmma_m16n16k16_load_c_f16_row:
3595 case Intrinsic::nvvm_wmma_m16n16k16_load_c_f16_col_stride:
3596 case Intrinsic::nvvm_wmma_m16n16k16_load_c_f16_row_stride:
3597 case Intrinsic::nvvm_wmma_m32n8k16_load_c_f16_col:
3598 case Intrinsic::nvvm_wmma_m32n8k16_load_c_f16_row:
3599 case Intrinsic::nvvm_wmma_m32n8k16_load_c_f16_col_stride:
3600 case Intrinsic::nvvm_wmma_m32n8k16_load_c_f16_row_stride:
3601 case Intrinsic::nvvm_wmma_m8n32k16_load_c_f16_col:
3602 case Intrinsic::nvvm_wmma_m8n32k16_load_c_f16_row:
3603 case Intrinsic::nvvm_wmma_m8n32k16_load_c_f16_col_stride:
3604 case Intrinsic::nvvm_wmma_m8n32k16_load_c_f16_row_stride: {
3614 case Intrinsic::nvvm_wmma_m16n16k16_load_c_f32_col:
3615 case Intrinsic::nvvm_wmma_m16n16k16_load_c_f32_row:
3616 case Intrinsic::nvvm_wmma_m16n16k16_load_c_f32_col_stride:
3617 case Intrinsic::nvvm_wmma_m16n16k16_load_c_f32_row_stride:
3618 case Intrinsic::nvvm_wmma_m32n8k16_load_c_f32_col:
3619 case Intrinsic::nvvm_wmma_m32n8k16_load_c_f32_row:
3620 case Intrinsic::nvvm_wmma_m32n8k16_load_c_f32_col_stride:
3621 case Intrinsic::nvvm_wmma_m32n8k16_load_c_f32_row_stride:
3622 case Intrinsic::nvvm_wmma_m8n32k16_load_c_f32_col:
3623 case Intrinsic::nvvm_wmma_m8n32k16_load_c_f32_row:
3624 case Intrinsic::nvvm_wmma_m8n32k16_load_c_f32_col_stride:
3625 case Intrinsic::nvvm_wmma_m8n32k16_load_c_f32_row_stride: {
3635 case Intrinsic::nvvm_wmma_m16n16k16_load_c_s32_col:
3636 case Intrinsic::nvvm_wmma_m16n16k16_load_c_s32_col_stride:
3637 case Intrinsic::nvvm_wmma_m16n16k16_load_c_s32_row:
3638 case Intrinsic::nvvm_wmma_m16n16k16_load_c_s32_row_stride:
3639 case Intrinsic::nvvm_wmma_m32n8k16_load_c_s32_col:
3640 case Intrinsic::nvvm_wmma_m32n8k16_load_c_s32_col_stride:
3641 case Intrinsic::nvvm_wmma_m32n8k16_load_c_s32_row:
3642 case Intrinsic::nvvm_wmma_m32n8k16_load_c_s32_row_stride:
3643 case Intrinsic::nvvm_wmma_m8n32k16_load_c_s32_col:
3644 case Intrinsic::nvvm_wmma_m8n32k16_load_c_s32_col_stride:
3645 case Intrinsic::nvvm_wmma_m8n32k16_load_c_s32_row:
3646 case Intrinsic::nvvm_wmma_m8n32k16_load_c_s32_row_stride: {
3656 case Intrinsic::nvvm_wmma_m8n8k128_load_c_s32_col:
3657 case Intrinsic::nvvm_wmma_m8n8k128_load_c_s32_col_stride:
3658 case Intrinsic::nvvm_wmma_m8n8k128_load_c_s32_row:
3659 case Intrinsic::nvvm_wmma_m8n8k128_load_c_s32_row_stride:
3660 case Intrinsic::nvvm_wmma_m8n8k32_load_c_s32_col:
3661 case Intrinsic::nvvm_wmma_m8n8k32_load_c_s32_col_stride:
3662 case Intrinsic::nvvm_wmma_m8n8k32_load_c_s32_row:
3663 case Intrinsic::nvvm_wmma_m8n8k32_load_c_s32_row_stride: {
3673 case Intrinsic::nvvm_wmma_m16n16k16_store_d_f16_col:
3674 case Intrinsic::nvvm_wmma_m16n16k16_store_d_f16_row:
3675 case Intrinsic::nvvm_wmma_m16n16k16_store_d_f16_col_stride:
3676 case Intrinsic::nvvm_wmma_m16n16k16_store_d_f16_row_stride:
3677 case Intrinsic::nvvm_wmma_m32n8k16_store_d_f16_col:
3678 case Intrinsic::nvvm_wmma_m32n8k16_store_d_f16_row:
3679 case Intrinsic::nvvm_wmma_m32n8k16_store_d_f16_col_stride:
3680 case Intrinsic::nvvm_wmma_m32n8k16_store_d_f16_row_stride:
3681 case Intrinsic::nvvm_wmma_m8n32k16_store_d_f16_col:
3682 case Intrinsic::nvvm_wmma_m8n32k16_store_d_f16_row:
3683 case Intrinsic::nvvm_wmma_m8n32k16_store_d_f16_col_stride:
3684 case Intrinsic::nvvm_wmma_m8n32k16_store_d_f16_row_stride: {
3694 case Intrinsic::nvvm_wmma_m16n16k16_store_d_f32_col:
3695 case Intrinsic::nvvm_wmma_m16n16k16_store_d_f32_row:
3696 case Intrinsic::nvvm_wmma_m16n16k16_store_d_f32_col_stride:
3697 case Intrinsic::nvvm_wmma_m16n16k16_store_d_f32_row_stride:
3698 case Intrinsic::nvvm_wmma_m32n8k16_store_d_f32_col:
3699 case Intrinsic::nvvm_wmma_m32n8k16_store_d_f32_row:
3700 case Intrinsic::nvvm_wmma_m32n8k16_store_d_f32_col_stride:
3701 case Intrinsic::nvvm_wmma_m32n8k16_store_d_f32_row_stride:
3702 case Intrinsic::nvvm_wmma_m8n32k16_store_d_f32_col:
3703 case Intrinsic::nvvm_wmma_m8n32k16_store_d_f32_row:
3704 case Intrinsic::nvvm_wmma_m8n32k16_store_d_f32_col_stride:
3705 case Intrinsic::nvvm_wmma_m8n32k16_store_d_f32_row_stride: {
3715 case Intrinsic::nvvm_wmma_m16n16k16_store_d_s32_col:
3716 case Intrinsic::nvvm_wmma_m16n16k16_store_d_s32_col_stride:
3717 case Intrinsic::nvvm_wmma_m16n16k16_store_d_s32_row:
3718 case Intrinsic::nvvm_wmma_m16n16k16_store_d_s32_row_stride:
3719 case Intrinsic::nvvm_wmma_m32n8k16_store_d_s32_col:
3720 case Intrinsic::nvvm_wmma_m32n8k16_store_d_s32_col_stride:
3721 case Intrinsic::nvvm_wmma_m32n8k16_store_d_s32_row:
3722 case Intrinsic::nvvm_wmma_m32n8k16_store_d_s32_row_stride:
3723 case Intrinsic::nvvm_wmma_m8n32k16_store_d_s32_col:
3724 case Intrinsic::nvvm_wmma_m8n32k16_store_d_s32_col_stride:
3725 case Intrinsic::nvvm_wmma_m8n32k16_store_d_s32_row:
3726 case Intrinsic::nvvm_wmma_m8n32k16_store_d_s32_row_stride: {
3736 case Intrinsic::nvvm_wmma_m8n8k128_store_d_s32_col:
3737 case Intrinsic::nvvm_wmma_m8n8k128_store_d_s32_col_stride:
3738 case Intrinsic::nvvm_wmma_m8n8k128_store_d_s32_row:
3739 case Intrinsic::nvvm_wmma_m8n8k128_store_d_s32_row_stride:
3740 case Intrinsic::nvvm_wmma_m8n8k32_store_d_s32_col:
3741 case Intrinsic::nvvm_wmma_m8n8k32_store_d_s32_col_stride:
3742 case Intrinsic::nvvm_wmma_m8n8k32_store_d_s32_row:
3743 case Intrinsic::nvvm_wmma_m8n8k32_store_d_s32_row_stride: {
3753 case Intrinsic::nvvm_atomic_load_inc_32:
3754 case Intrinsic::nvvm_atomic_load_dec_32:
3756 case Intrinsic::nvvm_atomic_add_gen_f_cta:
3757 case Intrinsic::nvvm_atomic_add_gen_f_sys:
3758 case Intrinsic::nvvm_atomic_add_gen_i_cta:
3759 case Intrinsic::nvvm_atomic_add_gen_i_sys:
3760 case Intrinsic::nvvm_atomic_and_gen_i_cta:
3761 case Intrinsic::nvvm_atomic_and_gen_i_sys:
3762 case Intrinsic::nvvm_atomic_cas_gen_i_cta:
3763 case Intrinsic::nvvm_atomic_cas_gen_i_sys:
3764 case Intrinsic::nvvm_atomic_dec_gen_i_cta:
3765 case Intrinsic::nvvm_atomic_dec_gen_i_sys:
3766 case Intrinsic::nvvm_atomic_inc_gen_i_cta:
3767 case Intrinsic::nvvm_atomic_inc_gen_i_sys:
3768 case Intrinsic::nvvm_atomic_max_gen_i_cta:
3769 case Intrinsic::nvvm_atomic_max_gen_i_sys:
3770 case Intrinsic::nvvm_atomic_min_gen_i_cta:
3771 case Intrinsic::nvvm_atomic_min_gen_i_sys:
3772 case Intrinsic::nvvm_atomic_or_gen_i_cta:
3773 case Intrinsic::nvvm_atomic_or_gen_i_sys:
3774 case Intrinsic::nvvm_atomic_exch_gen_i_cta:
3775 case Intrinsic::nvvm_atomic_exch_gen_i_sys:
3776 case Intrinsic::nvvm_atomic_xor_gen_i_cta:
3777 case Intrinsic::nvvm_atomic_xor_gen_i_sys: {
3788 case Intrinsic::nvvm_ldu_global_i:
3789 case Intrinsic::nvvm_ldu_global_f:
3790 case Intrinsic::nvvm_ldu_global_p: {
3793 if (Intrinsic == Intrinsic::nvvm_ldu_global_i)
3795 else if(Intrinsic == Intrinsic::nvvm_ldu_global_p)
3807 case Intrinsic::nvvm_ldg_global_i:
3808 case Intrinsic::nvvm_ldg_global_f:
3809 case Intrinsic::nvvm_ldg_global_p: {
3813 if (Intrinsic == Intrinsic::nvvm_ldg_global_i)
3815 else if(Intrinsic == Intrinsic::nvvm_ldg_global_p)
3828 case Intrinsic::nvvm_tex_1d_v4f32_s32:
3829 case Intrinsic::nvvm_tex_1d_v4f32_f32:
3830 case Intrinsic::nvvm_tex_1d_level_v4f32_f32:
3831 case Intrinsic::nvvm_tex_1d_grad_v4f32_f32:
3832 case Intrinsic::nvvm_tex_1d_array_v4f32_s32:
3833 case Intrinsic::nvvm_tex_1d_array_v4f32_f32:
3834 case Intrinsic::nvvm_tex_1d_array_level_v4f32_f32:
3835 case Intrinsic::nvvm_tex_1d_array_grad_v4f32_f32:
3836 case Intrinsic::nvvm_tex_2d_v4f32_s32:
3837 case Intrinsic::nvvm_tex_2d_v4f32_f32:
3838 case Intrinsic::nvvm_tex_2d_level_v4f32_f32:
3839 case Intrinsic::nvvm_tex_2d_grad_v4f32_f32:
3840 case Intrinsic::nvvm_tex_2d_array_v4f32_s32:
3841 case Intrinsic::nvvm_tex_2d_array_v4f32_f32:
3842 case Intrinsic::nvvm_tex_2d_array_level_v4f32_f32:
3843 case Intrinsic::nvvm_tex_2d_array_grad_v4f32_f32:
3844 case Intrinsic::nvvm_tex_3d_v4f32_s32:
3845 case Intrinsic::nvvm_tex_3d_v4f32_f32:
3846 case Intrinsic::nvvm_tex_3d_level_v4f32_f32:
3847 case Intrinsic::nvvm_tex_3d_grad_v4f32_f32:
3848 case Intrinsic::nvvm_tex_cube_v4f32_f32:
3849 case Intrinsic::nvvm_tex_cube_level_v4f32_f32:
3850 case Intrinsic::nvvm_tex_cube_array_v4f32_f32:
3851 case Intrinsic::nvvm_tex_cube_array_level_v4f32_f32:
3852 case Intrinsic::nvvm_tld4_r_2d_v4f32_f32:
3853 case Intrinsic::nvvm_tld4_g_2d_v4f32_f32:
3854 case Intrinsic::nvvm_tld4_b_2d_v4f32_f32:
3855 case Intrinsic::nvvm_tld4_a_2d_v4f32_f32:
3856 case Intrinsic::nvvm_tex_unified_1d_v4f32_s32:
3857 case Intrinsic::nvvm_tex_unified_1d_v4f32_f32:
3858 case Intrinsic::nvvm_tex_unified_1d_level_v4f32_f32:
3859 case Intrinsic::nvvm_tex_unified_1d_grad_v4f32_f32:
3860 case Intrinsic::nvvm_tex_unified_1d_array_v4f32_s32:
3861 case Intrinsic::nvvm_tex_unified_1d_array_v4f32_f32:
3862 case Intrinsic::nvvm_tex_unified_1d_array_level_v4f32_f32:
3863 case Intrinsic::nvvm_tex_unified_1d_array_grad_v4f32_f32:
3864 case Intrinsic::nvvm_tex_unified_2d_v4f32_s32:
3865 case Intrinsic::nvvm_tex_unified_2d_v4f32_f32:
3866 case Intrinsic::nvvm_tex_unified_2d_level_v4f32_f32:
3867 case Intrinsic::nvvm_tex_unified_2d_grad_v4f32_f32:
3868 case Intrinsic::nvvm_tex_unified_2d_array_v4f32_s32:
3869 case Intrinsic::nvvm_tex_unified_2d_array_v4f32_f32:
3870 case Intrinsic::nvvm_tex_unified_2d_array_level_v4f32_f32:
3871 case Intrinsic::nvvm_tex_unified_2d_array_grad_v4f32_f32:
3872 case Intrinsic::nvvm_tex_unified_3d_v4f32_s32:
3873 case Intrinsic::nvvm_tex_unified_3d_v4f32_f32:
3874 case Intrinsic::nvvm_tex_unified_3d_level_v4f32_f32:
3875 case Intrinsic::nvvm_tex_unified_3d_grad_v4f32_f32:
3876 case Intrinsic::nvvm_tex_unified_cube_v4f32_f32:
3877 case Intrinsic::nvvm_tex_unified_cube_level_v4f32_f32:
3878 case Intrinsic::nvvm_tex_unified_cube_array_v4f32_f32:
3879 case Intrinsic::nvvm_tex_unified_cube_array_level_v4f32_f32:
3880 case Intrinsic::nvvm_tld4_unified_r_2d_v4f32_f32:
3881 case Intrinsic::nvvm_tld4_unified_g_2d_v4f32_f32:
3882 case Intrinsic::nvvm_tld4_unified_b_2d_v4f32_f32:
3883 case Intrinsic::nvvm_tld4_unified_a_2d_v4f32_f32:
3892 case Intrinsic::nvvm_tex_1d_v4s32_s32:
3893 case Intrinsic::nvvm_tex_1d_v4s32_f32:
3894 case Intrinsic::nvvm_tex_1d_level_v4s32_f32:
3895 case Intrinsic::nvvm_tex_1d_grad_v4s32_f32:
3896 case Intrinsic::nvvm_tex_1d_array_v4s32_s32:
3897 case Intrinsic::nvvm_tex_1d_array_v4s32_f32:
3898 case Intrinsic::nvvm_tex_1d_array_level_v4s32_f32:
3899 case Intrinsic::nvvm_tex_1d_array_grad_v4s32_f32:
3900 case Intrinsic::nvvm_tex_2d_v4s32_s32:
3901 case Intrinsic::nvvm_tex_2d_v4s32_f32:
3902 case Intrinsic::nvvm_tex_2d_level_v4s32_f32:
3903 case Intrinsic::nvvm_tex_2d_grad_v4s32_f32:
3904 case Intrinsic::nvvm_tex_2d_array_v4s32_s32:
3905 case Intrinsic::nvvm_tex_2d_array_v4s32_f32:
3906 case Intrinsic::nvvm_tex_2d_array_level_v4s32_f32:
3907 case Intrinsic::nvvm_tex_2d_array_grad_v4s32_f32:
3908 case Intrinsic::nvvm_tex_3d_v4s32_s32:
3909 case Intrinsic::nvvm_tex_3d_v4s32_f32:
3910 case Intrinsic::nvvm_tex_3d_level_v4s32_f32:
3911 case Intrinsic::nvvm_tex_3d_grad_v4s32_f32:
3912 case Intrinsic::nvvm_tex_cube_v4s32_f32:
3913 case Intrinsic::nvvm_tex_cube_level_v4s32_f32:
3914 case Intrinsic::nvvm_tex_cube_array_v4s32_f32:
3915 case Intrinsic::nvvm_tex_cube_array_level_v4s32_f32:
3916 case Intrinsic::nvvm_tex_cube_v4u32_f32:
3917 case Intrinsic::nvvm_tex_cube_level_v4u32_f32:
3918 case Intrinsic::nvvm_tex_cube_array_v4u32_f32:
3919 case Intrinsic::nvvm_tex_cube_array_level_v4u32_f32:
3920 case Intrinsic::nvvm_tex_1d_v4u32_s32:
3921 case Intrinsic::nvvm_tex_1d_v4u32_f32:
3922 case Intrinsic::nvvm_tex_1d_level_v4u32_f32:
3923 case Intrinsic::nvvm_tex_1d_grad_v4u32_f32:
3924 case Intrinsic::nvvm_tex_1d_array_v4u32_s32:
3925 case Intrinsic::nvvm_tex_1d_array_v4u32_f32:
3926 case Intrinsic::nvvm_tex_1d_array_level_v4u32_f32:
3927 case Intrinsic::nvvm_tex_1d_array_grad_v4u32_f32:
3928 case Intrinsic::nvvm_tex_2d_v4u32_s32:
3929 case Intrinsic::nvvm_tex_2d_v4u32_f32:
3930 case Intrinsic::nvvm_tex_2d_level_v4u32_f32:
3931 case Intrinsic::nvvm_tex_2d_grad_v4u32_f32:
3932 case Intrinsic::nvvm_tex_2d_array_v4u32_s32:
3933 case Intrinsic::nvvm_tex_2d_array_v4u32_f32:
3934 case Intrinsic::nvvm_tex_2d_array_level_v4u32_f32:
3935 case Intrinsic::nvvm_tex_2d_array_grad_v4u32_f32:
3936 case Intrinsic::nvvm_tex_3d_v4u32_s32:
3937 case Intrinsic::nvvm_tex_3d_v4u32_f32:
3938 case Intrinsic::nvvm_tex_3d_level_v4u32_f32:
3939 case Intrinsic::nvvm_tex_3d_grad_v4u32_f32:
3940 case Intrinsic::nvvm_tld4_r_2d_v4s32_f32:
3941 case Intrinsic::nvvm_tld4_g_2d_v4s32_f32:
3942 case Intrinsic::nvvm_tld4_b_2d_v4s32_f32:
3943 case Intrinsic::nvvm_tld4_a_2d_v4s32_f32:
3944 case Intrinsic::nvvm_tld4_r_2d_v4u32_f32:
3945 case Intrinsic::nvvm_tld4_g_2d_v4u32_f32:
3946 case Intrinsic::nvvm_tld4_b_2d_v4u32_f32:
3947 case Intrinsic::nvvm_tld4_a_2d_v4u32_f32:
3948 case Intrinsic::nvvm_tex_unified_1d_v4s32_s32:
3949 case Intrinsic::nvvm_tex_unified_1d_v4s32_f32:
3950 case Intrinsic::nvvm_tex_unified_1d_level_v4s32_f32:
3951 case Intrinsic::nvvm_tex_unified_1d_grad_v4s32_f32:
3952 case Intrinsic::nvvm_tex_unified_1d_array_v4s32_s32:
3953 case Intrinsic::nvvm_tex_unified_1d_array_v4s32_f32:
3954 case Intrinsic::nvvm_tex_unified_1d_array_level_v4s32_f32:
3955 case Intrinsic::nvvm_tex_unified_1d_array_grad_v4s32_f32:
3956 case Intrinsic::nvvm_tex_unified_2d_v4s32_s32:
3957 case Intrinsic::nvvm_tex_unified_2d_v4s32_f32:
3958 case Intrinsic::nvvm_tex_unified_2d_level_v4s32_f32:
3959 case Intrinsic::nvvm_tex_unified_2d_grad_v4s32_f32:
3960 case Intrinsic::nvvm_tex_unified_2d_array_v4s32_s32:
3961 case Intrinsic::nvvm_tex_unified_2d_array_v4s32_f32:
3962 case Intrinsic::nvvm_tex_unified_2d_array_level_v4s32_f32:
3963 case Intrinsic::nvvm_tex_unified_2d_array_grad_v4s32_f32:
3964 case Intrinsic::nvvm_tex_unified_3d_v4s32_s32:
3965 case Intrinsic::nvvm_tex_unified_3d_v4s32_f32:
3966 case Intrinsic::nvvm_tex_unified_3d_level_v4s32_f32:
3967 case Intrinsic::nvvm_tex_unified_3d_grad_v4s32_f32:
3968 case Intrinsic::nvvm_tex_unified_1d_v4u32_s32:
3969 case Intrinsic::nvvm_tex_unified_1d_v4u32_f32:
3970 case Intrinsic::nvvm_tex_unified_1d_level_v4u32_f32:
3971 case Intrinsic::nvvm_tex_unified_1d_grad_v4u32_f32:
3972 case Intrinsic::nvvm_tex_unified_1d_array_v4u32_s32:
3973 case Intrinsic::nvvm_tex_unified_1d_array_v4u32_f32:
3974 case Intrinsic::nvvm_tex_unified_1d_array_level_v4u32_f32:
3975 case Intrinsic::nvvm_tex_unified_1d_array_grad_v4u32_f32:
3976 case Intrinsic::nvvm_tex_unified_2d_v4u32_s32:
3977 case Intrinsic::nvvm_tex_unified_2d_v4u32_f32:
3978 case Intrinsic::nvvm_tex_unified_2d_level_v4u32_f32:
3979 case Intrinsic::nvvm_tex_unified_2d_grad_v4u32_f32:
3980 case Intrinsic::nvvm_tex_unified_2d_array_v4u32_s32:
3981 case Intrinsic::nvvm_tex_unified_2d_array_v4u32_f32:
3982 case Intrinsic::nvvm_tex_unified_2d_array_level_v4u32_f32:
3983 case Intrinsic::nvvm_tex_unified_2d_array_grad_v4u32_f32:
3984 case Intrinsic::nvvm_tex_unified_3d_v4u32_s32:
3985 case Intrinsic::nvvm_tex_unified_3d_v4u32_f32:
3986 case Intrinsic::nvvm_tex_unified_3d_level_v4u32_f32:
3987 case Intrinsic::nvvm_tex_unified_3d_grad_v4u32_f32:
3988 case Intrinsic::nvvm_tex_unified_cube_v4s32_f32:
3989 case Intrinsic::nvvm_tex_unified_cube_level_v4s32_f32:
3990 case Intrinsic::nvvm_tex_unified_cube_array_v4s32_f32:
3991 case Intrinsic::nvvm_tex_unified_cube_array_level_v4s32_f32:
3992 case Intrinsic::nvvm_tex_unified_cube_v4u32_f32:
3993 case Intrinsic::nvvm_tex_unified_cube_level_v4u32_f32:
3994 case Intrinsic::nvvm_tex_unified_cube_array_v4u32_f32:
3995 case Intrinsic::nvvm_tex_unified_cube_array_level_v4u32_f32:
3996 case Intrinsic::nvvm_tld4_unified_r_2d_v4s32_f32:
3997 case Intrinsic::nvvm_tld4_unified_g_2d_v4s32_f32:
3998 case Intrinsic::nvvm_tld4_unified_b_2d_v4s32_f32:
3999 case Intrinsic::nvvm_tld4_unified_a_2d_v4s32_f32:
4000 case Intrinsic::nvvm_tld4_unified_r_2d_v4u32_f32:
4001 case Intrinsic::nvvm_tld4_unified_g_2d_v4u32_f32:
4002 case Intrinsic::nvvm_tld4_unified_b_2d_v4u32_f32:
4003 case Intrinsic::nvvm_tld4_unified_a_2d_v4u32_f32:
4012 case Intrinsic::nvvm_suld_1d_i8_clamp:
4013 case Intrinsic::nvvm_suld_1d_v2i8_clamp:
4014 case Intrinsic::nvvm_suld_1d_v4i8_clamp:
4015 case Intrinsic::nvvm_suld_1d_array_i8_clamp:
4016 case Intrinsic::nvvm_suld_1d_array_v2i8_clamp:
4017 case Intrinsic::nvvm_suld_1d_array_v4i8_clamp:
4018 case Intrinsic::nvvm_suld_2d_i8_clamp:
4019 case Intrinsic::nvvm_suld_2d_v2i8_clamp:
4020 case Intrinsic::nvvm_suld_2d_v4i8_clamp:
4021 case Intrinsic::nvvm_suld_2d_array_i8_clamp:
4022 case Intrinsic::nvvm_suld_2d_array_v2i8_clamp:
4023 case Intrinsic::nvvm_suld_2d_array_v4i8_clamp:
4024 case Intrinsic::nvvm_suld_3d_i8_clamp:
4025 case Intrinsic::nvvm_suld_3d_v2i8_clamp:
4026 case Intrinsic::nvvm_suld_3d_v4i8_clamp:
4027 case Intrinsic::nvvm_suld_1d_i8_trap:
4028 case Intrinsic::nvvm_suld_1d_v2i8_trap:
4029 case Intrinsic::nvvm_suld_1d_v4i8_trap:
4030 case Intrinsic::nvvm_suld_1d_array_i8_trap:
4031 case Intrinsic::nvvm_suld_1d_array_v2i8_trap:
4032 case Intrinsic::nvvm_suld_1d_array_v4i8_trap:
4033 case Intrinsic::nvvm_suld_2d_i8_trap:
4034 case Intrinsic::nvvm_suld_2d_v2i8_trap:
4035 case Intrinsic::nvvm_suld_2d_v4i8_trap:
4036 case Intrinsic::nvvm_suld_2d_array_i8_trap:
4037 case Intrinsic::nvvm_suld_2d_array_v2i8_trap:
4038 case Intrinsic::nvvm_suld_2d_array_v4i8_trap:
4039 case Intrinsic::nvvm_suld_3d_i8_trap:
4040 case Intrinsic::nvvm_suld_3d_v2i8_trap:
4041 case Intrinsic::nvvm_suld_3d_v4i8_trap:
4042 case Intrinsic::nvvm_suld_1d_i8_zero:
4043 case Intrinsic::nvvm_suld_1d_v2i8_zero:
4044 case Intrinsic::nvvm_suld_1d_v4i8_zero:
4045 case Intrinsic::nvvm_suld_1d_array_i8_zero:
4046 case Intrinsic::nvvm_suld_1d_array_v2i8_zero:
4047 case Intrinsic::nvvm_suld_1d_array_v4i8_zero:
4048 case Intrinsic::nvvm_suld_2d_i8_zero:
4049 case Intrinsic::nvvm_suld_2d_v2i8_zero:
4050 case Intrinsic::nvvm_suld_2d_v4i8_zero:
4051 case Intrinsic::nvvm_suld_2d_array_i8_zero:
4052 case Intrinsic::nvvm_suld_2d_array_v2i8_zero:
4053 case Intrinsic::nvvm_suld_2d_array_v4i8_zero:
4054 case Intrinsic::nvvm_suld_3d_i8_zero:
4055 case Intrinsic::nvvm_suld_3d_v2i8_zero:
4056 case Intrinsic::nvvm_suld_3d_v4i8_zero:
4065 case Intrinsic::nvvm_suld_1d_i16_clamp:
4066 case Intrinsic::nvvm_suld_1d_v2i16_clamp:
4067 case Intrinsic::nvvm_suld_1d_v4i16_clamp:
4068 case Intrinsic::nvvm_suld_1d_array_i16_clamp:
4069 case Intrinsic::nvvm_suld_1d_array_v2i16_clamp:
4070 case Intrinsic::nvvm_suld_1d_array_v4i16_clamp:
4071 case Intrinsic::nvvm_suld_2d_i16_clamp:
4072 case Intrinsic::nvvm_suld_2d_v2i16_clamp:
4073 case Intrinsic::nvvm_suld_2d_v4i16_clamp:
4074 case Intrinsic::nvvm_suld_2d_array_i16_clamp:
4075 case Intrinsic::nvvm_suld_2d_array_v2i16_clamp:
4076 case Intrinsic::nvvm_suld_2d_array_v4i16_clamp:
4077 case Intrinsic::nvvm_suld_3d_i16_clamp:
4078 case Intrinsic::nvvm_suld_3d_v2i16_clamp:
4079 case Intrinsic::nvvm_suld_3d_v4i16_clamp:
4080 case Intrinsic::nvvm_suld_1d_i16_trap:
4081 case Intrinsic::nvvm_suld_1d_v2i16_trap:
4082 case Intrinsic::nvvm_suld_1d_v4i16_trap:
4083 case Intrinsic::nvvm_suld_1d_array_i16_trap:
4084 case Intrinsic::nvvm_suld_1d_array_v2i16_trap:
4085 case Intrinsic::nvvm_suld_1d_array_v4i16_trap:
4086 case Intrinsic::nvvm_suld_2d_i16_trap:
4087 case Intrinsic::nvvm_suld_2d_v2i16_trap:
4088 case Intrinsic::nvvm_suld_2d_v4i16_trap:
4089 case Intrinsic::nvvm_suld_2d_array_i16_trap:
4090 case Intrinsic::nvvm_suld_2d_array_v2i16_trap:
4091 case Intrinsic::nvvm_suld_2d_array_v4i16_trap:
4092 case Intrinsic::nvvm_suld_3d_i16_trap:
4093 case Intrinsic::nvvm_suld_3d_v2i16_trap:
4094 case Intrinsic::nvvm_suld_3d_v4i16_trap:
4095 case Intrinsic::nvvm_suld_1d_i16_zero:
4096 case Intrinsic::nvvm_suld_1d_v2i16_zero:
4097 case Intrinsic::nvvm_suld_1d_v4i16_zero:
4098 case Intrinsic::nvvm_suld_1d_array_i16_zero:
4099 case Intrinsic::nvvm_suld_1d_array_v2i16_zero:
4100 case Intrinsic::nvvm_suld_1d_array_v4i16_zero:
4101 case Intrinsic::nvvm_suld_2d_i16_zero:
4102 case Intrinsic::nvvm_suld_2d_v2i16_zero:
4103 case Intrinsic::nvvm_suld_2d_v4i16_zero:
4104 case Intrinsic::nvvm_suld_2d_array_i16_zero:
4105 case Intrinsic::nvvm_suld_2d_array_v2i16_zero:
4106 case Intrinsic::nvvm_suld_2d_array_v4i16_zero:
4107 case Intrinsic::nvvm_suld_3d_i16_zero:
4108 case Intrinsic::nvvm_suld_3d_v2i16_zero:
4109 case Intrinsic::nvvm_suld_3d_v4i16_zero:
4118 case Intrinsic::nvvm_suld_1d_i32_clamp:
4119 case Intrinsic::nvvm_suld_1d_v2i32_clamp:
4120 case Intrinsic::nvvm_suld_1d_v4i32_clamp:
4121 case Intrinsic::nvvm_suld_1d_array_i32_clamp:
4122 case Intrinsic::nvvm_suld_1d_array_v2i32_clamp:
4123 case Intrinsic::nvvm_suld_1d_array_v4i32_clamp:
4124 case Intrinsic::nvvm_suld_2d_i32_clamp:
4125 case Intrinsic::nvvm_suld_2d_v2i32_clamp:
4126 case Intrinsic::nvvm_suld_2d_v4i32_clamp:
4127 case Intrinsic::nvvm_suld_2d_array_i32_clamp:
4128 case Intrinsic::nvvm_suld_2d_array_v2i32_clamp:
4129 case Intrinsic::nvvm_suld_2d_array_v4i32_clamp:
4130 case Intrinsic::nvvm_suld_3d_i32_clamp:
4131 case Intrinsic::nvvm_suld_3d_v2i32_clamp:
4132 case Intrinsic::nvvm_suld_3d_v4i32_clamp:
4133 case Intrinsic::nvvm_suld_1d_i32_trap:
4134 case Intrinsic::nvvm_suld_1d_v2i32_trap:
4135 case Intrinsic::nvvm_suld_1d_v4i32_trap:
4136 case Intrinsic::nvvm_suld_1d_array_i32_trap:
4137 case Intrinsic::nvvm_suld_1d_array_v2i32_trap:
4138 case Intrinsic::nvvm_suld_1d_array_v4i32_trap:
4139 case Intrinsic::nvvm_suld_2d_i32_trap:
4140 case Intrinsic::nvvm_suld_2d_v2i32_trap:
4141 case Intrinsic::nvvm_suld_2d_v4i32_trap:
4142 case Intrinsic::nvvm_suld_2d_array_i32_trap:
4143 case Intrinsic::nvvm_suld_2d_array_v2i32_trap:
4144 case Intrinsic::nvvm_suld_2d_array_v4i32_trap:
4145 case Intrinsic::nvvm_suld_3d_i32_trap:
4146 case Intrinsic::nvvm_suld_3d_v2i32_trap:
4147 case Intrinsic::nvvm_suld_3d_v4i32_trap:
4148 case Intrinsic::nvvm_suld_1d_i32_zero:
4149 case Intrinsic::nvvm_suld_1d_v2i32_zero:
4150 case Intrinsic::nvvm_suld_1d_v4i32_zero:
4151 case Intrinsic::nvvm_suld_1d_array_i32_zero:
4152 case Intrinsic::nvvm_suld_1d_array_v2i32_zero:
4153 case Intrinsic::nvvm_suld_1d_array_v4i32_zero:
4154 case Intrinsic::nvvm_suld_2d_i32_zero:
4155 case Intrinsic::nvvm_suld_2d_v2i32_zero:
4156 case Intrinsic::nvvm_suld_2d_v4i32_zero:
4157 case Intrinsic::nvvm_suld_2d_array_i32_zero:
4158 case Intrinsic::nvvm_suld_2d_array_v2i32_zero:
4159 case Intrinsic::nvvm_suld_2d_array_v4i32_zero:
4160 case Intrinsic::nvvm_suld_3d_i32_zero:
4161 case Intrinsic::nvvm_suld_3d_v2i32_zero:
4162 case Intrinsic::nvvm_suld_3d_v4i32_zero:
4171 case Intrinsic::nvvm_suld_1d_i64_clamp:
4172 case Intrinsic::nvvm_suld_1d_v2i64_clamp:
4173 case Intrinsic::nvvm_suld_1d_array_i64_clamp:
4174 case Intrinsic::nvvm_suld_1d_array_v2i64_clamp:
4175 case Intrinsic::nvvm_suld_2d_i64_clamp:
4176 case Intrinsic::nvvm_suld_2d_v2i64_clamp:
4177 case Intrinsic::nvvm_suld_2d_array_i64_clamp:
4178 case Intrinsic::nvvm_suld_2d_array_v2i64_clamp:
4179 case Intrinsic::nvvm_suld_3d_i64_clamp:
4180 case Intrinsic::nvvm_suld_3d_v2i64_clamp:
4181 case Intrinsic::nvvm_suld_1d_i64_trap:
4182 case Intrinsic::nvvm_suld_1d_v2i64_trap:
4183 case Intrinsic::nvvm_suld_1d_array_i64_trap:
4184 case Intrinsic::nvvm_suld_1d_array_v2i64_trap:
4185 case Intrinsic::nvvm_suld_2d_i64_trap:
4186 case Intrinsic::nvvm_suld_2d_v2i64_trap:
4187 case Intrinsic::nvvm_suld_2d_array_i64_trap:
4188 case Intrinsic::nvvm_suld_2d_array_v2i64_trap:
4189 case Intrinsic::nvvm_suld_3d_i64_trap:
4190 case Intrinsic::nvvm_suld_3d_v2i64_trap:
4191 case Intrinsic::nvvm_suld_1d_i64_zero:
4192 case Intrinsic::nvvm_suld_1d_v2i64_zero:
4193 case Intrinsic::nvvm_suld_1d_array_i64_zero:
4194 case Intrinsic::nvvm_suld_1d_array_v2i64_zero:
4195 case Intrinsic::nvvm_suld_2d_i64_zero:
4196 case Intrinsic::nvvm_suld_2d_v2i64_zero:
4197 case Intrinsic::nvvm_suld_2d_array_i64_zero:
4198 case Intrinsic::nvvm_suld_2d_array_v2i64_zero:
4199 case Intrinsic::nvvm_suld_3d_i64_zero:
4200 case Intrinsic::nvvm_suld_3d_v2i64_zero:
4256 if (Constraint.
size() == 1) {
4257 switch (Constraint[0]) {
4275 std::pair<unsigned, const TargetRegisterClass *>
4279 if (Constraint.
size() == 1) {
4280 switch (Constraint[0]) {
4282 return std::make_pair(0U, &NVPTX::Int1RegsRegClass);
4284 return std::make_pair(0U, &NVPTX::Int16RegsRegClass);
4286 return std::make_pair(0U, &NVPTX::Int16RegsRegClass);
4288 return std::make_pair(0U, &NVPTX::Int32RegsRegClass);
4291 return std::make_pair(0U, &NVPTX::Int64RegsRegClass);
4293 return std::make_pair(0U, &NVPTX::Float32RegsRegClass);
4295 return std::make_pair(0U, &NVPTX::Float64RegsRegClass);
4385 int nonAddCount = 0;
4403 if (orderNo - orderNo2 < 500)
4408 bool opIsLive =
false;
4412 if (isa<ConstantSDNode>(left) || isa<ConstantSDNode>(right))
4419 if (orderNo3 > orderNo) {
4429 if (orderNo3 > orderNo) {
4475 if (isa<ConstantSDNode>(Val)) {
4499 if (MaskVal != 0xff) {
4526 if (AExt.
getNode() !=
nullptr) {
4559 if (U->getOpcode() == DivOpc && U->getOperand(0) == Num &&
4564 DAG.
getNode(DivOpc, DL, VT, Num, Den),
4620 IsSigned = (LHSSign ==
Signed);
4624 const APInt &Val = CI->getAPIntValue();
4626 return Val.
isIntN(OptSize);
4635 return LHSSign == RHSSign;
4657 if (isa<ConstantSDNode>(LHS)) {
4671 if (ShiftAmt.
sge(0) && ShiftAmt.
slt(BitWidth)) {
4672 APInt MulVal =
APInt(BitWidth, 1) << ShiftAmt;
4706 return DCI.
DAG.
getNode(Opc, DL, MulType, TruncLHS, TruncRHS);
4757 DAGCombinerInfo &DCI)
const {
4815 unsigned PrefAlign =
4817 if (Align < PrefAlign) {
4832 bool NeedTrunc =
false;
4838 unsigned Opcode = 0;
4840 bool LoadF16x2 =
false;
4884 for (
unsigned i = 0; i < NumElts; ++i) {
4894 for (
unsigned i = 0; i < NumElts; ++i) {
4917 unsigned IntrinNo = cast<ConstantSDNode>(Intrin.
getNode())->getZExtValue();
4921 case Intrinsic::nvvm_ldg_global_i:
4922 case Intrinsic::nvvm_ldg_global_f:
4923 case Intrinsic::nvvm_ldg_global_p:
4924 case Intrinsic::nvvm_ldu_global_i:
4925 case Intrinsic::nvvm_ldu_global_f:
4926 case Intrinsic::nvvm_ldu_global_p: {
4939 bool NeedTrunc =
false;
4945 unsigned Opcode = 0;
4955 case Intrinsic::nvvm_ldg_global_i:
4956 case Intrinsic::nvvm_ldg_global_f:
4957 case Intrinsic::nvvm_ldg_global_p:
4960 case Intrinsic::nvvm_ldu_global_i:
4961 case Intrinsic::nvvm_ldu_global_f:
4962 case Intrinsic::nvvm_ldu_global_p:
4972 case Intrinsic::nvvm_ldg_global_i:
4973 case Intrinsic::nvvm_ldg_global_f:
4974 case Intrinsic::nvvm_ldg_global_p:
4977 case Intrinsic::nvvm_ldu_global_i:
4978 case Intrinsic::nvvm_ldu_global_f:
4979 case Intrinsic::nvvm_ldu_global_p:
5006 for (
unsigned i = 0; i < NumElts; ++i) {
5024 "Custom handling of non-i8 ldu/ldg?");
5041 NewLD.getValue(0)));
5048 void NVPTXTargetLowering::ReplaceNodeResults(
5067 return getDataSection();
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...
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.
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
FMINNUM/FMAXNUM - Perform floating-point minimum or maximum on two values.
EVT getValueType() const
Return the ValueType of the referenced return value.
bool getTgtMemIntrinsic(IntrinsicInfo &Info, const CallInst &I, MachineFunction &MF, unsigned Intrinsic) const override
Given an intrinsic, checks if on the target the intrinsic will need to map to a MemIntrinsicNode (tou...
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...
This SDNode is used for target intrinsics that touch memory and need an associated MachineMemOperand...
const GlobalValue * getGlobal() const
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
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 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)
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.
This class represents lattice values for constants.
FMINIMUM/FMAXIMUM - NaN-propagating minimum/maximum that also treat -0.0 as less than 0...
VECTOR_SHUFFLE(VEC1, VEC2) - Returns a vector, of the same type as VEC1/VEC2.
A Module instance is used to store all the information related to an LLVM module. ...
bool isSized(SmallPtrSetImpl< Type *> *Visited=nullptr) const
Return true if it makes sense to take the size of this type.
EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Ctx, EVT VT) const override
Return the ValueType of the result of SETCC operations.
unsigned getIROrder() const
Return the node ordering.
const SDValue & getBasePtr() const
const StructLayout * getStructLayout(StructType *Ty) const
Returns a StructLayout object, indicating the alignment of the struct, its size, and the offsets of i...
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
void push_back(const T &Elt)
virtual void LowerAsmOperandForConstraint(SDValue Op, std::string &Constraint, std::vector< SDValue > &Ops, SelectionDAG &DAG) const
Lower the specified operand into the Ops vector.
APInt zext(unsigned width) const
Zero extend to a new width.
MachineMemOperand::Flags flags
bool slt(const APInt &RHS) const
Signed less than comparison.
const SDValue & getValue() const
This class represents a function call, abstracting a target machine's calling convention.
SDValue getTargetExternalSymbol(const char *Sym, EVT VT, unsigned TargetFlags=0)
std::string getPrototype(const DataLayout &DL, Type *, const ArgListTy &, const SmallVectorImpl< ISD::OutputArg > &, unsigned retAlignment, ImmutableCallSite CS) const
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
static PointerType * get(Type *ElementType, unsigned AddressSpace)
This constructs a pointer to an object of the specified type in a numbered address space...
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...
unsigned getVectorNumElements() const
const SDValue & getChain() const
static bool isImageOrSamplerVal(const Value *arg, const Module *context)
Function Alias Analysis Results
bool useF32FTZ(const MachineFunction &MF) const
unsigned getAlignment() const
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
virtual std::pair< unsigned, const TargetRegisterClass * > getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI, StringRef Constraint, MVT VT) const
Given a physical register constraint (e.g.
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...
unsigned const TargetRegisterInfo * TRI
ConstraintType getConstraintType(StringRef Constraint) const override
getConstraintType - Given a constraint letter, return the type of constraint it is for this target...
bool isInteger() const
Return true if this is an integer or a vector integer type.
FunTy * getCalledFunction() const
Return the function being called if this is a direct call, otherwise return null (if it's an indirect...
[US]{MIN/MAX} - Binary minimum or maximum or signed or unsigned integers.
SDNode * getNode() const
get the SDNode which holds the desired result
SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
bool isVectorTy() const
True if this is an instance of VectorType.
const SDValue & setRoot(SDValue N)
Set the current root tag of the SelectionDAG.
MachineMemOperand * getMemOperand() const
Return a MachineMemOperand object describing the memory reference performed by operation.
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) ...
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
Value * getArgOperand(unsigned i) const
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
SHL_PARTS/SRA_PARTS/SRL_PARTS - These operators are used for expanded integer shift operations...
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...
bool hasOneUse() const
Return true if there is exactly one use of this node.
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
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))
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.
APInt shl(unsigned shiftAmt) const
Left-shift function.
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...
Type * getTypeForEVT(LLVMContext &Context) const
This method returns an LLVM type corresponding to the specified EVT.
Class to represent struct types.
ABS - Determine the unsigned absolute value of a signed integer value of the same bitwidth...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
bool isIntegerTy() const
True if this is an instance of IntegerType.
op_iterator op_end() const
ISD::LoadExtType getExtensionType() const
Return whether this is a plain node, or one of the varieties of value-extending loads.
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).
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...
TypeSize getValueSizeInBits() const
Returns the size of the value in bits.
const DataLayout & getDataLayout() const
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...
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...
This represents a list of ValueType's that has been intern'd by a SelectionDAG.
SmallVector< ISD::InputArg, 32 > Ins
int getDivF32Level() const
SDValue getMergeValues(ArrayRef< SDValue > Ops, const SDLoc &dl)
Create a MERGE_VALUES node from the given operands.
void assign(size_type NumElts, const T &Elt)
bool usePrecSqrtF32() const
InstrTy * getInstruction() const
A constant value that is initialized with an expression using other constant values.
bool isKernelFunction(const Function &F)
Type * getType() const
All values are typed, get the type of this value.
MachineFunction & getMachineFunction() const
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)...
Simple integer binary arithmetic operators.
ManagedStringPool * getManagedStrPool() const
SmallVector< ISD::OutputArg, 32 > Outs
SDValue getSetCC(const SDLoc &DL, EVT VT, SDValue LHS, SDValue RHS, ISD::CondCode Cond, SDValue Chain=SDValue(), bool IsSignaling=false)
Helper function to make it easier to build SetCC's if you just have an ISD::CondCode instead of an SD...
LLVM_NODISCARD size_t size() const
size - Get the string size.
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...
op_iterator op_begin() 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...
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.
static SDValue PerformANDCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI)
bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM, Type *Ty, unsigned AS, Instruction *I=nullptr) const override
isLegalAddressingMode - Return true if the addressing mode represented by AM is legal for this target...
RESULT = INTRINSIC_WO_CHAIN(INTRINSICID, arg1, arg2, ...) This node represents a target intrinsic fun...
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...
Analysis containing CSE Info
Class to represent pointers.
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
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.
BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a vector with the specified, possibly variable...
AttributeSet getAttributes(unsigned Index) const
The attributes for the specified index are returned.
bool allowFMA(MachineFunction &MF, CodeGenOpt::Level OptLevel) const
const SDValue & getBasePtr() const
initializer< Ty > init(const Ty &Val)
Type * getReturnType() const
Returns the type of the ret 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.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
CodeGenOpt::Level getOptLevel() const
Returns the optimization level: None, Less, Default, or Aggressive.
use_iterator use_begin() const
Provide iteration support to walk over all uses of an SDNode.
constexpr bool isPowerOf2_32(uint32_t Value)
Return true if the argument is a power of two > 0.
TypeSize getPrimitiveSizeInBits() const LLVM_READONLY
Return the basic size of this type if it is a primitive type.
The instances of the Type class are immutable: once they are created, they are never changed...
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))
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))
virtual ConstraintType getConstraintType(StringRef Constraint) const
Given a constraint, return the type of constraint it is for this target.
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 getVectorNumElements() const
Given a vector type, return the number of elements it contains.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
const SDValue & getOperand(unsigned Num) const
INSERT_VECTOR_ELT(VECTOR, VAL, IDX) - Returns VECTOR with the element at IDX replaced with VAL...
This file contains the declarations for the subclasses of Constant, which represent the different fla...
bool isPointerTy() const
True if this is an instance of PointerType.
const NVPTXTargetLowering * getTargetLowering() const override
TypeSize getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
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...
static unsigned getOpcForSurfaceInstr(unsigned Intrinsic)
unsigned getPrefTypeAlignment(Type *Ty) const
Returns the preferred stack/global alignment for the specified type.
This class provides iterator support for SDUse operands that use a specific SDNode.
bool isHalfTy() const
Return true if this is 'half', a 16-bit IEEE fp type.
std::pair< unsigned, const TargetRegisterClass * > getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI, StringRef Constraint, MVT VT) const override
Given a physical register constraint (e.g.
TypeSize getStoreSize() const
Return the number of bytes overwritten by a store of the specified value type.
TRAP - Trapping instruction.
const APInt & getAPIntValue() const
SectionKind - This is a simple POD value that classifies the properties of a section.
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
bool isIntN(unsigned N) const
Check if this APInt has an N-bits unsigned integer value.
unsigned MaxStoresPerMemmove
Specify maximum number 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)
virtual 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...
std::vector< ArgListEntry > ArgListTy
bool allowUnsafeFPMath(MachineFunction &MF) const
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...
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
This structure contains all information that is necessary for lowering calls.
auto find(R &&Range, const T &Val) -> decltype(adl_begin(Range))
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly...
const TargetMachine & getTargetMachine() const
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))
This class contains a discriminated union of information about pointers in memory operands...
bool isMachineOpcode() const
Test if this node has a post-isel opcode, directly corresponding to a MachineInstr opcode...
unsigned getNumOperands() const
Return the number of values used by this operation.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
EVT getValueType(const DataLayout &DL, Type *Ty, bool AllowUnknown=false) const
Return the EVT corresponding to this LLVM type.
static bool IsPTXVectorType(MVT VT)
This struct is a compact representation of a valid (non-zero power of two) alignment.
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...
unsigned getAddressSpace() const
The memory access writes data.
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...
LegalizeAction
This enum indicates whether operations are valid for a target, and if not, what action should be used...
bool allowsMemoryAccessForAlignment(LLVMContext &Context, const DataLayout &DL, EVT VT, unsigned AddrSpace=0, unsigned Alignment=1, MachineMemOperand::Flags Flags=MachineMemOperand::MONone, bool *Fast=nullptr) const
This function returns true if the memory access is aligned or if the target allows this specific unal...
TokenFactor - This node takes multiple tokens as input and produces a single token result...
const TargetLowering & getTargetLoweringInfo() const
bool hasParamAttribute(unsigned ArgNo, Attribute::AttrKind Kind) const
Equivalent to hasAttribute(ArgNo + FirstArgIndex, Kind).
SmallVectorImpl< T >::const_pointer c_str(SmallVectorImpl< T > &str)
SDValue getTargetGlobalAddress(const GlobalValue *GV, const SDLoc &DL, EVT VT, int64_t offset=0, unsigned TargetFlags=0)
auto size(R &&Range, typename std::enable_if< std::is_same< typename std::iterator_traits< decltype(Range.begin())>::iterator_category, std::random_access_iterator_tag >::value, void >::type *=nullptr) -> decltype(std::distance(Range.begin(), Range.end()))
Get the size of a range.
std::string * getManagedString(const char *S)
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...
EVT getVectorElementType() const
Given a vector type, return the type of each element.
This struct is a compact representation of a valid (power of two) or undefined (0) alignment...
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
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.
NVPTXTargetLowering(const NVPTXTargetMachine &TM, const NVPTXSubtarget &STI)
SDValue getBuildVector(EVT VT, const SDLoc &DL, ArrayRef< SDValue > Ops)
Return an ISD::BUILD_VECTOR node.
unsigned getABITypeAlignment(Type *Ty) const
Returns the minimum ABI-required alignment for the specified type.
bool isAggregateType() const
Return true if the type is an aggregate type.
Byte Swap and Counting operators.
TargetLoweringBase::LegalizeTypeAction getPreferredVectorAction(MVT VT) const override
Return the preferred vector type legalization action.
This is an abstract virtual class for memory operations.
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
Represents one node in the SelectionDAG.
const Function & getFunction() const
Return the LLVM function that this machine code represents.
MVT getScalarType() const
If this is a vector, return the element type, otherwise return this.
static mvt_range integer_valuetypes()
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
const Module * getModule() const
Return the module owning the function this instruction belongs to or nullptr it the function does not...
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...
EVT getMemoryVT() const
Return the type of the in-memory value.
Class for arbitrary precision integers.
SDValue getConstantFP(double Val, const SDLoc &DL, EVT VT, bool isTarget=false)
Create a ConstantFPSDNode wrapping a constant 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()
amdgpu Simplify well known AMD library false FunctionCallee Callee
Select(COND, TRUEVAL, FALSEVAL).
bool sge(const APInt &RHS) const
Signed greater or equal comparison.
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))
SDValue expandUnalignedStore(StoreSDNode *ST, SelectionDAG &DAG) const
Expands an unaligned store to 2 half-size stores for integer values, and possibly more for vectors...
FCOPYSIGN(X, Y) - Return the value of X with the sign of Y.
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
The memory access reads data.
BR_JT - Jumptable branch.
SmallVector< SDValue, 32 > OutVals
bool isVector() const
Return true if this is a vector value type.
Bitwise operators - logical and, logical or, logical xor.
SMUL_LOHI/UMUL_LOHI - Multiply two integers of type iN, producing a signed/unsigned value of type i[2...
LLVM_NODISCARD bool empty() const
StringRef getValueAsString() const
Return the attribute's value as a string.
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 ...
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
PointerUnion< const Value *, const PseudoSourceValue * > ptrVal
Establish a view to a call site for examination.
Flags getFlags() const
Return the raw flags of the source value,.
The memory access always returns the same value (or traps).
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const
unsigned getOpcode() const
SDValue getValue(unsigned R) const
unsigned MaxStoresPerMemcpy
Specify maximum number of store instructions per memcpy call.
static SmallVector< ParamVectorizationFlags, 16 > VectorizePTXValueVTs(const SmallVectorImpl< EVT > &ValueVTs, const SmallVectorImpl< uint64_t > &Offsets, unsigned ParamAlignment)
const LLVMTargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
TypeSize getTypeAllocSizeInBits(Type *Ty) const
Returns the offset in bits between successive objects of the specified type, including alignment padd...
bool isSignedIntN(unsigned N) const
Check if this APInt has an N-bits signed integer value.
unsigned getNumRegisters(LLVMContext &Context, EVT VT) const
Return the number of registers that this ValueType will eventually require.
const SDValue & getRoot() const
Return the root tag of the SelectionDAG.
SDValue getConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isTarget=false, bool isOpaque=false)
Create a ConstantSDNode wrapping a constant value.
const MachinePointerInfo & getPointerInfo() const
SDValue getMemIntrinsicNode(unsigned Opcode, const SDLoc &dl, SDVTList VTList, ArrayRef< SDValue > Ops, EVT MemVT, MachinePointerInfo PtrInfo, unsigned Align=0, MachineMemOperand::Flags Flags=MachineMemOperand::MOLoad|MachineMemOperand::MOStore, uint64_t Size=0, const AAMDNodes &AAInfo=AAMDNodes())
Creates a MemIntrinsicNode that may produce a result and takes a list of operands.
CONCAT_VECTORS(VECTOR0, VECTOR1, ...) - Given a number of values of vector type with the same length ...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
SDValue getTruncStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, EVT SVT, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
LegalizeTypeAction
This enum indicates whether a types are legal for a target, and if not, what action should be used to...
A raw_ostream that writes to an std::string.
void setSchedulingPreference(Sched::Preference Pref)
Specify the target scheduling preference.
SDValue getSymbolFunctionGlobalAddress(SDValue Op, Function **TargetFunction=nullptr)
Returs an GlobalAddress of the function from the current module with name matching the given External...
LLVM Value Representation.
FMA - Perform a * b + c with no intermediate rounding step.
bool allowFP16Math() const
unsigned getMachineOpcode() const
This may only be called if isMachineOpcode returns true.
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...
unsigned int getSmVersion() const
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)
Attribute getFnAttribute(Attribute::AttrKind Kind) const
Return the attribute for the given attribute kind.
bool isCast() const
Return true if this is a convert constant expression.
Primary interface to the complete machine description for the target machine.
static mvt_range fixedlen_vector_valuetypes()
void addFnAttr(Attribute::AttrKind Kind)
Add function attributes to this function.
~NVPTXTargetObjectFile() override
StringRef - Represent a constant reference to a string, i.e.
static bool isIndirectCall(const SDValue &Callee, SelectionDAG &DAG, const PPCSubtarget &Subtarget, bool isPatchPoint)
SetCC operator - This evaluates to a true value iff the condition is true.
unsigned MaxStoresPerMemset
Specify maximum number of store instructions per memset call.
unsigned getNumOperands() const
const SDValue & getOperand(unsigned i) const
uint64_t getZExtValue() const
TRUNCATE - Completely drop the high bits.
bool isSimple() const
Test if the given EVT is simple (as opposed to being extended).
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
Perform various unary floating-point operations inspired by libm.
virtual TargetLoweringBase::LegalizeTypeAction getPreferredVectorAction(MVT VT) const
Return the preferred vector type legalization action.
LLVMContext * getContext() const
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
static unsigned getOpcForTextureInstr(unsigned Intrinsic)
This file describes how to lower LLVM code to machine code.
const NVPTXRegisterInfo * getRegisterInfo() const override
This class is used to represent ISD::LOAD nodes.
const NVPTXTargetMachine * nvTM