[llvm] [NVPTX] Pattern match texture/surface intrinsics (NFCI) (PR #119982)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 14 14:24:31 PST 2024


https://github.com/s-barannikov updated https://github.com/llvm/llvm-project/pull/119982

>From ea8577c384b654d576ba612d0128cde1bd567746 Mon Sep 17 00:00:00 2001
From: Sergei Barannikov <barannikov88 at gmail.com>
Date: Sat, 14 Dec 2024 20:37:48 +0300
Subject: [PATCH 1/2] [NVPTX] Let SelectionDAG match intrinsics (NFCI)

---
 llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp | 1392 -------------------
 llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.h   |    2 -
 llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp | 1076 +-------------
 llvm/lib/Target/NVPTX/NVPTXISelLowering.h   |  357 -----
 llvm/lib/Target/NVPTX/NVPTXIntrinsics.td    |  736 ++++++++++
 5 files changed, 742 insertions(+), 2821 deletions(-)

diff --git a/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp b/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp
index e1fb2d7fcee030..989ec8d02d2f1a 100644
--- a/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp
+++ b/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp
@@ -166,351 +166,6 @@ void NVPTXDAGToDAGISel::Select(SDNode *N) {
     if (tryIntrinsicVoid(N))
       return;
     break;
-  case NVPTXISD::Tex1DFloatS32:
-  case NVPTXISD::Tex1DFloatFloat:
-  case NVPTXISD::Tex1DFloatFloatLevel:
-  case NVPTXISD::Tex1DFloatFloatGrad:
-  case NVPTXISD::Tex1DS32S32:
-  case NVPTXISD::Tex1DS32Float:
-  case NVPTXISD::Tex1DS32FloatLevel:
-  case NVPTXISD::Tex1DS32FloatGrad:
-  case NVPTXISD::Tex1DU32S32:
-  case NVPTXISD::Tex1DU32Float:
-  case NVPTXISD::Tex1DU32FloatLevel:
-  case NVPTXISD::Tex1DU32FloatGrad:
-  case NVPTXISD::Tex1DArrayFloatS32:
-  case NVPTXISD::Tex1DArrayFloatFloat:
-  case NVPTXISD::Tex1DArrayFloatFloatLevel:
-  case NVPTXISD::Tex1DArrayFloatFloatGrad:
-  case NVPTXISD::Tex1DArrayS32S32:
-  case NVPTXISD::Tex1DArrayS32Float:
-  case NVPTXISD::Tex1DArrayS32FloatLevel:
-  case NVPTXISD::Tex1DArrayS32FloatGrad:
-  case NVPTXISD::Tex1DArrayU32S32:
-  case NVPTXISD::Tex1DArrayU32Float:
-  case NVPTXISD::Tex1DArrayU32FloatLevel:
-  case NVPTXISD::Tex1DArrayU32FloatGrad:
-  case NVPTXISD::Tex2DFloatS32:
-  case NVPTXISD::Tex2DFloatFloat:
-  case NVPTXISD::Tex2DFloatFloatLevel:
-  case NVPTXISD::Tex2DFloatFloatGrad:
-  case NVPTXISD::Tex2DS32S32:
-  case NVPTXISD::Tex2DS32Float:
-  case NVPTXISD::Tex2DS32FloatLevel:
-  case NVPTXISD::Tex2DS32FloatGrad:
-  case NVPTXISD::Tex2DU32S32:
-  case NVPTXISD::Tex2DU32Float:
-  case NVPTXISD::Tex2DU32FloatLevel:
-  case NVPTXISD::Tex2DU32FloatGrad:
-  case NVPTXISD::Tex2DArrayFloatS32:
-  case NVPTXISD::Tex2DArrayFloatFloat:
-  case NVPTXISD::Tex2DArrayFloatFloatLevel:
-  case NVPTXISD::Tex2DArrayFloatFloatGrad:
-  case NVPTXISD::Tex2DArrayS32S32:
-  case NVPTXISD::Tex2DArrayS32Float:
-  case NVPTXISD::Tex2DArrayS32FloatLevel:
-  case NVPTXISD::Tex2DArrayS32FloatGrad:
-  case NVPTXISD::Tex2DArrayU32S32:
-  case NVPTXISD::Tex2DArrayU32Float:
-  case NVPTXISD::Tex2DArrayU32FloatLevel:
-  case NVPTXISD::Tex2DArrayU32FloatGrad:
-  case NVPTXISD::Tex3DFloatS32:
-  case NVPTXISD::Tex3DFloatFloat:
-  case NVPTXISD::Tex3DFloatFloatLevel:
-  case NVPTXISD::Tex3DFloatFloatGrad:
-  case NVPTXISD::Tex3DS32S32:
-  case NVPTXISD::Tex3DS32Float:
-  case NVPTXISD::Tex3DS32FloatLevel:
-  case NVPTXISD::Tex3DS32FloatGrad:
-  case NVPTXISD::Tex3DU32S32:
-  case NVPTXISD::Tex3DU32Float:
-  case NVPTXISD::Tex3DU32FloatLevel:
-  case NVPTXISD::Tex3DU32FloatGrad:
-  case NVPTXISD::TexCubeFloatFloat:
-  case NVPTXISD::TexCubeFloatFloatLevel:
-  case NVPTXISD::TexCubeS32Float:
-  case NVPTXISD::TexCubeS32FloatLevel:
-  case NVPTXISD::TexCubeU32Float:
-  case NVPTXISD::TexCubeU32FloatLevel:
-  case NVPTXISD::TexCubeArrayFloatFloat:
-  case NVPTXISD::TexCubeArrayFloatFloatLevel:
-  case NVPTXISD::TexCubeArrayS32Float:
-  case NVPTXISD::TexCubeArrayS32FloatLevel:
-  case NVPTXISD::TexCubeArrayU32Float:
-  case NVPTXISD::TexCubeArrayU32FloatLevel:
-  case NVPTXISD::Tld4R2DFloatFloat:
-  case NVPTXISD::Tld4G2DFloatFloat:
-  case NVPTXISD::Tld4B2DFloatFloat:
-  case NVPTXISD::Tld4A2DFloatFloat:
-  case NVPTXISD::Tld4R2DS64Float:
-  case NVPTXISD::Tld4G2DS64Float:
-  case NVPTXISD::Tld4B2DS64Float:
-  case NVPTXISD::Tld4A2DS64Float:
-  case NVPTXISD::Tld4R2DU64Float:
-  case NVPTXISD::Tld4G2DU64Float:
-  case NVPTXISD::Tld4B2DU64Float:
-  case NVPTXISD::Tld4A2DU64Float:
-  case NVPTXISD::TexUnified1DFloatS32:
-  case NVPTXISD::TexUnified1DFloatFloat:
-  case NVPTXISD::TexUnified1DFloatFloatLevel:
-  case NVPTXISD::TexUnified1DFloatFloatGrad:
-  case NVPTXISD::TexUnified1DS32S32:
-  case NVPTXISD::TexUnified1DS32Float:
-  case NVPTXISD::TexUnified1DS32FloatLevel:
-  case NVPTXISD::TexUnified1DS32FloatGrad:
-  case NVPTXISD::TexUnified1DU32S32:
-  case NVPTXISD::TexUnified1DU32Float:
-  case NVPTXISD::TexUnified1DU32FloatLevel:
-  case NVPTXISD::TexUnified1DU32FloatGrad:
-  case NVPTXISD::TexUnified1DArrayFloatS32:
-  case NVPTXISD::TexUnified1DArrayFloatFloat:
-  case NVPTXISD::TexUnified1DArrayFloatFloatLevel:
-  case NVPTXISD::TexUnified1DArrayFloatFloatGrad:
-  case NVPTXISD::TexUnified1DArrayS32S32:
-  case NVPTXISD::TexUnified1DArrayS32Float:
-  case NVPTXISD::TexUnified1DArrayS32FloatLevel:
-  case NVPTXISD::TexUnified1DArrayS32FloatGrad:
-  case NVPTXISD::TexUnified1DArrayU32S32:
-  case NVPTXISD::TexUnified1DArrayU32Float:
-  case NVPTXISD::TexUnified1DArrayU32FloatLevel:
-  case NVPTXISD::TexUnified1DArrayU32FloatGrad:
-  case NVPTXISD::TexUnified2DFloatS32:
-  case NVPTXISD::TexUnified2DFloatFloat:
-  case NVPTXISD::TexUnified2DFloatFloatLevel:
-  case NVPTXISD::TexUnified2DFloatFloatGrad:
-  case NVPTXISD::TexUnified2DS32S32:
-  case NVPTXISD::TexUnified2DS32Float:
-  case NVPTXISD::TexUnified2DS32FloatLevel:
-  case NVPTXISD::TexUnified2DS32FloatGrad:
-  case NVPTXISD::TexUnified2DU32S32:
-  case NVPTXISD::TexUnified2DU32Float:
-  case NVPTXISD::TexUnified2DU32FloatLevel:
-  case NVPTXISD::TexUnified2DU32FloatGrad:
-  case NVPTXISD::TexUnified2DArrayFloatS32:
-  case NVPTXISD::TexUnified2DArrayFloatFloat:
-  case NVPTXISD::TexUnified2DArrayFloatFloatLevel:
-  case NVPTXISD::TexUnified2DArrayFloatFloatGrad:
-  case NVPTXISD::TexUnified2DArrayS32S32:
-  case NVPTXISD::TexUnified2DArrayS32Float:
-  case NVPTXISD::TexUnified2DArrayS32FloatLevel:
-  case NVPTXISD::TexUnified2DArrayS32FloatGrad:
-  case NVPTXISD::TexUnified2DArrayU32S32:
-  case NVPTXISD::TexUnified2DArrayU32Float:
-  case NVPTXISD::TexUnified2DArrayU32FloatLevel:
-  case NVPTXISD::TexUnified2DArrayU32FloatGrad:
-  case NVPTXISD::TexUnified3DFloatS32:
-  case NVPTXISD::TexUnified3DFloatFloat:
-  case NVPTXISD::TexUnified3DFloatFloatLevel:
-  case NVPTXISD::TexUnified3DFloatFloatGrad:
-  case NVPTXISD::TexUnified3DS32S32:
-  case NVPTXISD::TexUnified3DS32Float:
-  case NVPTXISD::TexUnified3DS32FloatLevel:
-  case NVPTXISD::TexUnified3DS32FloatGrad:
-  case NVPTXISD::TexUnified3DU32S32:
-  case NVPTXISD::TexUnified3DU32Float:
-  case NVPTXISD::TexUnified3DU32FloatLevel:
-  case NVPTXISD::TexUnified3DU32FloatGrad:
-  case NVPTXISD::TexUnifiedCubeFloatFloat:
-  case NVPTXISD::TexUnifiedCubeFloatFloatLevel:
-  case NVPTXISD::TexUnifiedCubeS32Float:
-  case NVPTXISD::TexUnifiedCubeS32FloatLevel:
-  case NVPTXISD::TexUnifiedCubeU32Float:
-  case NVPTXISD::TexUnifiedCubeU32FloatLevel:
-  case NVPTXISD::TexUnifiedCubeArrayFloatFloat:
-  case NVPTXISD::TexUnifiedCubeArrayFloatFloatLevel:
-  case NVPTXISD::TexUnifiedCubeArrayS32Float:
-  case NVPTXISD::TexUnifiedCubeArrayS32FloatLevel:
-  case NVPTXISD::TexUnifiedCubeArrayU32Float:
-  case NVPTXISD::TexUnifiedCubeArrayU32FloatLevel:
-  case NVPTXISD::TexUnifiedCubeFloatFloatGrad:
-  case NVPTXISD::TexUnifiedCubeS32FloatGrad:
-  case NVPTXISD::TexUnifiedCubeU32FloatGrad:
-  case NVPTXISD::TexUnifiedCubeArrayFloatFloatGrad:
-  case NVPTXISD::TexUnifiedCubeArrayS32FloatGrad:
-  case NVPTXISD::TexUnifiedCubeArrayU32FloatGrad:
-  case NVPTXISD::Tld4UnifiedR2DFloatFloat:
-  case NVPTXISD::Tld4UnifiedG2DFloatFloat:
-  case NVPTXISD::Tld4UnifiedB2DFloatFloat:
-  case NVPTXISD::Tld4UnifiedA2DFloatFloat:
-  case NVPTXISD::Tld4UnifiedR2DS64Float:
-  case NVPTXISD::Tld4UnifiedG2DS64Float:
-  case NVPTXISD::Tld4UnifiedB2DS64Float:
-  case NVPTXISD::Tld4UnifiedA2DS64Float:
-  case NVPTXISD::Tld4UnifiedR2DU64Float:
-  case NVPTXISD::Tld4UnifiedG2DU64Float:
-  case NVPTXISD::Tld4UnifiedB2DU64Float:
-  case NVPTXISD::Tld4UnifiedA2DU64Float:
-    if (tryTextureIntrinsic(N))
-      return;
-    break;
-  case NVPTXISD::Suld1DI8Clamp:
-  case NVPTXISD::Suld1DI16Clamp:
-  case NVPTXISD::Suld1DI32Clamp:
-  case NVPTXISD::Suld1DI64Clamp:
-  case NVPTXISD::Suld1DV2I8Clamp:
-  case NVPTXISD::Suld1DV2I16Clamp:
-  case NVPTXISD::Suld1DV2I32Clamp:
-  case NVPTXISD::Suld1DV2I64Clamp:
-  case NVPTXISD::Suld1DV4I8Clamp:
-  case NVPTXISD::Suld1DV4I16Clamp:
-  case NVPTXISD::Suld1DV4I32Clamp:
-  case NVPTXISD::Suld1DArrayI8Clamp:
-  case NVPTXISD::Suld1DArrayI16Clamp:
-  case NVPTXISD::Suld1DArrayI32Clamp:
-  case NVPTXISD::Suld1DArrayI64Clamp:
-  case NVPTXISD::Suld1DArrayV2I8Clamp:
-  case NVPTXISD::Suld1DArrayV2I16Clamp:
-  case NVPTXISD::Suld1DArrayV2I32Clamp:
-  case NVPTXISD::Suld1DArrayV2I64Clamp:
-  case NVPTXISD::Suld1DArrayV4I8Clamp:
-  case NVPTXISD::Suld1DArrayV4I16Clamp:
-  case NVPTXISD::Suld1DArrayV4I32Clamp:
-  case NVPTXISD::Suld2DI8Clamp:
-  case NVPTXISD::Suld2DI16Clamp:
-  case NVPTXISD::Suld2DI32Clamp:
-  case NVPTXISD::Suld2DI64Clamp:
-  case NVPTXISD::Suld2DV2I8Clamp:
-  case NVPTXISD::Suld2DV2I16Clamp:
-  case NVPTXISD::Suld2DV2I32Clamp:
-  case NVPTXISD::Suld2DV2I64Clamp:
-  case NVPTXISD::Suld2DV4I8Clamp:
-  case NVPTXISD::Suld2DV4I16Clamp:
-  case NVPTXISD::Suld2DV4I32Clamp:
-  case NVPTXISD::Suld2DArrayI8Clamp:
-  case NVPTXISD::Suld2DArrayI16Clamp:
-  case NVPTXISD::Suld2DArrayI32Clamp:
-  case NVPTXISD::Suld2DArrayI64Clamp:
-  case NVPTXISD::Suld2DArrayV2I8Clamp:
-  case NVPTXISD::Suld2DArrayV2I16Clamp:
-  case NVPTXISD::Suld2DArrayV2I32Clamp:
-  case NVPTXISD::Suld2DArrayV2I64Clamp:
-  case NVPTXISD::Suld2DArrayV4I8Clamp:
-  case NVPTXISD::Suld2DArrayV4I16Clamp:
-  case NVPTXISD::Suld2DArrayV4I32Clamp:
-  case NVPTXISD::Suld3DI8Clamp:
-  case NVPTXISD::Suld3DI16Clamp:
-  case NVPTXISD::Suld3DI32Clamp:
-  case NVPTXISD::Suld3DI64Clamp:
-  case NVPTXISD::Suld3DV2I8Clamp:
-  case NVPTXISD::Suld3DV2I16Clamp:
-  case NVPTXISD::Suld3DV2I32Clamp:
-  case NVPTXISD::Suld3DV2I64Clamp:
-  case NVPTXISD::Suld3DV4I8Clamp:
-  case NVPTXISD::Suld3DV4I16Clamp:
-  case NVPTXISD::Suld3DV4I32Clamp:
-  case NVPTXISD::Suld1DI8Trap:
-  case NVPTXISD::Suld1DI16Trap:
-  case NVPTXISD::Suld1DI32Trap:
-  case NVPTXISD::Suld1DI64Trap:
-  case NVPTXISD::Suld1DV2I8Trap:
-  case NVPTXISD::Suld1DV2I16Trap:
-  case NVPTXISD::Suld1DV2I32Trap:
-  case NVPTXISD::Suld1DV2I64Trap:
-  case NVPTXISD::Suld1DV4I8Trap:
-  case NVPTXISD::Suld1DV4I16Trap:
-  case NVPTXISD::Suld1DV4I32Trap:
-  case NVPTXISD::Suld1DArrayI8Trap:
-  case NVPTXISD::Suld1DArrayI16Trap:
-  case NVPTXISD::Suld1DArrayI32Trap:
-  case NVPTXISD::Suld1DArrayI64Trap:
-  case NVPTXISD::Suld1DArrayV2I8Trap:
-  case NVPTXISD::Suld1DArrayV2I16Trap:
-  case NVPTXISD::Suld1DArrayV2I32Trap:
-  case NVPTXISD::Suld1DArrayV2I64Trap:
-  case NVPTXISD::Suld1DArrayV4I8Trap:
-  case NVPTXISD::Suld1DArrayV4I16Trap:
-  case NVPTXISD::Suld1DArrayV4I32Trap:
-  case NVPTXISD::Suld2DI8Trap:
-  case NVPTXISD::Suld2DI16Trap:
-  case NVPTXISD::Suld2DI32Trap:
-  case NVPTXISD::Suld2DI64Trap:
-  case NVPTXISD::Suld2DV2I8Trap:
-  case NVPTXISD::Suld2DV2I16Trap:
-  case NVPTXISD::Suld2DV2I32Trap:
-  case NVPTXISD::Suld2DV2I64Trap:
-  case NVPTXISD::Suld2DV4I8Trap:
-  case NVPTXISD::Suld2DV4I16Trap:
-  case NVPTXISD::Suld2DV4I32Trap:
-  case NVPTXISD::Suld2DArrayI8Trap:
-  case NVPTXISD::Suld2DArrayI16Trap:
-  case NVPTXISD::Suld2DArrayI32Trap:
-  case NVPTXISD::Suld2DArrayI64Trap:
-  case NVPTXISD::Suld2DArrayV2I8Trap:
-  case NVPTXISD::Suld2DArrayV2I16Trap:
-  case NVPTXISD::Suld2DArrayV2I32Trap:
-  case NVPTXISD::Suld2DArrayV2I64Trap:
-  case NVPTXISD::Suld2DArrayV4I8Trap:
-  case NVPTXISD::Suld2DArrayV4I16Trap:
-  case NVPTXISD::Suld2DArrayV4I32Trap:
-  case NVPTXISD::Suld3DI8Trap:
-  case NVPTXISD::Suld3DI16Trap:
-  case NVPTXISD::Suld3DI32Trap:
-  case NVPTXISD::Suld3DI64Trap:
-  case NVPTXISD::Suld3DV2I8Trap:
-  case NVPTXISD::Suld3DV2I16Trap:
-  case NVPTXISD::Suld3DV2I32Trap:
-  case NVPTXISD::Suld3DV2I64Trap:
-  case NVPTXISD::Suld3DV4I8Trap:
-  case NVPTXISD::Suld3DV4I16Trap:
-  case NVPTXISD::Suld3DV4I32Trap:
-  case NVPTXISD::Suld1DI8Zero:
-  case NVPTXISD::Suld1DI16Zero:
-  case NVPTXISD::Suld1DI32Zero:
-  case NVPTXISD::Suld1DI64Zero:
-  case NVPTXISD::Suld1DV2I8Zero:
-  case NVPTXISD::Suld1DV2I16Zero:
-  case NVPTXISD::Suld1DV2I32Zero:
-  case NVPTXISD::Suld1DV2I64Zero:
-  case NVPTXISD::Suld1DV4I8Zero:
-  case NVPTXISD::Suld1DV4I16Zero:
-  case NVPTXISD::Suld1DV4I32Zero:
-  case NVPTXISD::Suld1DArrayI8Zero:
-  case NVPTXISD::Suld1DArrayI16Zero:
-  case NVPTXISD::Suld1DArrayI32Zero:
-  case NVPTXISD::Suld1DArrayI64Zero:
-  case NVPTXISD::Suld1DArrayV2I8Zero:
-  case NVPTXISD::Suld1DArrayV2I16Zero:
-  case NVPTXISD::Suld1DArrayV2I32Zero:
-  case NVPTXISD::Suld1DArrayV2I64Zero:
-  case NVPTXISD::Suld1DArrayV4I8Zero:
-  case NVPTXISD::Suld1DArrayV4I16Zero:
-  case NVPTXISD::Suld1DArrayV4I32Zero:
-  case NVPTXISD::Suld2DI8Zero:
-  case NVPTXISD::Suld2DI16Zero:
-  case NVPTXISD::Suld2DI32Zero:
-  case NVPTXISD::Suld2DI64Zero:
-  case NVPTXISD::Suld2DV2I8Zero:
-  case NVPTXISD::Suld2DV2I16Zero:
-  case NVPTXISD::Suld2DV2I32Zero:
-  case NVPTXISD::Suld2DV2I64Zero:
-  case NVPTXISD::Suld2DV4I8Zero:
-  case NVPTXISD::Suld2DV4I16Zero:
-  case NVPTXISD::Suld2DV4I32Zero:
-  case NVPTXISD::Suld2DArrayI8Zero:
-  case NVPTXISD::Suld2DArrayI16Zero:
-  case NVPTXISD::Suld2DArrayI32Zero:
-  case NVPTXISD::Suld2DArrayI64Zero:
-  case NVPTXISD::Suld2DArrayV2I8Zero:
-  case NVPTXISD::Suld2DArrayV2I16Zero:
-  case NVPTXISD::Suld2DArrayV2I32Zero:
-  case NVPTXISD::Suld2DArrayV2I64Zero:
-  case NVPTXISD::Suld2DArrayV4I8Zero:
-  case NVPTXISD::Suld2DArrayV4I16Zero:
-  case NVPTXISD::Suld2DArrayV4I32Zero:
-  case NVPTXISD::Suld3DI8Zero:
-  case NVPTXISD::Suld3DI16Zero:
-  case NVPTXISD::Suld3DI32Zero:
-  case NVPTXISD::Suld3DI64Zero:
-  case NVPTXISD::Suld3DV2I8Zero:
-  case NVPTXISD::Suld3DV2I16Zero:
-  case NVPTXISD::Suld3DV2I32Zero:
-  case NVPTXISD::Suld3DV2I64Zero:
-  case NVPTXISD::Suld3DV4I8Zero:
-  case NVPTXISD::Suld3DV4I16Zero:
-  case NVPTXISD::Suld3DV4I32Zero:
-    if (trySurfaceIntrinsic(N))
-      return;
-    break;
   case ISD::AND:
   case ISD::SRA:
   case ISD::SRL:
@@ -2604,1053 +2259,6 @@ bool NVPTXDAGToDAGISel::tryStoreParam(SDNode *N) {
   return true;
 }
 
-bool NVPTXDAGToDAGISel::tryTextureIntrinsic(SDNode *N) {
-  unsigned Opc = 0;
-
-  switch (N->getOpcode()) {
-  default: return false;
-  case NVPTXISD::Tex1DFloatS32:
-    Opc = NVPTX::TEX_1D_F32_S32_RR;
-    break;
-  case NVPTXISD::Tex1DFloatFloat:
-    Opc = NVPTX::TEX_1D_F32_F32_RR;
-    break;
-  case NVPTXISD::Tex1DFloatFloatLevel:
-    Opc = NVPTX::TEX_1D_F32_F32_LEVEL_RR;
-    break;
-  case NVPTXISD::Tex1DFloatFloatGrad:
-    Opc = NVPTX::TEX_1D_F32_F32_GRAD_RR;
-    break;
-  case NVPTXISD::Tex1DS32S32:
-    Opc = NVPTX::TEX_1D_S32_S32_RR;
-    break;
-  case NVPTXISD::Tex1DS32Float:
-    Opc = NVPTX::TEX_1D_S32_F32_RR;
-    break;
-  case NVPTXISD::Tex1DS32FloatLevel:
-    Opc = NVPTX::TEX_1D_S32_F32_LEVEL_RR;
-    break;
-  case NVPTXISD::Tex1DS32FloatGrad:
-    Opc = NVPTX::TEX_1D_S32_F32_GRAD_RR;
-    break;
-  case NVPTXISD::Tex1DU32S32:
-    Opc = NVPTX::TEX_1D_U32_S32_RR;
-    break;
-  case NVPTXISD::Tex1DU32Float:
-    Opc = NVPTX::TEX_1D_U32_F32_RR;
-    break;
-  case NVPTXISD::Tex1DU32FloatLevel:
-    Opc = NVPTX::TEX_1D_U32_F32_LEVEL_RR;
-    break;
-  case NVPTXISD::Tex1DU32FloatGrad:
-    Opc = NVPTX::TEX_1D_U32_F32_GRAD_RR;
-    break;
-  case NVPTXISD::Tex1DArrayFloatS32:
-    Opc = NVPTX::TEX_1D_ARRAY_F32_S32_RR;
-    break;
-  case NVPTXISD::Tex1DArrayFloatFloat:
-    Opc = NVPTX::TEX_1D_ARRAY_F32_F32_RR;
-    break;
-  case NVPTXISD::Tex1DArrayFloatFloatLevel:
-    Opc = NVPTX::TEX_1D_ARRAY_F32_F32_LEVEL_RR;
-    break;
-  case NVPTXISD::Tex1DArrayFloatFloatGrad:
-    Opc = NVPTX::TEX_1D_ARRAY_F32_F32_GRAD_RR;
-    break;
-  case NVPTXISD::Tex1DArrayS32S32:
-    Opc = NVPTX::TEX_1D_ARRAY_S32_S32_RR;
-    break;
-  case NVPTXISD::Tex1DArrayS32Float:
-    Opc = NVPTX::TEX_1D_ARRAY_S32_F32_RR;
-    break;
-  case NVPTXISD::Tex1DArrayS32FloatLevel:
-    Opc = NVPTX::TEX_1D_ARRAY_S32_F32_LEVEL_RR;
-    break;
-  case NVPTXISD::Tex1DArrayS32FloatGrad:
-    Opc = NVPTX::TEX_1D_ARRAY_S32_F32_GRAD_RR;
-    break;
-  case NVPTXISD::Tex1DArrayU32S32:
-    Opc = NVPTX::TEX_1D_ARRAY_U32_S32_RR;
-    break;
-  case NVPTXISD::Tex1DArrayU32Float:
-    Opc = NVPTX::TEX_1D_ARRAY_U32_F32_RR;
-    break;
-  case NVPTXISD::Tex1DArrayU32FloatLevel:
-    Opc = NVPTX::TEX_1D_ARRAY_U32_F32_LEVEL_RR;
-    break;
-  case NVPTXISD::Tex1DArrayU32FloatGrad:
-    Opc = NVPTX::TEX_1D_ARRAY_U32_F32_GRAD_RR;
-    break;
-  case NVPTXISD::Tex2DFloatS32:
-    Opc = NVPTX::TEX_2D_F32_S32_RR;
-    break;
-  case NVPTXISD::Tex2DFloatFloat:
-    Opc = NVPTX::TEX_2D_F32_F32_RR;
-    break;
-  case NVPTXISD::Tex2DFloatFloatLevel:
-    Opc = NVPTX::TEX_2D_F32_F32_LEVEL_RR;
-    break;
-  case NVPTXISD::Tex2DFloatFloatGrad:
-    Opc = NVPTX::TEX_2D_F32_F32_GRAD_RR;
-    break;
-  case NVPTXISD::Tex2DS32S32:
-    Opc = NVPTX::TEX_2D_S32_S32_RR;
-    break;
-  case NVPTXISD::Tex2DS32Float:
-    Opc = NVPTX::TEX_2D_S32_F32_RR;
-    break;
-  case NVPTXISD::Tex2DS32FloatLevel:
-    Opc = NVPTX::TEX_2D_S32_F32_LEVEL_RR;
-    break;
-  case NVPTXISD::Tex2DS32FloatGrad:
-    Opc = NVPTX::TEX_2D_S32_F32_GRAD_RR;
-    break;
-  case NVPTXISD::Tex2DU32S32:
-    Opc = NVPTX::TEX_2D_U32_S32_RR;
-    break;
-  case NVPTXISD::Tex2DU32Float:
-    Opc = NVPTX::TEX_2D_U32_F32_RR;
-    break;
-  case NVPTXISD::Tex2DU32FloatLevel:
-    Opc = NVPTX::TEX_2D_U32_F32_LEVEL_RR;
-    break;
-  case NVPTXISD::Tex2DU32FloatGrad:
-    Opc = NVPTX::TEX_2D_U32_F32_GRAD_RR;
-    break;
-  case NVPTXISD::Tex2DArrayFloatS32:
-    Opc = NVPTX::TEX_2D_ARRAY_F32_S32_RR;
-    break;
-  case NVPTXISD::Tex2DArrayFloatFloat:
-    Opc = NVPTX::TEX_2D_ARRAY_F32_F32_RR;
-    break;
-  case NVPTXISD::Tex2DArrayFloatFloatLevel:
-    Opc = NVPTX::TEX_2D_ARRAY_F32_F32_LEVEL_RR;
-    break;
-  case NVPTXISD::Tex2DArrayFloatFloatGrad:
-    Opc = NVPTX::TEX_2D_ARRAY_F32_F32_GRAD_RR;
-    break;
-  case NVPTXISD::Tex2DArrayS32S32:
-    Opc = NVPTX::TEX_2D_ARRAY_S32_S32_RR;
-    break;
-  case NVPTXISD::Tex2DArrayS32Float:
-    Opc = NVPTX::TEX_2D_ARRAY_S32_F32_RR;
-    break;
-  case NVPTXISD::Tex2DArrayS32FloatLevel:
-    Opc = NVPTX::TEX_2D_ARRAY_S32_F32_LEVEL_RR;
-    break;
-  case NVPTXISD::Tex2DArrayS32FloatGrad:
-    Opc = NVPTX::TEX_2D_ARRAY_S32_F32_GRAD_RR;
-    break;
-  case NVPTXISD::Tex2DArrayU32S32:
-    Opc = NVPTX::TEX_2D_ARRAY_U32_S32_RR;
-    break;
-  case NVPTXISD::Tex2DArrayU32Float:
-    Opc = NVPTX::TEX_2D_ARRAY_U32_F32_RR;
-    break;
-  case NVPTXISD::Tex2DArrayU32FloatLevel:
-    Opc = NVPTX::TEX_2D_ARRAY_U32_F32_LEVEL_RR;
-    break;
-  case NVPTXISD::Tex2DArrayU32FloatGrad:
-    Opc = NVPTX::TEX_2D_ARRAY_U32_F32_GRAD_RR;
-    break;
-  case NVPTXISD::Tex3DFloatS32:
-    Opc = NVPTX::TEX_3D_F32_S32_RR;
-    break;
-  case NVPTXISD::Tex3DFloatFloat:
-    Opc = NVPTX::TEX_3D_F32_F32_RR;
-    break;
-  case NVPTXISD::Tex3DFloatFloatLevel:
-    Opc = NVPTX::TEX_3D_F32_F32_LEVEL_RR;
-    break;
-  case NVPTXISD::Tex3DFloatFloatGrad:
-    Opc = NVPTX::TEX_3D_F32_F32_GRAD_RR;
-    break;
-  case NVPTXISD::Tex3DS32S32:
-    Opc = NVPTX::TEX_3D_S32_S32_RR;
-    break;
-  case NVPTXISD::Tex3DS32Float:
-    Opc = NVPTX::TEX_3D_S32_F32_RR;
-    break;
-  case NVPTXISD::Tex3DS32FloatLevel:
-    Opc = NVPTX::TEX_3D_S32_F32_LEVEL_RR;
-    break;
-  case NVPTXISD::Tex3DS32FloatGrad:
-    Opc = NVPTX::TEX_3D_S32_F32_GRAD_RR;
-    break;
-  case NVPTXISD::Tex3DU32S32:
-    Opc = NVPTX::TEX_3D_U32_S32_RR;
-    break;
-  case NVPTXISD::Tex3DU32Float:
-    Opc = NVPTX::TEX_3D_U32_F32_RR;
-    break;
-  case NVPTXISD::Tex3DU32FloatLevel:
-    Opc = NVPTX::TEX_3D_U32_F32_LEVEL_RR;
-    break;
-  case NVPTXISD::Tex3DU32FloatGrad:
-    Opc = NVPTX::TEX_3D_U32_F32_GRAD_RR;
-    break;
-  case NVPTXISD::TexCubeFloatFloat:
-    Opc = NVPTX::TEX_CUBE_F32_F32_RR;
-    break;
-  case NVPTXISD::TexCubeFloatFloatLevel:
-    Opc = NVPTX::TEX_CUBE_F32_F32_LEVEL_RR;
-    break;
-  case NVPTXISD::TexCubeS32Float:
-    Opc = NVPTX::TEX_CUBE_S32_F32_RR;
-    break;
-  case NVPTXISD::TexCubeS32FloatLevel:
-    Opc = NVPTX::TEX_CUBE_S32_F32_LEVEL_RR;
-    break;
-  case NVPTXISD::TexCubeU32Float:
-    Opc = NVPTX::TEX_CUBE_U32_F32_RR;
-    break;
-  case NVPTXISD::TexCubeU32FloatLevel:
-    Opc = NVPTX::TEX_CUBE_U32_F32_LEVEL_RR;
-    break;
-  case NVPTXISD::TexCubeArrayFloatFloat:
-    Opc = NVPTX::TEX_CUBE_ARRAY_F32_F32_RR;
-    break;
-  case NVPTXISD::TexCubeArrayFloatFloatLevel:
-    Opc = NVPTX::TEX_CUBE_ARRAY_F32_F32_LEVEL_RR;
-    break;
-  case NVPTXISD::TexCubeArrayS32Float:
-    Opc = NVPTX::TEX_CUBE_ARRAY_S32_F32_RR;
-    break;
-  case NVPTXISD::TexCubeArrayS32FloatLevel:
-    Opc = NVPTX::TEX_CUBE_ARRAY_S32_F32_LEVEL_RR;
-    break;
-  case NVPTXISD::TexCubeArrayU32Float:
-    Opc = NVPTX::TEX_CUBE_ARRAY_U32_F32_RR;
-    break;
-  case NVPTXISD::TexCubeArrayU32FloatLevel:
-    Opc = NVPTX::TEX_CUBE_ARRAY_U32_F32_LEVEL_RR;
-    break;
-  case NVPTXISD::Tld4R2DFloatFloat:
-    Opc = NVPTX::TLD4_R_2D_F32_F32_RR;
-    break;
-  case NVPTXISD::Tld4G2DFloatFloat:
-    Opc = NVPTX::TLD4_G_2D_F32_F32_RR;
-    break;
-  case NVPTXISD::Tld4B2DFloatFloat:
-    Opc = NVPTX::TLD4_B_2D_F32_F32_RR;
-    break;
-  case NVPTXISD::Tld4A2DFloatFloat:
-    Opc = NVPTX::TLD4_A_2D_F32_F32_RR;
-    break;
-  case NVPTXISD::Tld4R2DS64Float:
-    Opc = NVPTX::TLD4_R_2D_S32_F32_RR;
-    break;
-  case NVPTXISD::Tld4G2DS64Float:
-    Opc = NVPTX::TLD4_G_2D_S32_F32_RR;
-    break;
-  case NVPTXISD::Tld4B2DS64Float:
-    Opc = NVPTX::TLD4_B_2D_S32_F32_RR;
-    break;
-  case NVPTXISD::Tld4A2DS64Float:
-    Opc = NVPTX::TLD4_A_2D_S32_F32_RR;
-    break;
-  case NVPTXISD::Tld4R2DU64Float:
-    Opc = NVPTX::TLD4_R_2D_U32_F32_RR;
-    break;
-  case NVPTXISD::Tld4G2DU64Float:
-    Opc = NVPTX::TLD4_G_2D_U32_F32_RR;
-    break;
-  case NVPTXISD::Tld4B2DU64Float:
-    Opc = NVPTX::TLD4_B_2D_U32_F32_RR;
-    break;
-  case NVPTXISD::Tld4A2DU64Float:
-    Opc = NVPTX::TLD4_A_2D_U32_F32_RR;
-    break;
-  case NVPTXISD::TexUnified1DFloatS32:
-    Opc = NVPTX::TEX_UNIFIED_1D_F32_S32_R;
-    break;
-  case NVPTXISD::TexUnified1DFloatFloat:
-    Opc = NVPTX::TEX_UNIFIED_1D_F32_F32_R;
-    break;
-  case NVPTXISD::TexUnified1DFloatFloatLevel:
-    Opc = NVPTX::TEX_UNIFIED_1D_F32_F32_LEVEL_R;
-    break;
-  case NVPTXISD::TexUnified1DFloatFloatGrad:
-    Opc = NVPTX::TEX_UNIFIED_1D_F32_F32_GRAD_R;
-    break;
-  case NVPTXISD::TexUnified1DS32S32:
-    Opc = NVPTX::TEX_UNIFIED_1D_S32_S32_R;
-    break;
-  case NVPTXISD::TexUnified1DS32Float:
-    Opc = NVPTX::TEX_UNIFIED_1D_S32_F32_R;
-    break;
-  case NVPTXISD::TexUnified1DS32FloatLevel:
-    Opc = NVPTX::TEX_UNIFIED_1D_S32_F32_LEVEL_R;
-    break;
-  case NVPTXISD::TexUnified1DS32FloatGrad:
-    Opc = NVPTX::TEX_UNIFIED_1D_S32_F32_GRAD_R;
-    break;
-  case NVPTXISD::TexUnified1DU32S32:
-    Opc = NVPTX::TEX_UNIFIED_1D_U32_S32_R;
-    break;
-  case NVPTXISD::TexUnified1DU32Float:
-    Opc = NVPTX::TEX_UNIFIED_1D_U32_F32_R;
-    break;
-  case NVPTXISD::TexUnified1DU32FloatLevel:
-    Opc = NVPTX::TEX_UNIFIED_1D_U32_F32_LEVEL_R;
-    break;
-  case NVPTXISD::TexUnified1DU32FloatGrad:
-    Opc = NVPTX::TEX_UNIFIED_1D_U32_F32_GRAD_R;
-    break;
-  case NVPTXISD::TexUnified1DArrayFloatS32:
-    Opc = NVPTX::TEX_UNIFIED_1D_ARRAY_F32_S32_R;
-    break;
-  case NVPTXISD::TexUnified1DArrayFloatFloat:
-    Opc = NVPTX::TEX_UNIFIED_1D_ARRAY_F32_F32_R;
-    break;
-  case NVPTXISD::TexUnified1DArrayFloatFloatLevel:
-    Opc = NVPTX::TEX_UNIFIED_1D_ARRAY_F32_F32_LEVEL_R;
-    break;
-  case NVPTXISD::TexUnified1DArrayFloatFloatGrad:
-    Opc = NVPTX::TEX_UNIFIED_1D_ARRAY_F32_F32_GRAD_R;
-    break;
-  case NVPTXISD::TexUnified1DArrayS32S32:
-    Opc = NVPTX::TEX_UNIFIED_1D_ARRAY_S32_S32_R;
-    break;
-  case NVPTXISD::TexUnified1DArrayS32Float:
-    Opc = NVPTX::TEX_UNIFIED_1D_ARRAY_S32_F32_R;
-    break;
-  case NVPTXISD::TexUnified1DArrayS32FloatLevel:
-    Opc = NVPTX::TEX_UNIFIED_1D_ARRAY_S32_F32_LEVEL_R;
-    break;
-  case NVPTXISD::TexUnified1DArrayS32FloatGrad:
-    Opc = NVPTX::TEX_UNIFIED_1D_ARRAY_S32_F32_GRAD_R;
-    break;
-  case NVPTXISD::TexUnified1DArrayU32S32:
-    Opc = NVPTX::TEX_UNIFIED_1D_ARRAY_U32_S32_R;
-    break;
-  case NVPTXISD::TexUnified1DArrayU32Float:
-    Opc = NVPTX::TEX_UNIFIED_1D_ARRAY_U32_F32_R;
-    break;
-  case NVPTXISD::TexUnified1DArrayU32FloatLevel:
-    Opc = NVPTX::TEX_UNIFIED_1D_ARRAY_U32_F32_LEVEL_R;
-    break;
-  case NVPTXISD::TexUnified1DArrayU32FloatGrad:
-    Opc = NVPTX::TEX_UNIFIED_1D_ARRAY_U32_F32_GRAD_R;
-    break;
-  case NVPTXISD::TexUnified2DFloatS32:
-    Opc = NVPTX::TEX_UNIFIED_2D_F32_S32_R;
-    break;
-  case NVPTXISD::TexUnified2DFloatFloat:
-    Opc = NVPTX::TEX_UNIFIED_2D_F32_F32_R;
-    break;
-  case NVPTXISD::TexUnified2DFloatFloatLevel:
-    Opc = NVPTX::TEX_UNIFIED_2D_F32_F32_LEVEL_R;
-    break;
-  case NVPTXISD::TexUnified2DFloatFloatGrad:
-    Opc = NVPTX::TEX_UNIFIED_2D_F32_F32_GRAD_R;
-    break;
-  case NVPTXISD::TexUnified2DS32S32:
-    Opc = NVPTX::TEX_UNIFIED_2D_S32_S32_R;
-    break;
-  case NVPTXISD::TexUnified2DS32Float:
-    Opc = NVPTX::TEX_UNIFIED_2D_S32_F32_R;
-    break;
-  case NVPTXISD::TexUnified2DS32FloatLevel:
-    Opc = NVPTX::TEX_UNIFIED_2D_S32_F32_LEVEL_R;
-    break;
-  case NVPTXISD::TexUnified2DS32FloatGrad:
-    Opc = NVPTX::TEX_UNIFIED_2D_S32_F32_GRAD_R;
-    break;
-  case NVPTXISD::TexUnified2DU32S32:
-    Opc = NVPTX::TEX_UNIFIED_2D_U32_S32_R;
-    break;
-  case NVPTXISD::TexUnified2DU32Float:
-    Opc = NVPTX::TEX_UNIFIED_2D_U32_F32_R;
-    break;
-  case NVPTXISD::TexUnified2DU32FloatLevel:
-    Opc = NVPTX::TEX_UNIFIED_2D_U32_F32_LEVEL_R;
-    break;
-  case NVPTXISD::TexUnified2DU32FloatGrad:
-    Opc = NVPTX::TEX_UNIFIED_2D_U32_F32_GRAD_R;
-    break;
-  case NVPTXISD::TexUnified2DArrayFloatS32:
-    Opc = NVPTX::TEX_UNIFIED_2D_ARRAY_F32_S32_R;
-    break;
-  case NVPTXISD::TexUnified2DArrayFloatFloat:
-    Opc = NVPTX::TEX_UNIFIED_2D_ARRAY_F32_F32_R;
-    break;
-  case NVPTXISD::TexUnified2DArrayFloatFloatLevel:
-    Opc = NVPTX::TEX_UNIFIED_2D_ARRAY_F32_F32_LEVEL_R;
-    break;
-  case NVPTXISD::TexUnified2DArrayFloatFloatGrad:
-    Opc = NVPTX::TEX_UNIFIED_2D_ARRAY_F32_F32_GRAD_R;
-    break;
-  case NVPTXISD::TexUnified2DArrayS32S32:
-    Opc = NVPTX::TEX_UNIFIED_2D_ARRAY_S32_S32_R;
-    break;
-  case NVPTXISD::TexUnified2DArrayS32Float:
-    Opc = NVPTX::TEX_UNIFIED_2D_ARRAY_S32_F32_R;
-    break;
-  case NVPTXISD::TexUnified2DArrayS32FloatLevel:
-    Opc = NVPTX::TEX_UNIFIED_2D_ARRAY_S32_F32_LEVEL_R;
-    break;
-  case NVPTXISD::TexUnified2DArrayS32FloatGrad:
-    Opc = NVPTX::TEX_UNIFIED_2D_ARRAY_S32_F32_GRAD_R;
-    break;
-  case NVPTXISD::TexUnified2DArrayU32S32:
-    Opc = NVPTX::TEX_UNIFIED_2D_ARRAY_U32_S32_R;
-    break;
-  case NVPTXISD::TexUnified2DArrayU32Float:
-    Opc = NVPTX::TEX_UNIFIED_2D_ARRAY_U32_F32_R;
-    break;
-  case NVPTXISD::TexUnified2DArrayU32FloatLevel:
-    Opc = NVPTX::TEX_UNIFIED_2D_ARRAY_U32_F32_LEVEL_R;
-    break;
-  case NVPTXISD::TexUnified2DArrayU32FloatGrad:
-    Opc = NVPTX::TEX_UNIFIED_2D_ARRAY_U32_F32_GRAD_R;
-    break;
-  case NVPTXISD::TexUnified3DFloatS32:
-    Opc = NVPTX::TEX_UNIFIED_3D_F32_S32_R;
-    break;
-  case NVPTXISD::TexUnified3DFloatFloat:
-    Opc = NVPTX::TEX_UNIFIED_3D_F32_F32_R;
-    break;
-  case NVPTXISD::TexUnified3DFloatFloatLevel:
-    Opc = NVPTX::TEX_UNIFIED_3D_F32_F32_LEVEL_R;
-    break;
-  case NVPTXISD::TexUnified3DFloatFloatGrad:
-    Opc = NVPTX::TEX_UNIFIED_3D_F32_F32_GRAD_R;
-    break;
-  case NVPTXISD::TexUnified3DS32S32:
-    Opc = NVPTX::TEX_UNIFIED_3D_S32_S32_R;
-    break;
-  case NVPTXISD::TexUnified3DS32Float:
-    Opc = NVPTX::TEX_UNIFIED_3D_S32_F32_R;
-    break;
-  case NVPTXISD::TexUnified3DS32FloatLevel:
-    Opc = NVPTX::TEX_UNIFIED_3D_S32_F32_LEVEL_R;
-    break;
-  case NVPTXISD::TexUnified3DS32FloatGrad:
-    Opc = NVPTX::TEX_UNIFIED_3D_S32_F32_GRAD_R;
-    break;
-  case NVPTXISD::TexUnified3DU32S32:
-    Opc = NVPTX::TEX_UNIFIED_3D_U32_S32_R;
-    break;
-  case NVPTXISD::TexUnified3DU32Float:
-    Opc = NVPTX::TEX_UNIFIED_3D_U32_F32_R;
-    break;
-  case NVPTXISD::TexUnified3DU32FloatLevel:
-    Opc = NVPTX::TEX_UNIFIED_3D_U32_F32_LEVEL_R;
-    break;
-  case NVPTXISD::TexUnified3DU32FloatGrad:
-    Opc = NVPTX::TEX_UNIFIED_3D_U32_F32_GRAD_R;
-    break;
-  case NVPTXISD::TexUnifiedCubeFloatFloat:
-    Opc = NVPTX::TEX_UNIFIED_CUBE_F32_F32_R;
-    break;
-  case NVPTXISD::TexUnifiedCubeFloatFloatLevel:
-    Opc = NVPTX::TEX_UNIFIED_CUBE_F32_F32_LEVEL_R;
-    break;
-  case NVPTXISD::TexUnifiedCubeS32Float:
-    Opc = NVPTX::TEX_UNIFIED_CUBE_S32_F32_R;
-    break;
-  case NVPTXISD::TexUnifiedCubeS32FloatLevel:
-    Opc = NVPTX::TEX_UNIFIED_CUBE_S32_F32_LEVEL_R;
-    break;
-  case NVPTXISD::TexUnifiedCubeU32Float:
-    Opc = NVPTX::TEX_UNIFIED_CUBE_U32_F32_R;
-    break;
-  case NVPTXISD::TexUnifiedCubeU32FloatLevel:
-    Opc = NVPTX::TEX_UNIFIED_CUBE_U32_F32_LEVEL_R;
-    break;
-  case NVPTXISD::TexUnifiedCubeArrayFloatFloat:
-    Opc = NVPTX::TEX_UNIFIED_CUBE_ARRAY_F32_F32_R;
-    break;
-  case NVPTXISD::TexUnifiedCubeArrayFloatFloatLevel:
-    Opc = NVPTX::TEX_UNIFIED_CUBE_ARRAY_F32_F32_LEVEL_R;
-    break;
-  case NVPTXISD::TexUnifiedCubeArrayS32Float:
-    Opc = NVPTX::TEX_UNIFIED_CUBE_ARRAY_S32_F32_R;
-    break;
-  case NVPTXISD::TexUnifiedCubeArrayS32FloatLevel:
-    Opc = NVPTX::TEX_UNIFIED_CUBE_ARRAY_S32_F32_LEVEL_R;
-    break;
-  case NVPTXISD::TexUnifiedCubeArrayU32Float:
-    Opc = NVPTX::TEX_UNIFIED_CUBE_ARRAY_U32_F32_R;
-    break;
-  case NVPTXISD::TexUnifiedCubeArrayU32FloatLevel:
-    Opc = NVPTX::TEX_UNIFIED_CUBE_ARRAY_U32_F32_LEVEL_R;
-    break;
-  case NVPTXISD::Tld4UnifiedR2DFloatFloat:
-    Opc = NVPTX::TLD4_UNIFIED_R_2D_F32_F32_R;
-    break;
-  case NVPTXISD::Tld4UnifiedG2DFloatFloat:
-    Opc = NVPTX::TLD4_UNIFIED_G_2D_F32_F32_R;
-    break;
-  case NVPTXISD::Tld4UnifiedB2DFloatFloat:
-    Opc = NVPTX::TLD4_UNIFIED_B_2D_F32_F32_R;
-    break;
-  case NVPTXISD::Tld4UnifiedA2DFloatFloat:
-    Opc = NVPTX::TLD4_UNIFIED_A_2D_F32_F32_R;
-    break;
-  case NVPTXISD::Tld4UnifiedR2DS64Float:
-    Opc = NVPTX::TLD4_UNIFIED_R_2D_S32_F32_R;
-    break;
-  case NVPTXISD::Tld4UnifiedG2DS64Float:
-    Opc = NVPTX::TLD4_UNIFIED_G_2D_S32_F32_R;
-    break;
-  case NVPTXISD::Tld4UnifiedB2DS64Float:
-    Opc = NVPTX::TLD4_UNIFIED_B_2D_S32_F32_R;
-    break;
-  case NVPTXISD::Tld4UnifiedA2DS64Float:
-    Opc = NVPTX::TLD4_UNIFIED_A_2D_S32_F32_R;
-    break;
-  case NVPTXISD::Tld4UnifiedR2DU64Float:
-    Opc = NVPTX::TLD4_UNIFIED_R_2D_U32_F32_R;
-    break;
-  case NVPTXISD::Tld4UnifiedG2DU64Float:
-    Opc = NVPTX::TLD4_UNIFIED_G_2D_U32_F32_R;
-    break;
-  case NVPTXISD::Tld4UnifiedB2DU64Float:
-    Opc = NVPTX::TLD4_UNIFIED_B_2D_U32_F32_R;
-    break;
-  case NVPTXISD::Tld4UnifiedA2DU64Float:
-    Opc = NVPTX::TLD4_UNIFIED_A_2D_U32_F32_R;
-    break;
-  case NVPTXISD::TexUnifiedCubeFloatFloatGrad:
-    Opc = NVPTX::TEX_UNIFIED_CUBE_F32_F32_GRAD_R;
-    break;
-  case NVPTXISD::TexUnifiedCubeS32FloatGrad:
-    Opc = NVPTX::TEX_UNIFIED_CUBE_S32_F32_GRAD_R;
-    break;
-  case NVPTXISD::TexUnifiedCubeU32FloatGrad:
-    Opc = NVPTX::TEX_UNIFIED_CUBE_U32_F32_GRAD_R;
-    break;
-  case NVPTXISD::TexUnifiedCubeArrayFloatFloatGrad:
-    Opc = NVPTX::TEX_UNIFIED_CUBE_ARRAY_F32_F32_GRAD_R;
-    break;
-  case NVPTXISD::TexUnifiedCubeArrayS32FloatGrad:
-    Opc = NVPTX::TEX_UNIFIED_CUBE_ARRAY_S32_F32_GRAD_R;
-    break;
-  case NVPTXISD::TexUnifiedCubeArrayU32FloatGrad:
-    Opc = NVPTX::TEX_UNIFIED_CUBE_ARRAY_U32_F32_GRAD_R;
-    break;
-  }
-
-  // Copy over operands
-  SmallVector<SDValue, 8> Ops(drop_begin(N->ops()));
-  Ops.push_back(N->getOperand(0)); // Move chain to the back.
-
-  ReplaceNode(N, CurDAG->getMachineNode(Opc, SDLoc(N), N->getVTList(), Ops));
-  return true;
-}
-
-bool NVPTXDAGToDAGISel::trySurfaceIntrinsic(SDNode *N) {
-  unsigned Opc = 0;
-  switch (N->getOpcode()) {
-  default: return false;
-  case NVPTXISD::Suld1DI8Clamp:
-    Opc = NVPTX::SULD_1D_I8_CLAMP_R;
-    break;
-  case NVPTXISD::Suld1DI16Clamp:
-    Opc = NVPTX::SULD_1D_I16_CLAMP_R;
-    break;
-  case NVPTXISD::Suld1DI32Clamp:
-    Opc = NVPTX::SULD_1D_I32_CLAMP_R;
-    break;
-  case NVPTXISD::Suld1DI64Clamp:
-    Opc = NVPTX::SULD_1D_I64_CLAMP_R;
-    break;
-  case NVPTXISD::Suld1DV2I8Clamp:
-    Opc = NVPTX::SULD_1D_V2I8_CLAMP_R;
-    break;
-  case NVPTXISD::Suld1DV2I16Clamp:
-    Opc = NVPTX::SULD_1D_V2I16_CLAMP_R;
-    break;
-  case NVPTXISD::Suld1DV2I32Clamp:
-    Opc = NVPTX::SULD_1D_V2I32_CLAMP_R;
-    break;
-  case NVPTXISD::Suld1DV2I64Clamp:
-    Opc = NVPTX::SULD_1D_V2I64_CLAMP_R;
-    break;
-  case NVPTXISD::Suld1DV4I8Clamp:
-    Opc = NVPTX::SULD_1D_V4I8_CLAMP_R;
-    break;
-  case NVPTXISD::Suld1DV4I16Clamp:
-    Opc = NVPTX::SULD_1D_V4I16_CLAMP_R;
-    break;
-  case NVPTXISD::Suld1DV4I32Clamp:
-    Opc = NVPTX::SULD_1D_V4I32_CLAMP_R;
-    break;
-  case NVPTXISD::Suld1DArrayI8Clamp:
-    Opc = NVPTX::SULD_1D_ARRAY_I8_CLAMP_R;
-    break;
-  case NVPTXISD::Suld1DArrayI16Clamp:
-    Opc = NVPTX::SULD_1D_ARRAY_I16_CLAMP_R;
-    break;
-  case NVPTXISD::Suld1DArrayI32Clamp:
-    Opc = NVPTX::SULD_1D_ARRAY_I32_CLAMP_R;
-    break;
-  case NVPTXISD::Suld1DArrayI64Clamp:
-    Opc = NVPTX::SULD_1D_ARRAY_I64_CLAMP_R;
-    break;
-  case NVPTXISD::Suld1DArrayV2I8Clamp:
-    Opc = NVPTX::SULD_1D_ARRAY_V2I8_CLAMP_R;
-    break;
-  case NVPTXISD::Suld1DArrayV2I16Clamp:
-    Opc = NVPTX::SULD_1D_ARRAY_V2I16_CLAMP_R;
-    break;
-  case NVPTXISD::Suld1DArrayV2I32Clamp:
-    Opc = NVPTX::SULD_1D_ARRAY_V2I32_CLAMP_R;
-    break;
-  case NVPTXISD::Suld1DArrayV2I64Clamp:
-    Opc = NVPTX::SULD_1D_ARRAY_V2I64_CLAMP_R;
-    break;
-  case NVPTXISD::Suld1DArrayV4I8Clamp:
-    Opc = NVPTX::SULD_1D_ARRAY_V4I8_CLAMP_R;
-    break;
-  case NVPTXISD::Suld1DArrayV4I16Clamp:
-    Opc = NVPTX::SULD_1D_ARRAY_V4I16_CLAMP_R;
-    break;
-  case NVPTXISD::Suld1DArrayV4I32Clamp:
-    Opc = NVPTX::SULD_1D_ARRAY_V4I32_CLAMP_R;
-    break;
-  case NVPTXISD::Suld2DI8Clamp:
-    Opc = NVPTX::SULD_2D_I8_CLAMP_R;
-    break;
-  case NVPTXISD::Suld2DI16Clamp:
-    Opc = NVPTX::SULD_2D_I16_CLAMP_R;
-    break;
-  case NVPTXISD::Suld2DI32Clamp:
-    Opc = NVPTX::SULD_2D_I32_CLAMP_R;
-    break;
-  case NVPTXISD::Suld2DI64Clamp:
-    Opc = NVPTX::SULD_2D_I64_CLAMP_R;
-    break;
-  case NVPTXISD::Suld2DV2I8Clamp:
-    Opc = NVPTX::SULD_2D_V2I8_CLAMP_R;
-    break;
-  case NVPTXISD::Suld2DV2I16Clamp:
-    Opc = NVPTX::SULD_2D_V2I16_CLAMP_R;
-    break;
-  case NVPTXISD::Suld2DV2I32Clamp:
-    Opc = NVPTX::SULD_2D_V2I32_CLAMP_R;
-    break;
-  case NVPTXISD::Suld2DV2I64Clamp:
-    Opc = NVPTX::SULD_2D_V2I64_CLAMP_R;
-    break;
-  case NVPTXISD::Suld2DV4I8Clamp:
-    Opc = NVPTX::SULD_2D_V4I8_CLAMP_R;
-    break;
-  case NVPTXISD::Suld2DV4I16Clamp:
-    Opc = NVPTX::SULD_2D_V4I16_CLAMP_R;
-    break;
-  case NVPTXISD::Suld2DV4I32Clamp:
-    Opc = NVPTX::SULD_2D_V4I32_CLAMP_R;
-    break;
-  case NVPTXISD::Suld2DArrayI8Clamp:
-    Opc = NVPTX::SULD_2D_ARRAY_I8_CLAMP_R;
-    break;
-  case NVPTXISD::Suld2DArrayI16Clamp:
-    Opc = NVPTX::SULD_2D_ARRAY_I16_CLAMP_R;
-    break;
-  case NVPTXISD::Suld2DArrayI32Clamp:
-    Opc = NVPTX::SULD_2D_ARRAY_I32_CLAMP_R;
-    break;
-  case NVPTXISD::Suld2DArrayI64Clamp:
-    Opc = NVPTX::SULD_2D_ARRAY_I64_CLAMP_R;
-    break;
-  case NVPTXISD::Suld2DArrayV2I8Clamp:
-    Opc = NVPTX::SULD_2D_ARRAY_V2I8_CLAMP_R;
-    break;
-  case NVPTXISD::Suld2DArrayV2I16Clamp:
-    Opc = NVPTX::SULD_2D_ARRAY_V2I16_CLAMP_R;
-    break;
-  case NVPTXISD::Suld2DArrayV2I32Clamp:
-    Opc = NVPTX::SULD_2D_ARRAY_V2I32_CLAMP_R;
-    break;
-  case NVPTXISD::Suld2DArrayV2I64Clamp:
-    Opc = NVPTX::SULD_2D_ARRAY_V2I64_CLAMP_R;
-    break;
-  case NVPTXISD::Suld2DArrayV4I8Clamp:
-    Opc = NVPTX::SULD_2D_ARRAY_V4I8_CLAMP_R;
-    break;
-  case NVPTXISD::Suld2DArrayV4I16Clamp:
-    Opc = NVPTX::SULD_2D_ARRAY_V4I16_CLAMP_R;
-    break;
-  case NVPTXISD::Suld2DArrayV4I32Clamp:
-    Opc = NVPTX::SULD_2D_ARRAY_V4I32_CLAMP_R;
-    break;
-  case NVPTXISD::Suld3DI8Clamp:
-    Opc = NVPTX::SULD_3D_I8_CLAMP_R;
-    break;
-  case NVPTXISD::Suld3DI16Clamp:
-    Opc = NVPTX::SULD_3D_I16_CLAMP_R;
-    break;
-  case NVPTXISD::Suld3DI32Clamp:
-    Opc = NVPTX::SULD_3D_I32_CLAMP_R;
-    break;
-  case NVPTXISD::Suld3DI64Clamp:
-    Opc = NVPTX::SULD_3D_I64_CLAMP_R;
-    break;
-  case NVPTXISD::Suld3DV2I8Clamp:
-    Opc = NVPTX::SULD_3D_V2I8_CLAMP_R;
-    break;
-  case NVPTXISD::Suld3DV2I16Clamp:
-    Opc = NVPTX::SULD_3D_V2I16_CLAMP_R;
-    break;
-  case NVPTXISD::Suld3DV2I32Clamp:
-    Opc = NVPTX::SULD_3D_V2I32_CLAMP_R;
-    break;
-  case NVPTXISD::Suld3DV2I64Clamp:
-    Opc = NVPTX::SULD_3D_V2I64_CLAMP_R;
-    break;
-  case NVPTXISD::Suld3DV4I8Clamp:
-    Opc = NVPTX::SULD_3D_V4I8_CLAMP_R;
-    break;
-  case NVPTXISD::Suld3DV4I16Clamp:
-    Opc = NVPTX::SULD_3D_V4I16_CLAMP_R;
-    break;
-  case NVPTXISD::Suld3DV4I32Clamp:
-    Opc = NVPTX::SULD_3D_V4I32_CLAMP_R;
-    break;
-  case NVPTXISD::Suld1DI8Trap:
-    Opc = NVPTX::SULD_1D_I8_TRAP_R;
-    break;
-  case NVPTXISD::Suld1DI16Trap:
-    Opc = NVPTX::SULD_1D_I16_TRAP_R;
-    break;
-  case NVPTXISD::Suld1DI32Trap:
-    Opc = NVPTX::SULD_1D_I32_TRAP_R;
-    break;
-  case NVPTXISD::Suld1DI64Trap:
-    Opc = NVPTX::SULD_1D_I64_TRAP_R;
-    break;
-  case NVPTXISD::Suld1DV2I8Trap:
-    Opc = NVPTX::SULD_1D_V2I8_TRAP_R;
-    break;
-  case NVPTXISD::Suld1DV2I16Trap:
-    Opc = NVPTX::SULD_1D_V2I16_TRAP_R;
-    break;
-  case NVPTXISD::Suld1DV2I32Trap:
-    Opc = NVPTX::SULD_1D_V2I32_TRAP_R;
-    break;
-  case NVPTXISD::Suld1DV2I64Trap:
-    Opc = NVPTX::SULD_1D_V2I64_TRAP_R;
-    break;
-  case NVPTXISD::Suld1DV4I8Trap:
-    Opc = NVPTX::SULD_1D_V4I8_TRAP_R;
-    break;
-  case NVPTXISD::Suld1DV4I16Trap:
-    Opc = NVPTX::SULD_1D_V4I16_TRAP_R;
-    break;
-  case NVPTXISD::Suld1DV4I32Trap:
-    Opc = NVPTX::SULD_1D_V4I32_TRAP_R;
-    break;
-  case NVPTXISD::Suld1DArrayI8Trap:
-    Opc = NVPTX::SULD_1D_ARRAY_I8_TRAP_R;
-    break;
-  case NVPTXISD::Suld1DArrayI16Trap:
-    Opc = NVPTX::SULD_1D_ARRAY_I16_TRAP_R;
-    break;
-  case NVPTXISD::Suld1DArrayI32Trap:
-    Opc = NVPTX::SULD_1D_ARRAY_I32_TRAP_R;
-    break;
-  case NVPTXISD::Suld1DArrayI64Trap:
-    Opc = NVPTX::SULD_1D_ARRAY_I64_TRAP_R;
-    break;
-  case NVPTXISD::Suld1DArrayV2I8Trap:
-    Opc = NVPTX::SULD_1D_ARRAY_V2I8_TRAP_R;
-    break;
-  case NVPTXISD::Suld1DArrayV2I16Trap:
-    Opc = NVPTX::SULD_1D_ARRAY_V2I16_TRAP_R;
-    break;
-  case NVPTXISD::Suld1DArrayV2I32Trap:
-    Opc = NVPTX::SULD_1D_ARRAY_V2I32_TRAP_R;
-    break;
-  case NVPTXISD::Suld1DArrayV2I64Trap:
-    Opc = NVPTX::SULD_1D_ARRAY_V2I64_TRAP_R;
-    break;
-  case NVPTXISD::Suld1DArrayV4I8Trap:
-    Opc = NVPTX::SULD_1D_ARRAY_V4I8_TRAP_R;
-    break;
-  case NVPTXISD::Suld1DArrayV4I16Trap:
-    Opc = NVPTX::SULD_1D_ARRAY_V4I16_TRAP_R;
-    break;
-  case NVPTXISD::Suld1DArrayV4I32Trap:
-    Opc = NVPTX::SULD_1D_ARRAY_V4I32_TRAP_R;
-    break;
-  case NVPTXISD::Suld2DI8Trap:
-    Opc = NVPTX::SULD_2D_I8_TRAP_R;
-    break;
-  case NVPTXISD::Suld2DI16Trap:
-    Opc = NVPTX::SULD_2D_I16_TRAP_R;
-    break;
-  case NVPTXISD::Suld2DI32Trap:
-    Opc = NVPTX::SULD_2D_I32_TRAP_R;
-    break;
-  case NVPTXISD::Suld2DI64Trap:
-    Opc = NVPTX::SULD_2D_I64_TRAP_R;
-    break;
-  case NVPTXISD::Suld2DV2I8Trap:
-    Opc = NVPTX::SULD_2D_V2I8_TRAP_R;
-    break;
-  case NVPTXISD::Suld2DV2I16Trap:
-    Opc = NVPTX::SULD_2D_V2I16_TRAP_R;
-    break;
-  case NVPTXISD::Suld2DV2I32Trap:
-    Opc = NVPTX::SULD_2D_V2I32_TRAP_R;
-    break;
-  case NVPTXISD::Suld2DV2I64Trap:
-    Opc = NVPTX::SULD_2D_V2I64_TRAP_R;
-    break;
-  case NVPTXISD::Suld2DV4I8Trap:
-    Opc = NVPTX::SULD_2D_V4I8_TRAP_R;
-    break;
-  case NVPTXISD::Suld2DV4I16Trap:
-    Opc = NVPTX::SULD_2D_V4I16_TRAP_R;
-    break;
-  case NVPTXISD::Suld2DV4I32Trap:
-    Opc = NVPTX::SULD_2D_V4I32_TRAP_R;
-    break;
-  case NVPTXISD::Suld2DArrayI8Trap:
-    Opc = NVPTX::SULD_2D_ARRAY_I8_TRAP_R;
-    break;
-  case NVPTXISD::Suld2DArrayI16Trap:
-    Opc = NVPTX::SULD_2D_ARRAY_I16_TRAP_R;
-    break;
-  case NVPTXISD::Suld2DArrayI32Trap:
-    Opc = NVPTX::SULD_2D_ARRAY_I32_TRAP_R;
-    break;
-  case NVPTXISD::Suld2DArrayI64Trap:
-    Opc = NVPTX::SULD_2D_ARRAY_I64_TRAP_R;
-    break;
-  case NVPTXISD::Suld2DArrayV2I8Trap:
-    Opc = NVPTX::SULD_2D_ARRAY_V2I8_TRAP_R;
-    break;
-  case NVPTXISD::Suld2DArrayV2I16Trap:
-    Opc = NVPTX::SULD_2D_ARRAY_V2I16_TRAP_R;
-    break;
-  case NVPTXISD::Suld2DArrayV2I32Trap:
-    Opc = NVPTX::SULD_2D_ARRAY_V2I32_TRAP_R;
-    break;
-  case NVPTXISD::Suld2DArrayV2I64Trap:
-    Opc = NVPTX::SULD_2D_ARRAY_V2I64_TRAP_R;
-    break;
-  case NVPTXISD::Suld2DArrayV4I8Trap:
-    Opc = NVPTX::SULD_2D_ARRAY_V4I8_TRAP_R;
-    break;
-  case NVPTXISD::Suld2DArrayV4I16Trap:
-    Opc = NVPTX::SULD_2D_ARRAY_V4I16_TRAP_R;
-    break;
-  case NVPTXISD::Suld2DArrayV4I32Trap:
-    Opc = NVPTX::SULD_2D_ARRAY_V4I32_TRAP_R;
-    break;
-  case NVPTXISD::Suld3DI8Trap:
-    Opc = NVPTX::SULD_3D_I8_TRAP_R;
-    break;
-  case NVPTXISD::Suld3DI16Trap:
-    Opc = NVPTX::SULD_3D_I16_TRAP_R;
-    break;
-  case NVPTXISD::Suld3DI32Trap:
-    Opc = NVPTX::SULD_3D_I32_TRAP_R;
-    break;
-  case NVPTXISD::Suld3DI64Trap:
-    Opc = NVPTX::SULD_3D_I64_TRAP_R;
-    break;
-  case NVPTXISD::Suld3DV2I8Trap:
-    Opc = NVPTX::SULD_3D_V2I8_TRAP_R;
-    break;
-  case NVPTXISD::Suld3DV2I16Trap:
-    Opc = NVPTX::SULD_3D_V2I16_TRAP_R;
-    break;
-  case NVPTXISD::Suld3DV2I32Trap:
-    Opc = NVPTX::SULD_3D_V2I32_TRAP_R;
-    break;
-  case NVPTXISD::Suld3DV2I64Trap:
-    Opc = NVPTX::SULD_3D_V2I64_TRAP_R;
-    break;
-  case NVPTXISD::Suld3DV4I8Trap:
-    Opc = NVPTX::SULD_3D_V4I8_TRAP_R;
-    break;
-  case NVPTXISD::Suld3DV4I16Trap:
-    Opc = NVPTX::SULD_3D_V4I16_TRAP_R;
-    break;
-  case NVPTXISD::Suld3DV4I32Trap:
-    Opc = NVPTX::SULD_3D_V4I32_TRAP_R;
-    break;
-  case NVPTXISD::Suld1DI8Zero:
-    Opc = NVPTX::SULD_1D_I8_ZERO_R;
-    break;
-  case NVPTXISD::Suld1DI16Zero:
-    Opc = NVPTX::SULD_1D_I16_ZERO_R;
-    break;
-  case NVPTXISD::Suld1DI32Zero:
-    Opc = NVPTX::SULD_1D_I32_ZERO_R;
-    break;
-  case NVPTXISD::Suld1DI64Zero:
-    Opc = NVPTX::SULD_1D_I64_ZERO_R;
-    break;
-  case NVPTXISD::Suld1DV2I8Zero:
-    Opc = NVPTX::SULD_1D_V2I8_ZERO_R;
-    break;
-  case NVPTXISD::Suld1DV2I16Zero:
-    Opc = NVPTX::SULD_1D_V2I16_ZERO_R;
-    break;
-  case NVPTXISD::Suld1DV2I32Zero:
-    Opc = NVPTX::SULD_1D_V2I32_ZERO_R;
-    break;
-  case NVPTXISD::Suld1DV2I64Zero:
-    Opc = NVPTX::SULD_1D_V2I64_ZERO_R;
-    break;
-  case NVPTXISD::Suld1DV4I8Zero:
-    Opc = NVPTX::SULD_1D_V4I8_ZERO_R;
-    break;
-  case NVPTXISD::Suld1DV4I16Zero:
-    Opc = NVPTX::SULD_1D_V4I16_ZERO_R;
-    break;
-  case NVPTXISD::Suld1DV4I32Zero:
-    Opc = NVPTX::SULD_1D_V4I32_ZERO_R;
-    break;
-  case NVPTXISD::Suld1DArrayI8Zero:
-    Opc = NVPTX::SULD_1D_ARRAY_I8_ZERO_R;
-    break;
-  case NVPTXISD::Suld1DArrayI16Zero:
-    Opc = NVPTX::SULD_1D_ARRAY_I16_ZERO_R;
-    break;
-  case NVPTXISD::Suld1DArrayI32Zero:
-    Opc = NVPTX::SULD_1D_ARRAY_I32_ZERO_R;
-    break;
-  case NVPTXISD::Suld1DArrayI64Zero:
-    Opc = NVPTX::SULD_1D_ARRAY_I64_ZERO_R;
-    break;
-  case NVPTXISD::Suld1DArrayV2I8Zero:
-    Opc = NVPTX::SULD_1D_ARRAY_V2I8_ZERO_R;
-    break;
-  case NVPTXISD::Suld1DArrayV2I16Zero:
-    Opc = NVPTX::SULD_1D_ARRAY_V2I16_ZERO_R;
-    break;
-  case NVPTXISD::Suld1DArrayV2I32Zero:
-    Opc = NVPTX::SULD_1D_ARRAY_V2I32_ZERO_R;
-    break;
-  case NVPTXISD::Suld1DArrayV2I64Zero:
-    Opc = NVPTX::SULD_1D_ARRAY_V2I64_ZERO_R;
-    break;
-  case NVPTXISD::Suld1DArrayV4I8Zero:
-    Opc = NVPTX::SULD_1D_ARRAY_V4I8_ZERO_R;
-    break;
-  case NVPTXISD::Suld1DArrayV4I16Zero:
-    Opc = NVPTX::SULD_1D_ARRAY_V4I16_ZERO_R;
-    break;
-  case NVPTXISD::Suld1DArrayV4I32Zero:
-    Opc = NVPTX::SULD_1D_ARRAY_V4I32_ZERO_R;
-    break;
-  case NVPTXISD::Suld2DI8Zero:
-    Opc = NVPTX::SULD_2D_I8_ZERO_R;
-    break;
-  case NVPTXISD::Suld2DI16Zero:
-    Opc = NVPTX::SULD_2D_I16_ZERO_R;
-    break;
-  case NVPTXISD::Suld2DI32Zero:
-    Opc = NVPTX::SULD_2D_I32_ZERO_R;
-    break;
-  case NVPTXISD::Suld2DI64Zero:
-    Opc = NVPTX::SULD_2D_I64_ZERO_R;
-    break;
-  case NVPTXISD::Suld2DV2I8Zero:
-    Opc = NVPTX::SULD_2D_V2I8_ZERO_R;
-    break;
-  case NVPTXISD::Suld2DV2I16Zero:
-    Opc = NVPTX::SULD_2D_V2I16_ZERO_R;
-    break;
-  case NVPTXISD::Suld2DV2I32Zero:
-    Opc = NVPTX::SULD_2D_V2I32_ZERO_R;
-    break;
-  case NVPTXISD::Suld2DV2I64Zero:
-    Opc = NVPTX::SULD_2D_V2I64_ZERO_R;
-    break;
-  case NVPTXISD::Suld2DV4I8Zero:
-    Opc = NVPTX::SULD_2D_V4I8_ZERO_R;
-    break;
-  case NVPTXISD::Suld2DV4I16Zero:
-    Opc = NVPTX::SULD_2D_V4I16_ZERO_R;
-    break;
-  case NVPTXISD::Suld2DV4I32Zero:
-    Opc = NVPTX::SULD_2D_V4I32_ZERO_R;
-    break;
-  case NVPTXISD::Suld2DArrayI8Zero:
-    Opc = NVPTX::SULD_2D_ARRAY_I8_ZERO_R;
-    break;
-  case NVPTXISD::Suld2DArrayI16Zero:
-    Opc = NVPTX::SULD_2D_ARRAY_I16_ZERO_R;
-    break;
-  case NVPTXISD::Suld2DArrayI32Zero:
-    Opc = NVPTX::SULD_2D_ARRAY_I32_ZERO_R;
-    break;
-  case NVPTXISD::Suld2DArrayI64Zero:
-    Opc = NVPTX::SULD_2D_ARRAY_I64_ZERO_R;
-    break;
-  case NVPTXISD::Suld2DArrayV2I8Zero:
-    Opc = NVPTX::SULD_2D_ARRAY_V2I8_ZERO_R;
-    break;
-  case NVPTXISD::Suld2DArrayV2I16Zero:
-    Opc = NVPTX::SULD_2D_ARRAY_V2I16_ZERO_R;
-    break;
-  case NVPTXISD::Suld2DArrayV2I32Zero:
-    Opc = NVPTX::SULD_2D_ARRAY_V2I32_ZERO_R;
-    break;
-  case NVPTXISD::Suld2DArrayV2I64Zero:
-    Opc = NVPTX::SULD_2D_ARRAY_V2I64_ZERO_R;
-    break;
-  case NVPTXISD::Suld2DArrayV4I8Zero:
-    Opc = NVPTX::SULD_2D_ARRAY_V4I8_ZERO_R;
-    break;
-  case NVPTXISD::Suld2DArrayV4I16Zero:
-    Opc = NVPTX::SULD_2D_ARRAY_V4I16_ZERO_R;
-    break;
-  case NVPTXISD::Suld2DArrayV4I32Zero:
-    Opc = NVPTX::SULD_2D_ARRAY_V4I32_ZERO_R;
-    break;
-  case NVPTXISD::Suld3DI8Zero:
-    Opc = NVPTX::SULD_3D_I8_ZERO_R;
-    break;
-  case NVPTXISD::Suld3DI16Zero:
-    Opc = NVPTX::SULD_3D_I16_ZERO_R;
-    break;
-  case NVPTXISD::Suld3DI32Zero:
-    Opc = NVPTX::SULD_3D_I32_ZERO_R;
-    break;
-  case NVPTXISD::Suld3DI64Zero:
-    Opc = NVPTX::SULD_3D_I64_ZERO_R;
-    break;
-  case NVPTXISD::Suld3DV2I8Zero:
-    Opc = NVPTX::SULD_3D_V2I8_ZERO_R;
-    break;
-  case NVPTXISD::Suld3DV2I16Zero:
-    Opc = NVPTX::SULD_3D_V2I16_ZERO_R;
-    break;
-  case NVPTXISD::Suld3DV2I32Zero:
-    Opc = NVPTX::SULD_3D_V2I32_ZERO_R;
-    break;
-  case NVPTXISD::Suld3DV2I64Zero:
-    Opc = NVPTX::SULD_3D_V2I64_ZERO_R;
-    break;
-  case NVPTXISD::Suld3DV4I8Zero:
-    Opc = NVPTX::SULD_3D_V4I8_ZERO_R;
-    break;
-  case NVPTXISD::Suld3DV4I16Zero:
-    Opc = NVPTX::SULD_3D_V4I16_ZERO_R;
-    break;
-  case NVPTXISD::Suld3DV4I32Zero:
-    Opc = NVPTX::SULD_3D_V4I32_ZERO_R;
-    break;
-  }
-
-  // Copy over operands
-  SmallVector<SDValue, 8> Ops(drop_begin(N->ops()));
-  Ops.push_back(N->getOperand(0)); // Move chain to the back.
-
-  ReplaceNode(N, CurDAG->getMachineNode(Opc, SDLoc(N), N->getVTList(), Ops));
-  return true;
-}
-
-
 /// SelectBFE - Look for instruction sequences that can be made more efficient
 /// by using the 'bfe' (bit-field extract) PTX instruction
 bool NVPTXDAGToDAGISel::tryBFE(SDNode *N) {
diff --git a/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.h b/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.h
index 8cc270a6829009..c307f28fcc6c0a 100644
--- a/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.h
+++ b/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.h
@@ -83,8 +83,6 @@ class LLVM_LIBRARY_VISIBILITY NVPTXDAGToDAGISel : public SelectionDAGISel {
   bool tryStoreParam(SDNode *N);
   bool tryFence(SDNode *N);
   void SelectAddrSpaceCast(SDNode *N);
-  bool tryTextureIntrinsic(SDNode *N);
-  bool trySurfaceIntrinsic(SDNode *N);
   bool tryBFE(SDNode *N);
   bool tryConstantFP(SDNode *N);
   bool SelectSETP_F16X2(SDNode *N);
diff --git a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
index ce94dded815b8f..a02607efb7fc28 100644
--- a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
+++ b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
@@ -990,361 +990,6 @@ const char *NVPTXTargetLowering::getTargetNodeName(unsigned Opcode) const {
     MAKE_CASE(NVPTXISD::BrxEnd)
     MAKE_CASE(NVPTXISD::BrxItem)
     MAKE_CASE(NVPTXISD::BrxStart)
-    MAKE_CASE(NVPTXISD::Tex1DFloatS32)
-    MAKE_CASE(NVPTXISD::Tex1DFloatFloat)
-    MAKE_CASE(NVPTXISD::Tex1DFloatFloatLevel)
-    MAKE_CASE(NVPTXISD::Tex1DFloatFloatGrad)
-    MAKE_CASE(NVPTXISD::Tex1DS32S32)
-    MAKE_CASE(NVPTXISD::Tex1DS32Float)
-    MAKE_CASE(NVPTXISD::Tex1DS32FloatLevel)
-    MAKE_CASE(NVPTXISD::Tex1DS32FloatGrad)
-    MAKE_CASE(NVPTXISD::Tex1DU32S32)
-    MAKE_CASE(NVPTXISD::Tex1DU32Float)
-    MAKE_CASE(NVPTXISD::Tex1DU32FloatLevel)
-    MAKE_CASE(NVPTXISD::Tex1DU32FloatGrad)
-    MAKE_CASE(NVPTXISD::Tex1DArrayFloatS32)
-    MAKE_CASE(NVPTXISD::Tex1DArrayFloatFloat)
-    MAKE_CASE(NVPTXISD::Tex1DArrayFloatFloatLevel)
-    MAKE_CASE(NVPTXISD::Tex1DArrayFloatFloatGrad)
-    MAKE_CASE(NVPTXISD::Tex1DArrayS32S32)
-    MAKE_CASE(NVPTXISD::Tex1DArrayS32Float)
-    MAKE_CASE(NVPTXISD::Tex1DArrayS32FloatLevel)
-    MAKE_CASE(NVPTXISD::Tex1DArrayS32FloatGrad)
-    MAKE_CASE(NVPTXISD::Tex1DArrayU32S32)
-    MAKE_CASE(NVPTXISD::Tex1DArrayU32Float)
-    MAKE_CASE(NVPTXISD::Tex1DArrayU32FloatLevel)
-    MAKE_CASE(NVPTXISD::Tex1DArrayU32FloatGrad)
-    MAKE_CASE(NVPTXISD::Tex2DFloatS32)
-    MAKE_CASE(NVPTXISD::Tex2DFloatFloat)
-    MAKE_CASE(NVPTXISD::Tex2DFloatFloatLevel)
-    MAKE_CASE(NVPTXISD::Tex2DFloatFloatGrad)
-    MAKE_CASE(NVPTXISD::Tex2DS32S32)
-    MAKE_CASE(NVPTXISD::Tex2DS32Float)
-    MAKE_CASE(NVPTXISD::Tex2DS32FloatLevel)
-    MAKE_CASE(NVPTXISD::Tex2DS32FloatGrad)
-    MAKE_CASE(NVPTXISD::Tex2DU32S32)
-    MAKE_CASE(NVPTXISD::Tex2DU32Float)
-    MAKE_CASE(NVPTXISD::Tex2DU32FloatLevel)
-    MAKE_CASE(NVPTXISD::Tex2DU32FloatGrad)
-    MAKE_CASE(NVPTXISD::Tex2DArrayFloatS32)
-    MAKE_CASE(NVPTXISD::Tex2DArrayFloatFloat)
-    MAKE_CASE(NVPTXISD::Tex2DArrayFloatFloatLevel)
-    MAKE_CASE(NVPTXISD::Tex2DArrayFloatFloatGrad)
-    MAKE_CASE(NVPTXISD::Tex2DArrayS32S32)
-    MAKE_CASE(NVPTXISD::Tex2DArrayS32Float)
-    MAKE_CASE(NVPTXISD::Tex2DArrayS32FloatLevel)
-    MAKE_CASE(NVPTXISD::Tex2DArrayS32FloatGrad)
-    MAKE_CASE(NVPTXISD::Tex2DArrayU32S32)
-    MAKE_CASE(NVPTXISD::Tex2DArrayU32Float)
-    MAKE_CASE(NVPTXISD::Tex2DArrayU32FloatLevel)
-    MAKE_CASE(NVPTXISD::Tex2DArrayU32FloatGrad)
-    MAKE_CASE(NVPTXISD::Tex3DFloatS32)
-    MAKE_CASE(NVPTXISD::Tex3DFloatFloat)
-    MAKE_CASE(NVPTXISD::Tex3DFloatFloatLevel)
-    MAKE_CASE(NVPTXISD::Tex3DFloatFloatGrad)
-    MAKE_CASE(NVPTXISD::Tex3DS32S32)
-    MAKE_CASE(NVPTXISD::Tex3DS32Float)
-    MAKE_CASE(NVPTXISD::Tex3DS32FloatLevel)
-    MAKE_CASE(NVPTXISD::Tex3DS32FloatGrad)
-    MAKE_CASE(NVPTXISD::Tex3DU32S32)
-    MAKE_CASE(NVPTXISD::Tex3DU32Float)
-    MAKE_CASE(NVPTXISD::Tex3DU32FloatLevel)
-    MAKE_CASE(NVPTXISD::Tex3DU32FloatGrad)
-    MAKE_CASE(NVPTXISD::TexCubeFloatFloat)
-    MAKE_CASE(NVPTXISD::TexCubeFloatFloatLevel)
-    MAKE_CASE(NVPTXISD::TexCubeS32Float)
-    MAKE_CASE(NVPTXISD::TexCubeS32FloatLevel)
-    MAKE_CASE(NVPTXISD::TexCubeU32Float)
-    MAKE_CASE(NVPTXISD::TexCubeU32FloatLevel)
-    MAKE_CASE(NVPTXISD::TexCubeArrayFloatFloat)
-    MAKE_CASE(NVPTXISD::TexCubeArrayFloatFloatLevel)
-    MAKE_CASE(NVPTXISD::TexCubeArrayS32Float)
-    MAKE_CASE(NVPTXISD::TexCubeArrayS32FloatLevel)
-    MAKE_CASE(NVPTXISD::TexCubeArrayU32Float)
-    MAKE_CASE(NVPTXISD::TexCubeArrayU32FloatLevel)
-    MAKE_CASE(NVPTXISD::Tld4R2DFloatFloat)
-    MAKE_CASE(NVPTXISD::Tld4G2DFloatFloat)
-    MAKE_CASE(NVPTXISD::Tld4B2DFloatFloat)
-    MAKE_CASE(NVPTXISD::Tld4A2DFloatFloat)
-    MAKE_CASE(NVPTXISD::Tld4R2DS64Float)
-    MAKE_CASE(NVPTXISD::Tld4G2DS64Float)
-    MAKE_CASE(NVPTXISD::Tld4B2DS64Float)
-    MAKE_CASE(NVPTXISD::Tld4A2DS64Float)
-    MAKE_CASE(NVPTXISD::Tld4R2DU64Float)
-    MAKE_CASE(NVPTXISD::Tld4G2DU64Float)
-    MAKE_CASE(NVPTXISD::Tld4B2DU64Float)
-    MAKE_CASE(NVPTXISD::Tld4A2DU64Float)
-
-    MAKE_CASE(NVPTXISD::TexUnified1DFloatS32)
-    MAKE_CASE(NVPTXISD::TexUnified1DFloatFloat)
-    MAKE_CASE(NVPTXISD::TexUnified1DFloatFloatLevel)
-    MAKE_CASE(NVPTXISD::TexUnified1DFloatFloatGrad)
-    MAKE_CASE(NVPTXISD::TexUnified1DS32S32)
-    MAKE_CASE(NVPTXISD::TexUnified1DS32Float)
-    MAKE_CASE(NVPTXISD::TexUnified1DS32FloatLevel)
-    MAKE_CASE(NVPTXISD::TexUnified1DS32FloatGrad)
-    MAKE_CASE(NVPTXISD::TexUnified1DU32S32)
-    MAKE_CASE(NVPTXISD::TexUnified1DU32Float)
-    MAKE_CASE(NVPTXISD::TexUnified1DU32FloatLevel)
-    MAKE_CASE(NVPTXISD::TexUnified1DU32FloatGrad)
-    MAKE_CASE(NVPTXISD::TexUnified1DArrayFloatS32)
-    MAKE_CASE(NVPTXISD::TexUnified1DArrayFloatFloat)
-    MAKE_CASE(NVPTXISD::TexUnified1DArrayFloatFloatLevel)
-    MAKE_CASE(NVPTXISD::TexUnified1DArrayFloatFloatGrad)
-    MAKE_CASE(NVPTXISD::TexUnified1DArrayS32S32)
-    MAKE_CASE(NVPTXISD::TexUnified1DArrayS32Float)
-    MAKE_CASE(NVPTXISD::TexUnified1DArrayS32FloatLevel)
-    MAKE_CASE(NVPTXISD::TexUnified1DArrayS32FloatGrad)
-    MAKE_CASE(NVPTXISD::TexUnified1DArrayU32S32)
-    MAKE_CASE(NVPTXISD::TexUnified1DArrayU32Float)
-    MAKE_CASE(NVPTXISD::TexUnified1DArrayU32FloatLevel)
-    MAKE_CASE(NVPTXISD::TexUnified1DArrayU32FloatGrad)
-    MAKE_CASE(NVPTXISD::TexUnified2DFloatS32)
-    MAKE_CASE(NVPTXISD::TexUnified2DFloatFloat)
-    MAKE_CASE(NVPTXISD::TexUnified2DFloatFloatLevel)
-    MAKE_CASE(NVPTXISD::TexUnified2DFloatFloatGrad)
-    MAKE_CASE(NVPTXISD::TexUnified2DS32S32)
-    MAKE_CASE(NVPTXISD::TexUnified2DS32Float)
-    MAKE_CASE(NVPTXISD::TexUnified2DS32FloatLevel)
-    MAKE_CASE(NVPTXISD::TexUnified2DS32FloatGrad)
-    MAKE_CASE(NVPTXISD::TexUnified2DU32S32)
-    MAKE_CASE(NVPTXISD::TexUnified2DU32Float)
-    MAKE_CASE(NVPTXISD::TexUnified2DU32FloatLevel)
-    MAKE_CASE(NVPTXISD::TexUnified2DU32FloatGrad)
-    MAKE_CASE(NVPTXISD::TexUnified2DArrayFloatS32)
-    MAKE_CASE(NVPTXISD::TexUnified2DArrayFloatFloat)
-    MAKE_CASE(NVPTXISD::TexUnified2DArrayFloatFloatLevel)
-    MAKE_CASE(NVPTXISD::TexUnified2DArrayFloatFloatGrad)
-    MAKE_CASE(NVPTXISD::TexUnified2DArrayS32S32)
-    MAKE_CASE(NVPTXISD::TexUnified2DArrayS32Float)
-    MAKE_CASE(NVPTXISD::TexUnified2DArrayS32FloatLevel)
-    MAKE_CASE(NVPTXISD::TexUnified2DArrayS32FloatGrad)
-    MAKE_CASE(NVPTXISD::TexUnified2DArrayU32S32)
-    MAKE_CASE(NVPTXISD::TexUnified2DArrayU32Float)
-    MAKE_CASE(NVPTXISD::TexUnified2DArrayU32FloatLevel)
-    MAKE_CASE(NVPTXISD::TexUnified2DArrayU32FloatGrad)
-    MAKE_CASE(NVPTXISD::TexUnified3DFloatS32)
-    MAKE_CASE(NVPTXISD::TexUnified3DFloatFloat)
-    MAKE_CASE(NVPTXISD::TexUnified3DFloatFloatLevel)
-    MAKE_CASE(NVPTXISD::TexUnified3DFloatFloatGrad)
-    MAKE_CASE(NVPTXISD::TexUnified3DS32S32)
-    MAKE_CASE(NVPTXISD::TexUnified3DS32Float)
-    MAKE_CASE(NVPTXISD::TexUnified3DS32FloatLevel)
-    MAKE_CASE(NVPTXISD::TexUnified3DS32FloatGrad)
-    MAKE_CASE(NVPTXISD::TexUnified3DU32S32)
-    MAKE_CASE(NVPTXISD::TexUnified3DU32Float)
-    MAKE_CASE(NVPTXISD::TexUnified3DU32FloatLevel)
-    MAKE_CASE(NVPTXISD::TexUnified3DU32FloatGrad)
-    MAKE_CASE(NVPTXISD::TexUnifiedCubeFloatFloat)
-    MAKE_CASE(NVPTXISD::TexUnifiedCubeFloatFloatLevel)
-    MAKE_CASE(NVPTXISD::TexUnifiedCubeS32Float)
-    MAKE_CASE(NVPTXISD::TexUnifiedCubeS32FloatLevel)
-    MAKE_CASE(NVPTXISD::TexUnifiedCubeU32Float)
-    MAKE_CASE(NVPTXISD::TexUnifiedCubeU32FloatLevel)
-    MAKE_CASE(NVPTXISD::TexUnifiedCubeArrayFloatFloat)
-    MAKE_CASE(NVPTXISD::TexUnifiedCubeArrayFloatFloatLevel)
-    MAKE_CASE(NVPTXISD::TexUnifiedCubeArrayS32Float)
-    MAKE_CASE(NVPTXISD::TexUnifiedCubeArrayS32FloatLevel)
-    MAKE_CASE(NVPTXISD::TexUnifiedCubeArrayU32Float)
-    MAKE_CASE(NVPTXISD::TexUnifiedCubeArrayU32FloatLevel)
-    MAKE_CASE(NVPTXISD::TexUnifiedCubeFloatFloatGrad)
-    MAKE_CASE(NVPTXISD::TexUnifiedCubeS32FloatGrad)
-    MAKE_CASE(NVPTXISD::TexUnifiedCubeU32FloatGrad)
-    MAKE_CASE(NVPTXISD::TexUnifiedCubeArrayFloatFloatGrad)
-    MAKE_CASE(NVPTXISD::TexUnifiedCubeArrayS32FloatGrad)
-    MAKE_CASE(NVPTXISD::TexUnifiedCubeArrayU32FloatGrad)
-    MAKE_CASE(NVPTXISD::Tld4UnifiedR2DFloatFloat)
-    MAKE_CASE(NVPTXISD::Tld4UnifiedG2DFloatFloat)
-    MAKE_CASE(NVPTXISD::Tld4UnifiedB2DFloatFloat)
-    MAKE_CASE(NVPTXISD::Tld4UnifiedA2DFloatFloat)
-    MAKE_CASE(NVPTXISD::Tld4UnifiedR2DS64Float)
-    MAKE_CASE(NVPTXISD::Tld4UnifiedG2DS64Float)
-    MAKE_CASE(NVPTXISD::Tld4UnifiedB2DS64Float)
-    MAKE_CASE(NVPTXISD::Tld4UnifiedA2DS64Float)
-    MAKE_CASE(NVPTXISD::Tld4UnifiedR2DU64Float)
-    MAKE_CASE(NVPTXISD::Tld4UnifiedG2DU64Float)
-    MAKE_CASE(NVPTXISD::Tld4UnifiedB2DU64Float)
-    MAKE_CASE(NVPTXISD::Tld4UnifiedA2DU64Float)
-
-    MAKE_CASE(NVPTXISD::Suld1DI8Clamp)
-    MAKE_CASE(NVPTXISD::Suld1DI16Clamp)
-    MAKE_CASE(NVPTXISD::Suld1DI32Clamp)
-    MAKE_CASE(NVPTXISD::Suld1DI64Clamp)
-    MAKE_CASE(NVPTXISD::Suld1DV2I8Clamp)
-    MAKE_CASE(NVPTXISD::Suld1DV2I16Clamp)
-    MAKE_CASE(NVPTXISD::Suld1DV2I32Clamp)
-    MAKE_CASE(NVPTXISD::Suld1DV2I64Clamp)
-    MAKE_CASE(NVPTXISD::Suld1DV4I8Clamp)
-    MAKE_CASE(NVPTXISD::Suld1DV4I16Clamp)
-    MAKE_CASE(NVPTXISD::Suld1DV4I32Clamp)
-
-    MAKE_CASE(NVPTXISD::Suld1DArrayI8Clamp)
-    MAKE_CASE(NVPTXISD::Suld1DArrayI16Clamp)
-    MAKE_CASE(NVPTXISD::Suld1DArrayI32Clamp)
-    MAKE_CASE(NVPTXISD::Suld1DArrayI64Clamp)
-    MAKE_CASE(NVPTXISD::Suld1DArrayV2I8Clamp)
-    MAKE_CASE(NVPTXISD::Suld1DArrayV2I16Clamp)
-    MAKE_CASE(NVPTXISD::Suld1DArrayV2I32Clamp)
-    MAKE_CASE(NVPTXISD::Suld1DArrayV2I64Clamp)
-    MAKE_CASE(NVPTXISD::Suld1DArrayV4I8Clamp)
-    MAKE_CASE(NVPTXISD::Suld1DArrayV4I16Clamp)
-    MAKE_CASE(NVPTXISD::Suld1DArrayV4I32Clamp)
-
-    MAKE_CASE(NVPTXISD::Suld2DI8Clamp)
-    MAKE_CASE(NVPTXISD::Suld2DI16Clamp)
-    MAKE_CASE(NVPTXISD::Suld2DI32Clamp)
-    MAKE_CASE(NVPTXISD::Suld2DI64Clamp)
-    MAKE_CASE(NVPTXISD::Suld2DV2I8Clamp)
-    MAKE_CASE(NVPTXISD::Suld2DV2I16Clamp)
-    MAKE_CASE(NVPTXISD::Suld2DV2I32Clamp)
-    MAKE_CASE(NVPTXISD::Suld2DV2I64Clamp)
-    MAKE_CASE(NVPTXISD::Suld2DV4I8Clamp)
-    MAKE_CASE(NVPTXISD::Suld2DV4I16Clamp)
-    MAKE_CASE(NVPTXISD::Suld2DV4I32Clamp)
-
-    MAKE_CASE(NVPTXISD::Suld2DArrayI8Clamp)
-    MAKE_CASE(NVPTXISD::Suld2DArrayI16Clamp)
-    MAKE_CASE(NVPTXISD::Suld2DArrayI32Clamp)
-    MAKE_CASE(NVPTXISD::Suld2DArrayI64Clamp)
-    MAKE_CASE(NVPTXISD::Suld2DArrayV2I8Clamp)
-    MAKE_CASE(NVPTXISD::Suld2DArrayV2I16Clamp)
-    MAKE_CASE(NVPTXISD::Suld2DArrayV2I32Clamp)
-    MAKE_CASE(NVPTXISD::Suld2DArrayV2I64Clamp)
-    MAKE_CASE(NVPTXISD::Suld2DArrayV4I8Clamp)
-    MAKE_CASE(NVPTXISD::Suld2DArrayV4I16Clamp)
-    MAKE_CASE(NVPTXISD::Suld2DArrayV4I32Clamp)
-
-    MAKE_CASE(NVPTXISD::Suld3DI8Clamp)
-    MAKE_CASE(NVPTXISD::Suld3DI16Clamp)
-    MAKE_CASE(NVPTXISD::Suld3DI32Clamp)
-    MAKE_CASE(NVPTXISD::Suld3DI64Clamp)
-    MAKE_CASE(NVPTXISD::Suld3DV2I8Clamp)
-    MAKE_CASE(NVPTXISD::Suld3DV2I16Clamp)
-    MAKE_CASE(NVPTXISD::Suld3DV2I32Clamp)
-    MAKE_CASE(NVPTXISD::Suld3DV2I64Clamp)
-    MAKE_CASE(NVPTXISD::Suld3DV4I8Clamp)
-    MAKE_CASE(NVPTXISD::Suld3DV4I16Clamp)
-    MAKE_CASE(NVPTXISD::Suld3DV4I32Clamp)
-
-    MAKE_CASE(NVPTXISD::Suld1DI8Trap)
-    MAKE_CASE(NVPTXISD::Suld1DI16Trap)
-    MAKE_CASE(NVPTXISD::Suld1DI32Trap)
-    MAKE_CASE(NVPTXISD::Suld1DI64Trap)
-    MAKE_CASE(NVPTXISD::Suld1DV2I8Trap)
-    MAKE_CASE(NVPTXISD::Suld1DV2I16Trap)
-    MAKE_CASE(NVPTXISD::Suld1DV2I32Trap)
-    MAKE_CASE(NVPTXISD::Suld1DV2I64Trap)
-    MAKE_CASE(NVPTXISD::Suld1DV4I8Trap)
-    MAKE_CASE(NVPTXISD::Suld1DV4I16Trap)
-    MAKE_CASE(NVPTXISD::Suld1DV4I32Trap)
-
-    MAKE_CASE(NVPTXISD::Suld1DArrayI8Trap)
-    MAKE_CASE(NVPTXISD::Suld1DArrayI16Trap)
-    MAKE_CASE(NVPTXISD::Suld1DArrayI32Trap)
-    MAKE_CASE(NVPTXISD::Suld1DArrayI64Trap)
-    MAKE_CASE(NVPTXISD::Suld1DArrayV2I8Trap)
-    MAKE_CASE(NVPTXISD::Suld1DArrayV2I16Trap)
-    MAKE_CASE(NVPTXISD::Suld1DArrayV2I32Trap)
-    MAKE_CASE(NVPTXISD::Suld1DArrayV2I64Trap)
-    MAKE_CASE(NVPTXISD::Suld1DArrayV4I8Trap)
-    MAKE_CASE(NVPTXISD::Suld1DArrayV4I16Trap)
-    MAKE_CASE(NVPTXISD::Suld1DArrayV4I32Trap)
-
-    MAKE_CASE(NVPTXISD::Suld2DI8Trap)
-    MAKE_CASE(NVPTXISD::Suld2DI16Trap)
-    MAKE_CASE(NVPTXISD::Suld2DI32Trap)
-    MAKE_CASE(NVPTXISD::Suld2DI64Trap)
-    MAKE_CASE(NVPTXISD::Suld2DV2I8Trap)
-    MAKE_CASE(NVPTXISD::Suld2DV2I16Trap)
-    MAKE_CASE(NVPTXISD::Suld2DV2I32Trap)
-    MAKE_CASE(NVPTXISD::Suld2DV2I64Trap)
-    MAKE_CASE(NVPTXISD::Suld2DV4I8Trap)
-    MAKE_CASE(NVPTXISD::Suld2DV4I16Trap)
-    MAKE_CASE(NVPTXISD::Suld2DV4I32Trap)
-
-    MAKE_CASE(NVPTXISD::Suld2DArrayI8Trap)
-    MAKE_CASE(NVPTXISD::Suld2DArrayI16Trap)
-    MAKE_CASE(NVPTXISD::Suld2DArrayI32Trap)
-    MAKE_CASE(NVPTXISD::Suld2DArrayI64Trap)
-    MAKE_CASE(NVPTXISD::Suld2DArrayV2I8Trap)
-    MAKE_CASE(NVPTXISD::Suld2DArrayV2I16Trap)
-    MAKE_CASE(NVPTXISD::Suld2DArrayV2I32Trap)
-    MAKE_CASE(NVPTXISD::Suld2DArrayV2I64Trap)
-    MAKE_CASE(NVPTXISD::Suld2DArrayV4I8Trap)
-    MAKE_CASE(NVPTXISD::Suld2DArrayV4I16Trap)
-    MAKE_CASE(NVPTXISD::Suld2DArrayV4I32Trap)
-
-    MAKE_CASE(NVPTXISD::Suld3DI8Trap)
-    MAKE_CASE(NVPTXISD::Suld3DI16Trap)
-    MAKE_CASE(NVPTXISD::Suld3DI32Trap)
-    MAKE_CASE(NVPTXISD::Suld3DI64Trap)
-    MAKE_CASE(NVPTXISD::Suld3DV2I8Trap)
-    MAKE_CASE(NVPTXISD::Suld3DV2I16Trap)
-    MAKE_CASE(NVPTXISD::Suld3DV2I32Trap)
-    MAKE_CASE(NVPTXISD::Suld3DV2I64Trap)
-    MAKE_CASE(NVPTXISD::Suld3DV4I8Trap)
-    MAKE_CASE(NVPTXISD::Suld3DV4I16Trap)
-    MAKE_CASE(NVPTXISD::Suld3DV4I32Trap)
-
-    MAKE_CASE(NVPTXISD::Suld1DI8Zero)
-    MAKE_CASE(NVPTXISD::Suld1DI16Zero)
-    MAKE_CASE(NVPTXISD::Suld1DI32Zero)
-    MAKE_CASE(NVPTXISD::Suld1DI64Zero)
-    MAKE_CASE(NVPTXISD::Suld1DV2I8Zero)
-    MAKE_CASE(NVPTXISD::Suld1DV2I16Zero)
-    MAKE_CASE(NVPTXISD::Suld1DV2I32Zero)
-    MAKE_CASE(NVPTXISD::Suld1DV2I64Zero)
-    MAKE_CASE(NVPTXISD::Suld1DV4I8Zero)
-    MAKE_CASE(NVPTXISD::Suld1DV4I16Zero)
-    MAKE_CASE(NVPTXISD::Suld1DV4I32Zero)
-
-    MAKE_CASE(NVPTXISD::Suld1DArrayI8Zero)
-    MAKE_CASE(NVPTXISD::Suld1DArrayI16Zero)
-    MAKE_CASE(NVPTXISD::Suld1DArrayI32Zero)
-    MAKE_CASE(NVPTXISD::Suld1DArrayI64Zero)
-    MAKE_CASE(NVPTXISD::Suld1DArrayV2I8Zero)
-    MAKE_CASE(NVPTXISD::Suld1DArrayV2I16Zero)
-    MAKE_CASE(NVPTXISD::Suld1DArrayV2I32Zero)
-    MAKE_CASE(NVPTXISD::Suld1DArrayV2I64Zero)
-    MAKE_CASE(NVPTXISD::Suld1DArrayV4I8Zero)
-    MAKE_CASE(NVPTXISD::Suld1DArrayV4I16Zero)
-    MAKE_CASE(NVPTXISD::Suld1DArrayV4I32Zero)
-
-    MAKE_CASE(NVPTXISD::Suld2DI8Zero)
-    MAKE_CASE(NVPTXISD::Suld2DI16Zero)
-    MAKE_CASE(NVPTXISD::Suld2DI32Zero)
-    MAKE_CASE(NVPTXISD::Suld2DI64Zero)
-    MAKE_CASE(NVPTXISD::Suld2DV2I8Zero)
-    MAKE_CASE(NVPTXISD::Suld2DV2I16Zero)
-    MAKE_CASE(NVPTXISD::Suld2DV2I32Zero)
-    MAKE_CASE(NVPTXISD::Suld2DV2I64Zero)
-    MAKE_CASE(NVPTXISD::Suld2DV4I8Zero)
-    MAKE_CASE(NVPTXISD::Suld2DV4I16Zero)
-    MAKE_CASE(NVPTXISD::Suld2DV4I32Zero)
-
-    MAKE_CASE(NVPTXISD::Suld2DArrayI8Zero)
-    MAKE_CASE(NVPTXISD::Suld2DArrayI16Zero)
-    MAKE_CASE(NVPTXISD::Suld2DArrayI32Zero)
-    MAKE_CASE(NVPTXISD::Suld2DArrayI64Zero)
-    MAKE_CASE(NVPTXISD::Suld2DArrayV2I8Zero)
-    MAKE_CASE(NVPTXISD::Suld2DArrayV2I16Zero)
-    MAKE_CASE(NVPTXISD::Suld2DArrayV2I32Zero)
-    MAKE_CASE(NVPTXISD::Suld2DArrayV2I64Zero)
-    MAKE_CASE(NVPTXISD::Suld2DArrayV4I8Zero)
-    MAKE_CASE(NVPTXISD::Suld2DArrayV4I16Zero)
-    MAKE_CASE(NVPTXISD::Suld2DArrayV4I32Zero)
-
-    MAKE_CASE(NVPTXISD::Suld3DI8Zero)
-    MAKE_CASE(NVPTXISD::Suld3DI16Zero)
-    MAKE_CASE(NVPTXISD::Suld3DI32Zero)
-    MAKE_CASE(NVPTXISD::Suld3DI64Zero)
-    MAKE_CASE(NVPTXISD::Suld3DV2I8Zero)
-    MAKE_CASE(NVPTXISD::Suld3DV2I16Zero)
-    MAKE_CASE(NVPTXISD::Suld3DV2I32Zero)
-    MAKE_CASE(NVPTXISD::Suld3DV2I64Zero)
-    MAKE_CASE(NVPTXISD::Suld3DV4I8Zero)
-    MAKE_CASE(NVPTXISD::Suld3DV4I16Zero)
-    MAKE_CASE(NVPTXISD::Suld3DV4I32Zero)
   }
   return nullptr;
 
@@ -3713,715 +3358,6 @@ void NVPTXTargetLowering::LowerAsmOperandForConstraint(
   TargetLowering::LowerAsmOperandForConstraint(Op, Constraint, Ops, DAG);
 }
 
-static unsigned getOpcForTextureInstr(unsigned Intrinsic) {
-  switch (Intrinsic) {
-  default:
-    return 0;
-
-  case Intrinsic::nvvm_tex_1d_v4f32_s32:
-    return NVPTXISD::Tex1DFloatS32;
-  case Intrinsic::nvvm_tex_1d_v4f32_f32:
-    return NVPTXISD::Tex1DFloatFloat;
-  case Intrinsic::nvvm_tex_1d_level_v4f32_f32:
-    return NVPTXISD::Tex1DFloatFloatLevel;
-  case Intrinsic::nvvm_tex_1d_grad_v4f32_f32:
-    return NVPTXISD::Tex1DFloatFloatGrad;
-  case Intrinsic::nvvm_tex_1d_v4s32_s32:
-    return NVPTXISD::Tex1DS32S32;
-  case Intrinsic::nvvm_tex_1d_v4s32_f32:
-    return NVPTXISD::Tex1DS32Float;
-  case Intrinsic::nvvm_tex_1d_level_v4s32_f32:
-    return NVPTXISD::Tex1DS32FloatLevel;
-  case Intrinsic::nvvm_tex_1d_grad_v4s32_f32:
-    return NVPTXISD::Tex1DS32FloatGrad;
-  case Intrinsic::nvvm_tex_1d_v4u32_s32:
-    return NVPTXISD::Tex1DU32S32;
-  case Intrinsic::nvvm_tex_1d_v4u32_f32:
-    return NVPTXISD::Tex1DU32Float;
-  case Intrinsic::nvvm_tex_1d_level_v4u32_f32:
-    return NVPTXISD::Tex1DU32FloatLevel;
-  case Intrinsic::nvvm_tex_1d_grad_v4u32_f32:
-    return NVPTXISD::Tex1DU32FloatGrad;
-
-  case Intrinsic::nvvm_tex_1d_array_v4f32_s32:
-    return NVPTXISD::Tex1DArrayFloatS32;
-  case Intrinsic::nvvm_tex_1d_array_v4f32_f32:
-    return NVPTXISD::Tex1DArrayFloatFloat;
-  case Intrinsic::nvvm_tex_1d_array_level_v4f32_f32:
-    return NVPTXISD::Tex1DArrayFloatFloatLevel;
-  case Intrinsic::nvvm_tex_1d_array_grad_v4f32_f32:
-    return NVPTXISD::Tex1DArrayFloatFloatGrad;
-  case Intrinsic::nvvm_tex_1d_array_v4s32_s32:
-    return NVPTXISD::Tex1DArrayS32S32;
-  case Intrinsic::nvvm_tex_1d_array_v4s32_f32:
-    return NVPTXISD::Tex1DArrayS32Float;
-  case Intrinsic::nvvm_tex_1d_array_level_v4s32_f32:
-    return NVPTXISD::Tex1DArrayS32FloatLevel;
-  case Intrinsic::nvvm_tex_1d_array_grad_v4s32_f32:
-    return NVPTXISD::Tex1DArrayS32FloatGrad;
-  case Intrinsic::nvvm_tex_1d_array_v4u32_s32:
-    return NVPTXISD::Tex1DArrayU32S32;
-  case Intrinsic::nvvm_tex_1d_array_v4u32_f32:
-    return NVPTXISD::Tex1DArrayU32Float;
-  case Intrinsic::nvvm_tex_1d_array_level_v4u32_f32:
-    return NVPTXISD::Tex1DArrayU32FloatLevel;
-  case Intrinsic::nvvm_tex_1d_array_grad_v4u32_f32:
-    return NVPTXISD::Tex1DArrayU32FloatGrad;
-
-  case Intrinsic::nvvm_tex_2d_v4f32_s32:
-    return NVPTXISD::Tex2DFloatS32;
-  case Intrinsic::nvvm_tex_2d_v4f32_f32:
-    return NVPTXISD::Tex2DFloatFloat;
-  case Intrinsic::nvvm_tex_2d_level_v4f32_f32:
-    return NVPTXISD::Tex2DFloatFloatLevel;
-  case Intrinsic::nvvm_tex_2d_grad_v4f32_f32:
-    return NVPTXISD::Tex2DFloatFloatGrad;
-  case Intrinsic::nvvm_tex_2d_v4s32_s32:
-    return NVPTXISD::Tex2DS32S32;
-  case Intrinsic::nvvm_tex_2d_v4s32_f32:
-    return NVPTXISD::Tex2DS32Float;
-  case Intrinsic::nvvm_tex_2d_level_v4s32_f32:
-    return NVPTXISD::Tex2DS32FloatLevel;
-  case Intrinsic::nvvm_tex_2d_grad_v4s32_f32:
-    return NVPTXISD::Tex2DS32FloatGrad;
-  case Intrinsic::nvvm_tex_2d_v4u32_s32:
-    return NVPTXISD::Tex2DU32S32;
-  case Intrinsic::nvvm_tex_2d_v4u32_f32:
-    return NVPTXISD::Tex2DU32Float;
-  case Intrinsic::nvvm_tex_2d_level_v4u32_f32:
-    return NVPTXISD::Tex2DU32FloatLevel;
-  case Intrinsic::nvvm_tex_2d_grad_v4u32_f32:
-    return NVPTXISD::Tex2DU32FloatGrad;
-
-  case Intrinsic::nvvm_tex_2d_array_v4f32_s32:
-    return NVPTXISD::Tex2DArrayFloatS32;
-  case Intrinsic::nvvm_tex_2d_array_v4f32_f32:
-    return NVPTXISD::Tex2DArrayFloatFloat;
-  case Intrinsic::nvvm_tex_2d_array_level_v4f32_f32:
-    return NVPTXISD::Tex2DArrayFloatFloatLevel;
-  case Intrinsic::nvvm_tex_2d_array_grad_v4f32_f32:
-    return NVPTXISD::Tex2DArrayFloatFloatGrad;
-  case Intrinsic::nvvm_tex_2d_array_v4s32_s32:
-    return NVPTXISD::Tex2DArrayS32S32;
-  case Intrinsic::nvvm_tex_2d_array_v4s32_f32:
-    return NVPTXISD::Tex2DArrayS32Float;
-  case Intrinsic::nvvm_tex_2d_array_level_v4s32_f32:
-    return NVPTXISD::Tex2DArrayS32FloatLevel;
-  case Intrinsic::nvvm_tex_2d_array_grad_v4s32_f32:
-    return NVPTXISD::Tex2DArrayS32FloatGrad;
-  case Intrinsic::nvvm_tex_2d_array_v4u32_s32:
-    return NVPTXISD::Tex2DArrayU32S32;
-  case Intrinsic::nvvm_tex_2d_array_v4u32_f32:
-    return NVPTXISD::Tex2DArrayU32Float;
-  case Intrinsic::nvvm_tex_2d_array_level_v4u32_f32:
-    return NVPTXISD::Tex2DArrayU32FloatLevel;
-  case Intrinsic::nvvm_tex_2d_array_grad_v4u32_f32:
-    return NVPTXISD::Tex2DArrayU32FloatGrad;
-
-  case Intrinsic::nvvm_tex_3d_v4f32_s32:
-    return NVPTXISD::Tex3DFloatS32;
-  case Intrinsic::nvvm_tex_3d_v4f32_f32:
-    return NVPTXISD::Tex3DFloatFloat;
-  case Intrinsic::nvvm_tex_3d_level_v4f32_f32:
-    return NVPTXISD::Tex3DFloatFloatLevel;
-  case Intrinsic::nvvm_tex_3d_grad_v4f32_f32:
-    return NVPTXISD::Tex3DFloatFloatGrad;
-  case Intrinsic::nvvm_tex_3d_v4s32_s32:
-    return NVPTXISD::Tex3DS32S32;
-  case Intrinsic::nvvm_tex_3d_v4s32_f32:
-    return NVPTXISD::Tex3DS32Float;
-  case Intrinsic::nvvm_tex_3d_level_v4s32_f32:
-    return NVPTXISD::Tex3DS32FloatLevel;
-  case Intrinsic::nvvm_tex_3d_grad_v4s32_f32:
-    return NVPTXISD::Tex3DS32FloatGrad;
-  case Intrinsic::nvvm_tex_3d_v4u32_s32:
-    return NVPTXISD::Tex3DU32S32;
-  case Intrinsic::nvvm_tex_3d_v4u32_f32:
-    return NVPTXISD::Tex3DU32Float;
-  case Intrinsic::nvvm_tex_3d_level_v4u32_f32:
-    return NVPTXISD::Tex3DU32FloatLevel;
-  case Intrinsic::nvvm_tex_3d_grad_v4u32_f32:
-    return NVPTXISD::Tex3DU32FloatGrad;
-
-  case Intrinsic::nvvm_tex_cube_v4f32_f32:
-    return NVPTXISD::TexCubeFloatFloat;
-  case Intrinsic::nvvm_tex_cube_level_v4f32_f32:
-    return NVPTXISD::TexCubeFloatFloatLevel;
-  case Intrinsic::nvvm_tex_cube_v4s32_f32:
-    return NVPTXISD::TexCubeS32Float;
-  case Intrinsic::nvvm_tex_cube_level_v4s32_f32:
-    return NVPTXISD::TexCubeS32FloatLevel;
-  case Intrinsic::nvvm_tex_cube_v4u32_f32:
-    return NVPTXISD::TexCubeU32Float;
-  case Intrinsic::nvvm_tex_cube_level_v4u32_f32:
-    return NVPTXISD::TexCubeU32FloatLevel;
-
-  case Intrinsic::nvvm_tex_cube_array_v4f32_f32:
-    return NVPTXISD::TexCubeArrayFloatFloat;
-  case Intrinsic::nvvm_tex_cube_array_level_v4f32_f32:
-    return NVPTXISD::TexCubeArrayFloatFloatLevel;
-  case Intrinsic::nvvm_tex_cube_array_v4s32_f32:
-    return NVPTXISD::TexCubeArrayS32Float;
-  case Intrinsic::nvvm_tex_cube_array_level_v4s32_f32:
-    return NVPTXISD::TexCubeArrayS32FloatLevel;
-  case Intrinsic::nvvm_tex_cube_array_v4u32_f32:
-    return NVPTXISD::TexCubeArrayU32Float;
-  case Intrinsic::nvvm_tex_cube_array_level_v4u32_f32:
-    return NVPTXISD::TexCubeArrayU32FloatLevel;
-
-  case Intrinsic::nvvm_tld4_r_2d_v4f32_f32:
-    return NVPTXISD::Tld4R2DFloatFloat;
-  case Intrinsic::nvvm_tld4_g_2d_v4f32_f32:
-    return NVPTXISD::Tld4G2DFloatFloat;
-  case Intrinsic::nvvm_tld4_b_2d_v4f32_f32:
-    return NVPTXISD::Tld4B2DFloatFloat;
-  case Intrinsic::nvvm_tld4_a_2d_v4f32_f32:
-    return NVPTXISD::Tld4A2DFloatFloat;
-  case Intrinsic::nvvm_tld4_r_2d_v4s32_f32:
-    return NVPTXISD::Tld4R2DS64Float;
-  case Intrinsic::nvvm_tld4_g_2d_v4s32_f32:
-    return NVPTXISD::Tld4G2DS64Float;
-  case Intrinsic::nvvm_tld4_b_2d_v4s32_f32:
-    return NVPTXISD::Tld4B2DS64Float;
-  case Intrinsic::nvvm_tld4_a_2d_v4s32_f32:
-    return NVPTXISD::Tld4A2DS64Float;
-  case Intrinsic::nvvm_tld4_r_2d_v4u32_f32:
-    return NVPTXISD::Tld4R2DU64Float;
-  case Intrinsic::nvvm_tld4_g_2d_v4u32_f32:
-    return NVPTXISD::Tld4G2DU64Float;
-  case Intrinsic::nvvm_tld4_b_2d_v4u32_f32:
-    return NVPTXISD::Tld4B2DU64Float;
-  case Intrinsic::nvvm_tld4_a_2d_v4u32_f32:
-    return NVPTXISD::Tld4A2DU64Float;
-
-  case Intrinsic::nvvm_tex_unified_1d_v4f32_s32:
-    return NVPTXISD::TexUnified1DFloatS32;
-  case Intrinsic::nvvm_tex_unified_1d_v4f32_f32:
-    return NVPTXISD::TexUnified1DFloatFloat;
-  case Intrinsic::nvvm_tex_unified_1d_level_v4f32_f32:
-    return NVPTXISD::TexUnified1DFloatFloatLevel;
-  case Intrinsic::nvvm_tex_unified_1d_grad_v4f32_f32:
-    return NVPTXISD::TexUnified1DFloatFloatGrad;
-  case Intrinsic::nvvm_tex_unified_1d_v4s32_s32:
-    return NVPTXISD::TexUnified1DS32S32;
-  case Intrinsic::nvvm_tex_unified_1d_v4s32_f32:
-    return NVPTXISD::TexUnified1DS32Float;
-  case Intrinsic::nvvm_tex_unified_1d_level_v4s32_f32:
-    return NVPTXISD::TexUnified1DS32FloatLevel;
-  case Intrinsic::nvvm_tex_unified_1d_grad_v4s32_f32:
-    return NVPTXISD::TexUnified1DS32FloatGrad;
-  case Intrinsic::nvvm_tex_unified_1d_v4u32_s32:
-    return NVPTXISD::TexUnified1DU32S32;
-  case Intrinsic::nvvm_tex_unified_1d_v4u32_f32:
-    return NVPTXISD::TexUnified1DU32Float;
-  case Intrinsic::nvvm_tex_unified_1d_level_v4u32_f32:
-    return NVPTXISD::TexUnified1DU32FloatLevel;
-  case Intrinsic::nvvm_tex_unified_1d_grad_v4u32_f32:
-    return NVPTXISD::TexUnified1DU32FloatGrad;
-
-  case Intrinsic::nvvm_tex_unified_1d_array_v4f32_s32:
-    return NVPTXISD::TexUnified1DArrayFloatS32;
-  case Intrinsic::nvvm_tex_unified_1d_array_v4f32_f32:
-    return NVPTXISD::TexUnified1DArrayFloatFloat;
-  case Intrinsic::nvvm_tex_unified_1d_array_level_v4f32_f32:
-    return NVPTXISD::TexUnified1DArrayFloatFloatLevel;
-  case Intrinsic::nvvm_tex_unified_1d_array_grad_v4f32_f32:
-    return NVPTXISD::TexUnified1DArrayFloatFloatGrad;
-  case Intrinsic::nvvm_tex_unified_1d_array_v4s32_s32:
-    return NVPTXISD::TexUnified1DArrayS32S32;
-  case Intrinsic::nvvm_tex_unified_1d_array_v4s32_f32:
-    return NVPTXISD::TexUnified1DArrayS32Float;
-  case Intrinsic::nvvm_tex_unified_1d_array_level_v4s32_f32:
-    return NVPTXISD::TexUnified1DArrayS32FloatLevel;
-  case Intrinsic::nvvm_tex_unified_1d_array_grad_v4s32_f32:
-    return NVPTXISD::TexUnified1DArrayS32FloatGrad;
-  case Intrinsic::nvvm_tex_unified_1d_array_v4u32_s32:
-    return NVPTXISD::TexUnified1DArrayU32S32;
-  case Intrinsic::nvvm_tex_unified_1d_array_v4u32_f32:
-    return NVPTXISD::TexUnified1DArrayU32Float;
-  case Intrinsic::nvvm_tex_unified_1d_array_level_v4u32_f32:
-    return NVPTXISD::TexUnified1DArrayU32FloatLevel;
-  case Intrinsic::nvvm_tex_unified_1d_array_grad_v4u32_f32:
-    return NVPTXISD::TexUnified1DArrayU32FloatGrad;
-
-  case Intrinsic::nvvm_tex_unified_2d_v4f32_s32:
-    return NVPTXISD::TexUnified2DFloatS32;
-  case Intrinsic::nvvm_tex_unified_2d_v4f32_f32:
-    return NVPTXISD::TexUnified2DFloatFloat;
-  case Intrinsic::nvvm_tex_unified_2d_level_v4f32_f32:
-    return NVPTXISD::TexUnified2DFloatFloatLevel;
-  case Intrinsic::nvvm_tex_unified_2d_grad_v4f32_f32:
-    return NVPTXISD::TexUnified2DFloatFloatGrad;
-  case Intrinsic::nvvm_tex_unified_2d_v4s32_s32:
-    return NVPTXISD::TexUnified2DS32S32;
-  case Intrinsic::nvvm_tex_unified_2d_v4s32_f32:
-    return NVPTXISD::TexUnified2DS32Float;
-  case Intrinsic::nvvm_tex_unified_2d_level_v4s32_f32:
-    return NVPTXISD::TexUnified2DS32FloatLevel;
-  case Intrinsic::nvvm_tex_unified_2d_grad_v4s32_f32:
-    return NVPTXISD::TexUnified2DS32FloatGrad;
-  case Intrinsic::nvvm_tex_unified_2d_v4u32_s32:
-    return NVPTXISD::TexUnified2DU32S32;
-  case Intrinsic::nvvm_tex_unified_2d_v4u32_f32:
-    return NVPTXISD::TexUnified2DU32Float;
-  case Intrinsic::nvvm_tex_unified_2d_level_v4u32_f32:
-    return NVPTXISD::TexUnified2DU32FloatLevel;
-  case Intrinsic::nvvm_tex_unified_2d_grad_v4u32_f32:
-    return NVPTXISD::TexUnified2DU32FloatGrad;
-
-  case Intrinsic::nvvm_tex_unified_2d_array_v4f32_s32:
-    return NVPTXISD::TexUnified2DArrayFloatS32;
-  case Intrinsic::nvvm_tex_unified_2d_array_v4f32_f32:
-    return NVPTXISD::TexUnified2DArrayFloatFloat;
-  case Intrinsic::nvvm_tex_unified_2d_array_level_v4f32_f32:
-    return NVPTXISD::TexUnified2DArrayFloatFloatLevel;
-  case Intrinsic::nvvm_tex_unified_2d_array_grad_v4f32_f32:
-    return NVPTXISD::TexUnified2DArrayFloatFloatGrad;
-  case Intrinsic::nvvm_tex_unified_2d_array_v4s32_s32:
-    return NVPTXISD::TexUnified2DArrayS32S32;
-  case Intrinsic::nvvm_tex_unified_2d_array_v4s32_f32:
-    return NVPTXISD::TexUnified2DArrayS32Float;
-  case Intrinsic::nvvm_tex_unified_2d_array_level_v4s32_f32:
-    return NVPTXISD::TexUnified2DArrayS32FloatLevel;
-  case Intrinsic::nvvm_tex_unified_2d_array_grad_v4s32_f32:
-    return NVPTXISD::TexUnified2DArrayS32FloatGrad;
-  case Intrinsic::nvvm_tex_unified_2d_array_v4u32_s32:
-    return NVPTXISD::TexUnified2DArrayU32S32;
-  case Intrinsic::nvvm_tex_unified_2d_array_v4u32_f32:
-    return NVPTXISD::TexUnified2DArrayU32Float;
-  case Intrinsic::nvvm_tex_unified_2d_array_level_v4u32_f32:
-    return NVPTXISD::TexUnified2DArrayU32FloatLevel;
-  case Intrinsic::nvvm_tex_unified_2d_array_grad_v4u32_f32:
-    return NVPTXISD::TexUnified2DArrayU32FloatGrad;
-
-  case Intrinsic::nvvm_tex_unified_3d_v4f32_s32:
-    return NVPTXISD::TexUnified3DFloatS32;
-  case Intrinsic::nvvm_tex_unified_3d_v4f32_f32:
-    return NVPTXISD::TexUnified3DFloatFloat;
-  case Intrinsic::nvvm_tex_unified_3d_level_v4f32_f32:
-    return NVPTXISD::TexUnified3DFloatFloatLevel;
-  case Intrinsic::nvvm_tex_unified_3d_grad_v4f32_f32:
-    return NVPTXISD::TexUnified3DFloatFloatGrad;
-  case Intrinsic::nvvm_tex_unified_3d_v4s32_s32:
-    return NVPTXISD::TexUnified3DS32S32;
-  case Intrinsic::nvvm_tex_unified_3d_v4s32_f32:
-    return NVPTXISD::TexUnified3DS32Float;
-  case Intrinsic::nvvm_tex_unified_3d_level_v4s32_f32:
-    return NVPTXISD::TexUnified3DS32FloatLevel;
-  case Intrinsic::nvvm_tex_unified_3d_grad_v4s32_f32:
-    return NVPTXISD::TexUnified3DS32FloatGrad;
-  case Intrinsic::nvvm_tex_unified_3d_v4u32_s32:
-    return NVPTXISD::TexUnified3DU32S32;
-  case Intrinsic::nvvm_tex_unified_3d_v4u32_f32:
-    return NVPTXISD::TexUnified3DU32Float;
-  case Intrinsic::nvvm_tex_unified_3d_level_v4u32_f32:
-    return NVPTXISD::TexUnified3DU32FloatLevel;
-  case Intrinsic::nvvm_tex_unified_3d_grad_v4u32_f32:
-    return NVPTXISD::TexUnified3DU32FloatGrad;
-
-  case Intrinsic::nvvm_tex_unified_cube_v4f32_f32:
-    return NVPTXISD::TexUnifiedCubeFloatFloat;
-  case Intrinsic::nvvm_tex_unified_cube_level_v4f32_f32:
-    return NVPTXISD::TexUnifiedCubeFloatFloatLevel;
-  case Intrinsic::nvvm_tex_unified_cube_v4s32_f32:
-    return NVPTXISD::TexUnifiedCubeS32Float;
-  case Intrinsic::nvvm_tex_unified_cube_level_v4s32_f32:
-    return NVPTXISD::TexUnifiedCubeS32FloatLevel;
-  case Intrinsic::nvvm_tex_unified_cube_v4u32_f32:
-    return NVPTXISD::TexUnifiedCubeU32Float;
-  case Intrinsic::nvvm_tex_unified_cube_level_v4u32_f32:
-    return NVPTXISD::TexUnifiedCubeU32FloatLevel;
-
-  case Intrinsic::nvvm_tex_unified_cube_array_v4f32_f32:
-    return NVPTXISD::TexUnifiedCubeArrayFloatFloat;
-  case Intrinsic::nvvm_tex_unified_cube_array_level_v4f32_f32:
-    return NVPTXISD::TexUnifiedCubeArrayFloatFloatLevel;
-  case Intrinsic::nvvm_tex_unified_cube_array_v4s32_f32:
-    return NVPTXISD::TexUnifiedCubeArrayS32Float;
-  case Intrinsic::nvvm_tex_unified_cube_array_level_v4s32_f32:
-    return NVPTXISD::TexUnifiedCubeArrayS32FloatLevel;
-  case Intrinsic::nvvm_tex_unified_cube_array_v4u32_f32:
-    return NVPTXISD::TexUnifiedCubeArrayU32Float;
-  case Intrinsic::nvvm_tex_unified_cube_array_level_v4u32_f32:
-    return NVPTXISD::TexUnifiedCubeArrayU32FloatLevel;
-
-  case Intrinsic::nvvm_tex_unified_cube_grad_v4f32_f32:
-    return NVPTXISD::TexUnifiedCubeFloatFloatGrad;
-  case Intrinsic::nvvm_tex_unified_cube_grad_v4s32_f32:
-    return NVPTXISD::TexUnifiedCubeS32FloatGrad;
-  case Intrinsic::nvvm_tex_unified_cube_grad_v4u32_f32:
-    return NVPTXISD::TexUnifiedCubeU32FloatGrad;
-  case Intrinsic::nvvm_tex_unified_cube_array_grad_v4f32_f32:
-    return NVPTXISD::TexUnifiedCubeArrayFloatFloatGrad;
-  case Intrinsic::nvvm_tex_unified_cube_array_grad_v4s32_f32:
-    return NVPTXISD::TexUnifiedCubeArrayS32FloatGrad;
-  case Intrinsic::nvvm_tex_unified_cube_array_grad_v4u32_f32:
-    return NVPTXISD::TexUnifiedCubeArrayU32FloatGrad;
-
-  case Intrinsic::nvvm_tld4_unified_r_2d_v4f32_f32:
-    return NVPTXISD::Tld4UnifiedR2DFloatFloat;
-  case Intrinsic::nvvm_tld4_unified_g_2d_v4f32_f32:
-    return NVPTXISD::Tld4UnifiedG2DFloatFloat;
-  case Intrinsic::nvvm_tld4_unified_b_2d_v4f32_f32:
-    return NVPTXISD::Tld4UnifiedB2DFloatFloat;
-  case Intrinsic::nvvm_tld4_unified_a_2d_v4f32_f32:
-    return NVPTXISD::Tld4UnifiedA2DFloatFloat;
-  case Intrinsic::nvvm_tld4_unified_r_2d_v4s32_f32:
-    return NVPTXISD::Tld4UnifiedR2DS64Float;
-  case Intrinsic::nvvm_tld4_unified_g_2d_v4s32_f32:
-    return NVPTXISD::Tld4UnifiedG2DS64Float;
-  case Intrinsic::nvvm_tld4_unified_b_2d_v4s32_f32:
-    return NVPTXISD::Tld4UnifiedB2DS64Float;
-  case Intrinsic::nvvm_tld4_unified_a_2d_v4s32_f32:
-    return NVPTXISD::Tld4UnifiedA2DS64Float;
-  case Intrinsic::nvvm_tld4_unified_r_2d_v4u32_f32:
-    return NVPTXISD::Tld4UnifiedR2DU64Float;
-  case Intrinsic::nvvm_tld4_unified_g_2d_v4u32_f32:
-    return NVPTXISD::Tld4UnifiedG2DU64Float;
-  case Intrinsic::nvvm_tld4_unified_b_2d_v4u32_f32:
-    return NVPTXISD::Tld4UnifiedB2DU64Float;
-  case Intrinsic::nvvm_tld4_unified_a_2d_v4u32_f32:
-    return NVPTXISD::Tld4UnifiedA2DU64Float;
-  }
-}
-
-static unsigned getOpcForSurfaceInstr(unsigned Intrinsic) {
-  switch (Intrinsic) {
-  default:
-    return 0;
-  case Intrinsic::nvvm_suld_1d_i8_clamp:
-    return NVPTXISD::Suld1DI8Clamp;
-  case Intrinsic::nvvm_suld_1d_i16_clamp:
-    return NVPTXISD::Suld1DI16Clamp;
-  case Intrinsic::nvvm_suld_1d_i32_clamp:
-    return NVPTXISD::Suld1DI32Clamp;
-  case Intrinsic::nvvm_suld_1d_i64_clamp:
-    return NVPTXISD::Suld1DI64Clamp;
-  case Intrinsic::nvvm_suld_1d_v2i8_clamp:
-    return NVPTXISD::Suld1DV2I8Clamp;
-  case Intrinsic::nvvm_suld_1d_v2i16_clamp:
-    return NVPTXISD::Suld1DV2I16Clamp;
-  case Intrinsic::nvvm_suld_1d_v2i32_clamp:
-    return NVPTXISD::Suld1DV2I32Clamp;
-  case Intrinsic::nvvm_suld_1d_v2i64_clamp:
-    return NVPTXISD::Suld1DV2I64Clamp;
-  case Intrinsic::nvvm_suld_1d_v4i8_clamp:
-    return NVPTXISD::Suld1DV4I8Clamp;
-  case Intrinsic::nvvm_suld_1d_v4i16_clamp:
-    return NVPTXISD::Suld1DV4I16Clamp;
-  case Intrinsic::nvvm_suld_1d_v4i32_clamp:
-    return NVPTXISD::Suld1DV4I32Clamp;
-  case Intrinsic::nvvm_suld_1d_array_i8_clamp:
-    return NVPTXISD::Suld1DArrayI8Clamp;
-  case Intrinsic::nvvm_suld_1d_array_i16_clamp:
-    return NVPTXISD::Suld1DArrayI16Clamp;
-  case Intrinsic::nvvm_suld_1d_array_i32_clamp:
-    return NVPTXISD::Suld1DArrayI32Clamp;
-  case Intrinsic::nvvm_suld_1d_array_i64_clamp:
-    return NVPTXISD::Suld1DArrayI64Clamp;
-  case Intrinsic::nvvm_suld_1d_array_v2i8_clamp:
-    return NVPTXISD::Suld1DArrayV2I8Clamp;
-  case Intrinsic::nvvm_suld_1d_array_v2i16_clamp:
-    return NVPTXISD::Suld1DArrayV2I16Clamp;
-  case Intrinsic::nvvm_suld_1d_array_v2i32_clamp:
-    return NVPTXISD::Suld1DArrayV2I32Clamp;
-  case Intrinsic::nvvm_suld_1d_array_v2i64_clamp:
-    return NVPTXISD::Suld1DArrayV2I64Clamp;
-  case Intrinsic::nvvm_suld_1d_array_v4i8_clamp:
-    return NVPTXISD::Suld1DArrayV4I8Clamp;
-  case Intrinsic::nvvm_suld_1d_array_v4i16_clamp:
-    return NVPTXISD::Suld1DArrayV4I16Clamp;
-  case Intrinsic::nvvm_suld_1d_array_v4i32_clamp:
-    return NVPTXISD::Suld1DArrayV4I32Clamp;
-  case Intrinsic::nvvm_suld_2d_i8_clamp:
-    return NVPTXISD::Suld2DI8Clamp;
-  case Intrinsic::nvvm_suld_2d_i16_clamp:
-    return NVPTXISD::Suld2DI16Clamp;
-  case Intrinsic::nvvm_suld_2d_i32_clamp:
-    return NVPTXISD::Suld2DI32Clamp;
-  case Intrinsic::nvvm_suld_2d_i64_clamp:
-    return NVPTXISD::Suld2DI64Clamp;
-  case Intrinsic::nvvm_suld_2d_v2i8_clamp:
-    return NVPTXISD::Suld2DV2I8Clamp;
-  case Intrinsic::nvvm_suld_2d_v2i16_clamp:
-    return NVPTXISD::Suld2DV2I16Clamp;
-  case Intrinsic::nvvm_suld_2d_v2i32_clamp:
-    return NVPTXISD::Suld2DV2I32Clamp;
-  case Intrinsic::nvvm_suld_2d_v2i64_clamp:
-    return NVPTXISD::Suld2DV2I64Clamp;
-  case Intrinsic::nvvm_suld_2d_v4i8_clamp:
-    return NVPTXISD::Suld2DV4I8Clamp;
-  case Intrinsic::nvvm_suld_2d_v4i16_clamp:
-    return NVPTXISD::Suld2DV4I16Clamp;
-  case Intrinsic::nvvm_suld_2d_v4i32_clamp:
-    return NVPTXISD::Suld2DV4I32Clamp;
-  case Intrinsic::nvvm_suld_2d_array_i8_clamp:
-    return NVPTXISD::Suld2DArrayI8Clamp;
-  case Intrinsic::nvvm_suld_2d_array_i16_clamp:
-    return NVPTXISD::Suld2DArrayI16Clamp;
-  case Intrinsic::nvvm_suld_2d_array_i32_clamp:
-    return NVPTXISD::Suld2DArrayI32Clamp;
-  case Intrinsic::nvvm_suld_2d_array_i64_clamp:
-    return NVPTXISD::Suld2DArrayI64Clamp;
-  case Intrinsic::nvvm_suld_2d_array_v2i8_clamp:
-    return NVPTXISD::Suld2DArrayV2I8Clamp;
-  case Intrinsic::nvvm_suld_2d_array_v2i16_clamp:
-    return NVPTXISD::Suld2DArrayV2I16Clamp;
-  case Intrinsic::nvvm_suld_2d_array_v2i32_clamp:
-    return NVPTXISD::Suld2DArrayV2I32Clamp;
-  case Intrinsic::nvvm_suld_2d_array_v2i64_clamp:
-    return NVPTXISD::Suld2DArrayV2I64Clamp;
-  case Intrinsic::nvvm_suld_2d_array_v4i8_clamp:
-    return NVPTXISD::Suld2DArrayV4I8Clamp;
-  case Intrinsic::nvvm_suld_2d_array_v4i16_clamp:
-    return NVPTXISD::Suld2DArrayV4I16Clamp;
-  case Intrinsic::nvvm_suld_2d_array_v4i32_clamp:
-    return NVPTXISD::Suld2DArrayV4I32Clamp;
-  case Intrinsic::nvvm_suld_3d_i8_clamp:
-    return NVPTXISD::Suld3DI8Clamp;
-  case Intrinsic::nvvm_suld_3d_i16_clamp:
-    return NVPTXISD::Suld3DI16Clamp;
-  case Intrinsic::nvvm_suld_3d_i32_clamp:
-    return NVPTXISD::Suld3DI32Clamp;
-  case Intrinsic::nvvm_suld_3d_i64_clamp:
-    return NVPTXISD::Suld3DI64Clamp;
-  case Intrinsic::nvvm_suld_3d_v2i8_clamp:
-    return NVPTXISD::Suld3DV2I8Clamp;
-  case Intrinsic::nvvm_suld_3d_v2i16_clamp:
-    return NVPTXISD::Suld3DV2I16Clamp;
-  case Intrinsic::nvvm_suld_3d_v2i32_clamp:
-    return NVPTXISD::Suld3DV2I32Clamp;
-  case Intrinsic::nvvm_suld_3d_v2i64_clamp:
-    return NVPTXISD::Suld3DV2I64Clamp;
-  case Intrinsic::nvvm_suld_3d_v4i8_clamp:
-    return NVPTXISD::Suld3DV4I8Clamp;
-  case Intrinsic::nvvm_suld_3d_v4i16_clamp:
-    return NVPTXISD::Suld3DV4I16Clamp;
-  case Intrinsic::nvvm_suld_3d_v4i32_clamp:
-    return NVPTXISD::Suld3DV4I32Clamp;
-  case Intrinsic::nvvm_suld_1d_i8_trap:
-    return NVPTXISD::Suld1DI8Trap;
-  case Intrinsic::nvvm_suld_1d_i16_trap:
-    return NVPTXISD::Suld1DI16Trap;
-  case Intrinsic::nvvm_suld_1d_i32_trap:
-    return NVPTXISD::Suld1DI32Trap;
-  case Intrinsic::nvvm_suld_1d_i64_trap:
-    return NVPTXISD::Suld1DI64Trap;
-  case Intrinsic::nvvm_suld_1d_v2i8_trap:
-    return NVPTXISD::Suld1DV2I8Trap;
-  case Intrinsic::nvvm_suld_1d_v2i16_trap:
-    return NVPTXISD::Suld1DV2I16Trap;
-  case Intrinsic::nvvm_suld_1d_v2i32_trap:
-    return NVPTXISD::Suld1DV2I32Trap;
-  case Intrinsic::nvvm_suld_1d_v2i64_trap:
-    return NVPTXISD::Suld1DV2I64Trap;
-  case Intrinsic::nvvm_suld_1d_v4i8_trap:
-    return NVPTXISD::Suld1DV4I8Trap;
-  case Intrinsic::nvvm_suld_1d_v4i16_trap:
-    return NVPTXISD::Suld1DV4I16Trap;
-  case Intrinsic::nvvm_suld_1d_v4i32_trap:
-    return NVPTXISD::Suld1DV4I32Trap;
-  case Intrinsic::nvvm_suld_1d_array_i8_trap:
-    return NVPTXISD::Suld1DArrayI8Trap;
-  case Intrinsic::nvvm_suld_1d_array_i16_trap:
-    return NVPTXISD::Suld1DArrayI16Trap;
-  case Intrinsic::nvvm_suld_1d_array_i32_trap:
-    return NVPTXISD::Suld1DArrayI32Trap;
-  case Intrinsic::nvvm_suld_1d_array_i64_trap:
-    return NVPTXISD::Suld1DArrayI64Trap;
-  case Intrinsic::nvvm_suld_1d_array_v2i8_trap:
-    return NVPTXISD::Suld1DArrayV2I8Trap;
-  case Intrinsic::nvvm_suld_1d_array_v2i16_trap:
-    return NVPTXISD::Suld1DArrayV2I16Trap;
-  case Intrinsic::nvvm_suld_1d_array_v2i32_trap:
-    return NVPTXISD::Suld1DArrayV2I32Trap;
-  case Intrinsic::nvvm_suld_1d_array_v2i64_trap:
-    return NVPTXISD::Suld1DArrayV2I64Trap;
-  case Intrinsic::nvvm_suld_1d_array_v4i8_trap:
-    return NVPTXISD::Suld1DArrayV4I8Trap;
-  case Intrinsic::nvvm_suld_1d_array_v4i16_trap:
-    return NVPTXISD::Suld1DArrayV4I16Trap;
-  case Intrinsic::nvvm_suld_1d_array_v4i32_trap:
-    return NVPTXISD::Suld1DArrayV4I32Trap;
-  case Intrinsic::nvvm_suld_2d_i8_trap:
-    return NVPTXISD::Suld2DI8Trap;
-  case Intrinsic::nvvm_suld_2d_i16_trap:
-    return NVPTXISD::Suld2DI16Trap;
-  case Intrinsic::nvvm_suld_2d_i32_trap:
-    return NVPTXISD::Suld2DI32Trap;
-  case Intrinsic::nvvm_suld_2d_i64_trap:
-    return NVPTXISD::Suld2DI64Trap;
-  case Intrinsic::nvvm_suld_2d_v2i8_trap:
-    return NVPTXISD::Suld2DV2I8Trap;
-  case Intrinsic::nvvm_suld_2d_v2i16_trap:
-    return NVPTXISD::Suld2DV2I16Trap;
-  case Intrinsic::nvvm_suld_2d_v2i32_trap:
-    return NVPTXISD::Suld2DV2I32Trap;
-  case Intrinsic::nvvm_suld_2d_v2i64_trap:
-    return NVPTXISD::Suld2DV2I64Trap;
-  case Intrinsic::nvvm_suld_2d_v4i8_trap:
-    return NVPTXISD::Suld2DV4I8Trap;
-  case Intrinsic::nvvm_suld_2d_v4i16_trap:
-    return NVPTXISD::Suld2DV4I16Trap;
-  case Intrinsic::nvvm_suld_2d_v4i32_trap:
-    return NVPTXISD::Suld2DV4I32Trap;
-  case Intrinsic::nvvm_suld_2d_array_i8_trap:
-    return NVPTXISD::Suld2DArrayI8Trap;
-  case Intrinsic::nvvm_suld_2d_array_i16_trap:
-    return NVPTXISD::Suld2DArrayI16Trap;
-  case Intrinsic::nvvm_suld_2d_array_i32_trap:
-    return NVPTXISD::Suld2DArrayI32Trap;
-  case Intrinsic::nvvm_suld_2d_array_i64_trap:
-    return NVPTXISD::Suld2DArrayI64Trap;
-  case Intrinsic::nvvm_suld_2d_array_v2i8_trap:
-    return NVPTXISD::Suld2DArrayV2I8Trap;
-  case Intrinsic::nvvm_suld_2d_array_v2i16_trap:
-    return NVPTXISD::Suld2DArrayV2I16Trap;
-  case Intrinsic::nvvm_suld_2d_array_v2i32_trap:
-    return NVPTXISD::Suld2DArrayV2I32Trap;
-  case Intrinsic::nvvm_suld_2d_array_v2i64_trap:
-    return NVPTXISD::Suld2DArrayV2I64Trap;
-  case Intrinsic::nvvm_suld_2d_array_v4i8_trap:
-    return NVPTXISD::Suld2DArrayV4I8Trap;
-  case Intrinsic::nvvm_suld_2d_array_v4i16_trap:
-    return NVPTXISD::Suld2DArrayV4I16Trap;
-  case Intrinsic::nvvm_suld_2d_array_v4i32_trap:
-    return NVPTXISD::Suld2DArrayV4I32Trap;
-  case Intrinsic::nvvm_suld_3d_i8_trap:
-    return NVPTXISD::Suld3DI8Trap;
-  case Intrinsic::nvvm_suld_3d_i16_trap:
-    return NVPTXISD::Suld3DI16Trap;
-  case Intrinsic::nvvm_suld_3d_i32_trap:
-    return NVPTXISD::Suld3DI32Trap;
-  case Intrinsic::nvvm_suld_3d_i64_trap:
-    return NVPTXISD::Suld3DI64Trap;
-  case Intrinsic::nvvm_suld_3d_v2i8_trap:
-    return NVPTXISD::Suld3DV2I8Trap;
-  case Intrinsic::nvvm_suld_3d_v2i16_trap:
-    return NVPTXISD::Suld3DV2I16Trap;
-  case Intrinsic::nvvm_suld_3d_v2i32_trap:
-    return NVPTXISD::Suld3DV2I32Trap;
-  case Intrinsic::nvvm_suld_3d_v2i64_trap:
-    return NVPTXISD::Suld3DV2I64Trap;
-  case Intrinsic::nvvm_suld_3d_v4i8_trap:
-    return NVPTXISD::Suld3DV4I8Trap;
-  case Intrinsic::nvvm_suld_3d_v4i16_trap:
-    return NVPTXISD::Suld3DV4I16Trap;
-  case Intrinsic::nvvm_suld_3d_v4i32_trap:
-    return NVPTXISD::Suld3DV4I32Trap;
-  case Intrinsic::nvvm_suld_1d_i8_zero:
-    return NVPTXISD::Suld1DI8Zero;
-  case Intrinsic::nvvm_suld_1d_i16_zero:
-    return NVPTXISD::Suld1DI16Zero;
-  case Intrinsic::nvvm_suld_1d_i32_zero:
-    return NVPTXISD::Suld1DI32Zero;
-  case Intrinsic::nvvm_suld_1d_i64_zero:
-    return NVPTXISD::Suld1DI64Zero;
-  case Intrinsic::nvvm_suld_1d_v2i8_zero:
-    return NVPTXISD::Suld1DV2I8Zero;
-  case Intrinsic::nvvm_suld_1d_v2i16_zero:
-    return NVPTXISD::Suld1DV2I16Zero;
-  case Intrinsic::nvvm_suld_1d_v2i32_zero:
-    return NVPTXISD::Suld1DV2I32Zero;
-  case Intrinsic::nvvm_suld_1d_v2i64_zero:
-    return NVPTXISD::Suld1DV2I64Zero;
-  case Intrinsic::nvvm_suld_1d_v4i8_zero:
-    return NVPTXISD::Suld1DV4I8Zero;
-  case Intrinsic::nvvm_suld_1d_v4i16_zero:
-    return NVPTXISD::Suld1DV4I16Zero;
-  case Intrinsic::nvvm_suld_1d_v4i32_zero:
-    return NVPTXISD::Suld1DV4I32Zero;
-  case Intrinsic::nvvm_suld_1d_array_i8_zero:
-    return NVPTXISD::Suld1DArrayI8Zero;
-  case Intrinsic::nvvm_suld_1d_array_i16_zero:
-    return NVPTXISD::Suld1DArrayI16Zero;
-  case Intrinsic::nvvm_suld_1d_array_i32_zero:
-    return NVPTXISD::Suld1DArrayI32Zero;
-  case Intrinsic::nvvm_suld_1d_array_i64_zero:
-    return NVPTXISD::Suld1DArrayI64Zero;
-  case Intrinsic::nvvm_suld_1d_array_v2i8_zero:
-    return NVPTXISD::Suld1DArrayV2I8Zero;
-  case Intrinsic::nvvm_suld_1d_array_v2i16_zero:
-    return NVPTXISD::Suld1DArrayV2I16Zero;
-  case Intrinsic::nvvm_suld_1d_array_v2i32_zero:
-    return NVPTXISD::Suld1DArrayV2I32Zero;
-  case Intrinsic::nvvm_suld_1d_array_v2i64_zero:
-    return NVPTXISD::Suld1DArrayV2I64Zero;
-  case Intrinsic::nvvm_suld_1d_array_v4i8_zero:
-    return NVPTXISD::Suld1DArrayV4I8Zero;
-  case Intrinsic::nvvm_suld_1d_array_v4i16_zero:
-    return NVPTXISD::Suld1DArrayV4I16Zero;
-  case Intrinsic::nvvm_suld_1d_array_v4i32_zero:
-    return NVPTXISD::Suld1DArrayV4I32Zero;
-  case Intrinsic::nvvm_suld_2d_i8_zero:
-    return NVPTXISD::Suld2DI8Zero;
-  case Intrinsic::nvvm_suld_2d_i16_zero:
-    return NVPTXISD::Suld2DI16Zero;
-  case Intrinsic::nvvm_suld_2d_i32_zero:
-    return NVPTXISD::Suld2DI32Zero;
-  case Intrinsic::nvvm_suld_2d_i64_zero:
-    return NVPTXISD::Suld2DI64Zero;
-  case Intrinsic::nvvm_suld_2d_v2i8_zero:
-    return NVPTXISD::Suld2DV2I8Zero;
-  case Intrinsic::nvvm_suld_2d_v2i16_zero:
-    return NVPTXISD::Suld2DV2I16Zero;
-  case Intrinsic::nvvm_suld_2d_v2i32_zero:
-    return NVPTXISD::Suld2DV2I32Zero;
-  case Intrinsic::nvvm_suld_2d_v2i64_zero:
-    return NVPTXISD::Suld2DV2I64Zero;
-  case Intrinsic::nvvm_suld_2d_v4i8_zero:
-    return NVPTXISD::Suld2DV4I8Zero;
-  case Intrinsic::nvvm_suld_2d_v4i16_zero:
-    return NVPTXISD::Suld2DV4I16Zero;
-  case Intrinsic::nvvm_suld_2d_v4i32_zero:
-    return NVPTXISD::Suld2DV4I32Zero;
-  case Intrinsic::nvvm_suld_2d_array_i8_zero:
-    return NVPTXISD::Suld2DArrayI8Zero;
-  case Intrinsic::nvvm_suld_2d_array_i16_zero:
-    return NVPTXISD::Suld2DArrayI16Zero;
-  case Intrinsic::nvvm_suld_2d_array_i32_zero:
-    return NVPTXISD::Suld2DArrayI32Zero;
-  case Intrinsic::nvvm_suld_2d_array_i64_zero:
-    return NVPTXISD::Suld2DArrayI64Zero;
-  case Intrinsic::nvvm_suld_2d_array_v2i8_zero:
-    return NVPTXISD::Suld2DArrayV2I8Zero;
-  case Intrinsic::nvvm_suld_2d_array_v2i16_zero:
-    return NVPTXISD::Suld2DArrayV2I16Zero;
-  case Intrinsic::nvvm_suld_2d_array_v2i32_zero:
-    return NVPTXISD::Suld2DArrayV2I32Zero;
-  case Intrinsic::nvvm_suld_2d_array_v2i64_zero:
-    return NVPTXISD::Suld2DArrayV2I64Zero;
-  case Intrinsic::nvvm_suld_2d_array_v4i8_zero:
-    return NVPTXISD::Suld2DArrayV4I8Zero;
-  case Intrinsic::nvvm_suld_2d_array_v4i16_zero:
-    return NVPTXISD::Suld2DArrayV4I16Zero;
-  case Intrinsic::nvvm_suld_2d_array_v4i32_zero:
-    return NVPTXISD::Suld2DArrayV4I32Zero;
-  case Intrinsic::nvvm_suld_3d_i8_zero:
-    return NVPTXISD::Suld3DI8Zero;
-  case Intrinsic::nvvm_suld_3d_i16_zero:
-    return NVPTXISD::Suld3DI16Zero;
-  case Intrinsic::nvvm_suld_3d_i32_zero:
-    return NVPTXISD::Suld3DI32Zero;
-  case Intrinsic::nvvm_suld_3d_i64_zero:
-    return NVPTXISD::Suld3DI64Zero;
-  case Intrinsic::nvvm_suld_3d_v2i8_zero:
-    return NVPTXISD::Suld3DV2I8Zero;
-  case Intrinsic::nvvm_suld_3d_v2i16_zero:
-    return NVPTXISD::Suld3DV2I16Zero;
-  case Intrinsic::nvvm_suld_3d_v2i32_zero:
-    return NVPTXISD::Suld3DV2I32Zero;
-  case Intrinsic::nvvm_suld_3d_v2i64_zero:
-    return NVPTXISD::Suld3DV2I64Zero;
-  case Intrinsic::nvvm_suld_3d_v4i8_zero:
-    return NVPTXISD::Suld3DV4I8Zero;
-  case Intrinsic::nvvm_suld_3d_v4i16_zero:
-    return NVPTXISD::Suld3DV4I16Zero;
-  case Intrinsic::nvvm_suld_3d_v4i32_zero:
-    return NVPTXISD::Suld3DV4I32Zero;
-  }
-}
-
 // llvm.ptx.memcpy.const and llvm.ptx.memmove.const need to be modeled as
 // TgtMemIntrinsic
 // because we need the information that is only available in the "Value" type
@@ -4928,7 +3864,7 @@ bool NVPTXTargetLowering::getTgtMemIntrinsic(
   case Intrinsic::nvvm_tld4_unified_g_2d_v4f32_f32:
   case Intrinsic::nvvm_tld4_unified_b_2d_v4f32_f32:
   case Intrinsic::nvvm_tld4_unified_a_2d_v4f32_f32:
-    Info.opc = getOpcForTextureInstr(Intrinsic);
+    Info.opc = ISD::INTRINSIC_W_CHAIN;
     Info.memVT = MVT::v4f32;
     Info.ptrVal = nullptr;
     Info.offset = 0;
@@ -5052,7 +3988,7 @@ bool NVPTXTargetLowering::getTgtMemIntrinsic(
   case Intrinsic::nvvm_tld4_unified_g_2d_v4u32_f32:
   case Intrinsic::nvvm_tld4_unified_b_2d_v4u32_f32:
   case Intrinsic::nvvm_tld4_unified_a_2d_v4u32_f32:
-    Info.opc = getOpcForTextureInstr(Intrinsic);
+    Info.opc = ISD::INTRINSIC_W_CHAIN;
     Info.memVT = MVT::v4i32;
     Info.ptrVal = nullptr;
     Info.offset = 0;
@@ -5105,7 +4041,7 @@ bool NVPTXTargetLowering::getTgtMemIntrinsic(
   case Intrinsic::nvvm_suld_3d_i8_zero:
   case Intrinsic::nvvm_suld_3d_v2i8_zero:
   case Intrinsic::nvvm_suld_3d_v4i8_zero:
-    Info.opc = getOpcForSurfaceInstr(Intrinsic);
+    Info.opc = ISD::INTRINSIC_W_CHAIN;
     Info.memVT = MVT::i8;
     Info.ptrVal = nullptr;
     Info.offset = 0;
@@ -5158,7 +4094,7 @@ bool NVPTXTargetLowering::getTgtMemIntrinsic(
   case Intrinsic::nvvm_suld_3d_i16_zero:
   case Intrinsic::nvvm_suld_3d_v2i16_zero:
   case Intrinsic::nvvm_suld_3d_v4i16_zero:
-    Info.opc = getOpcForSurfaceInstr(Intrinsic);
+    Info.opc = ISD::INTRINSIC_W_CHAIN;
     Info.memVT = MVT::i16;
     Info.ptrVal = nullptr;
     Info.offset = 0;
@@ -5211,7 +4147,7 @@ bool NVPTXTargetLowering::getTgtMemIntrinsic(
   case Intrinsic::nvvm_suld_3d_i32_zero:
   case Intrinsic::nvvm_suld_3d_v2i32_zero:
   case Intrinsic::nvvm_suld_3d_v4i32_zero:
-    Info.opc = getOpcForSurfaceInstr(Intrinsic);
+    Info.opc = ISD::INTRINSIC_W_CHAIN;
     Info.memVT = MVT::i32;
     Info.ptrVal = nullptr;
     Info.offset = 0;
@@ -5249,7 +4185,7 @@ bool NVPTXTargetLowering::getTgtMemIntrinsic(
   case Intrinsic::nvvm_suld_2d_array_v2i64_zero:
   case Intrinsic::nvvm_suld_3d_i64_zero:
   case Intrinsic::nvvm_suld_3d_v2i64_zero:
-    Info.opc = getOpcForSurfaceInstr(Intrinsic);
+    Info.opc = ISD::INTRINSIC_W_CHAIN;
     Info.memVT = MVT::i64;
     Info.ptrVal = nullptr;
     Info.offset = 0;
diff --git a/llvm/lib/Target/NVPTX/NVPTXISelLowering.h b/llvm/lib/Target/NVPTX/NVPTXISelLowering.h
index c8b589ae39413e..0244a0c5bec9d5 100644
--- a/llvm/lib/Target/NVPTX/NVPTXISelLowering.h
+++ b/llvm/lib/Target/NVPTX/NVPTXISelLowering.h
@@ -87,363 +87,6 @@ enum NodeType : unsigned {
   StoreRetval,
   StoreRetvalV2,
   StoreRetvalV4,
-
-  // Texture intrinsics
-  Tex1DFloatS32,
-  Tex1DFloatFloat,
-  Tex1DFloatFloatLevel,
-  Tex1DFloatFloatGrad,
-  Tex1DS32S32,
-  Tex1DS32Float,
-  Tex1DS32FloatLevel,
-  Tex1DS32FloatGrad,
-  Tex1DU32S32,
-  Tex1DU32Float,
-  Tex1DU32FloatLevel,
-  Tex1DU32FloatGrad,
-  Tex1DArrayFloatS32,
-  Tex1DArrayFloatFloat,
-  Tex1DArrayFloatFloatLevel,
-  Tex1DArrayFloatFloatGrad,
-  Tex1DArrayS32S32,
-  Tex1DArrayS32Float,
-  Tex1DArrayS32FloatLevel,
-  Tex1DArrayS32FloatGrad,
-  Tex1DArrayU32S32,
-  Tex1DArrayU32Float,
-  Tex1DArrayU32FloatLevel,
-  Tex1DArrayU32FloatGrad,
-  Tex2DFloatS32,
-  Tex2DFloatFloat,
-  Tex2DFloatFloatLevel,
-  Tex2DFloatFloatGrad,
-  Tex2DS32S32,
-  Tex2DS32Float,
-  Tex2DS32FloatLevel,
-  Tex2DS32FloatGrad,
-  Tex2DU32S32,
-  Tex2DU32Float,
-  Tex2DU32FloatLevel,
-  Tex2DU32FloatGrad,
-  Tex2DArrayFloatS32,
-  Tex2DArrayFloatFloat,
-  Tex2DArrayFloatFloatLevel,
-  Tex2DArrayFloatFloatGrad,
-  Tex2DArrayS32S32,
-  Tex2DArrayS32Float,
-  Tex2DArrayS32FloatLevel,
-  Tex2DArrayS32FloatGrad,
-  Tex2DArrayU32S32,
-  Tex2DArrayU32Float,
-  Tex2DArrayU32FloatLevel,
-  Tex2DArrayU32FloatGrad,
-  Tex3DFloatS32,
-  Tex3DFloatFloat,
-  Tex3DFloatFloatLevel,
-  Tex3DFloatFloatGrad,
-  Tex3DS32S32,
-  Tex3DS32Float,
-  Tex3DS32FloatLevel,
-  Tex3DS32FloatGrad,
-  Tex3DU32S32,
-  Tex3DU32Float,
-  Tex3DU32FloatLevel,
-  Tex3DU32FloatGrad,
-  TexCubeFloatFloat,
-  TexCubeFloatFloatLevel,
-  TexCubeS32Float,
-  TexCubeS32FloatLevel,
-  TexCubeU32Float,
-  TexCubeU32FloatLevel,
-  TexCubeArrayFloatFloat,
-  TexCubeArrayFloatFloatLevel,
-  TexCubeArrayS32Float,
-  TexCubeArrayS32FloatLevel,
-  TexCubeArrayU32Float,
-  TexCubeArrayU32FloatLevel,
-  Tld4R2DFloatFloat,
-  Tld4G2DFloatFloat,
-  Tld4B2DFloatFloat,
-  Tld4A2DFloatFloat,
-  Tld4R2DS64Float,
-  Tld4G2DS64Float,
-  Tld4B2DS64Float,
-  Tld4A2DS64Float,
-  Tld4R2DU64Float,
-  Tld4G2DU64Float,
-  Tld4B2DU64Float,
-  Tld4A2DU64Float,
-  TexUnified1DFloatS32,
-  TexUnified1DFloatFloat,
-  TexUnified1DFloatFloatLevel,
-  TexUnified1DFloatFloatGrad,
-  TexUnified1DS32S32,
-  TexUnified1DS32Float,
-  TexUnified1DS32FloatLevel,
-  TexUnified1DS32FloatGrad,
-  TexUnified1DU32S32,
-  TexUnified1DU32Float,
-  TexUnified1DU32FloatLevel,
-  TexUnified1DU32FloatGrad,
-  TexUnified1DArrayFloatS32,
-  TexUnified1DArrayFloatFloat,
-  TexUnified1DArrayFloatFloatLevel,
-  TexUnified1DArrayFloatFloatGrad,
-  TexUnified1DArrayS32S32,
-  TexUnified1DArrayS32Float,
-  TexUnified1DArrayS32FloatLevel,
-  TexUnified1DArrayS32FloatGrad,
-  TexUnified1DArrayU32S32,
-  TexUnified1DArrayU32Float,
-  TexUnified1DArrayU32FloatLevel,
-  TexUnified1DArrayU32FloatGrad,
-  TexUnified2DFloatS32,
-  TexUnified2DFloatFloat,
-  TexUnified2DFloatFloatLevel,
-  TexUnified2DFloatFloatGrad,
-  TexUnified2DS32S32,
-  TexUnified2DS32Float,
-  TexUnified2DS32FloatLevel,
-  TexUnified2DS32FloatGrad,
-  TexUnified2DU32S32,
-  TexUnified2DU32Float,
-  TexUnified2DU32FloatLevel,
-  TexUnified2DU32FloatGrad,
-  TexUnified2DArrayFloatS32,
-  TexUnified2DArrayFloatFloat,
-  TexUnified2DArrayFloatFloatLevel,
-  TexUnified2DArrayFloatFloatGrad,
-  TexUnified2DArrayS32S32,
-  TexUnified2DArrayS32Float,
-  TexUnified2DArrayS32FloatLevel,
-  TexUnified2DArrayS32FloatGrad,
-  TexUnified2DArrayU32S32,
-  TexUnified2DArrayU32Float,
-  TexUnified2DArrayU32FloatLevel,
-  TexUnified2DArrayU32FloatGrad,
-  TexUnified3DFloatS32,
-  TexUnified3DFloatFloat,
-  TexUnified3DFloatFloatLevel,
-  TexUnified3DFloatFloatGrad,
-  TexUnified3DS32S32,
-  TexUnified3DS32Float,
-  TexUnified3DS32FloatLevel,
-  TexUnified3DS32FloatGrad,
-  TexUnified3DU32S32,
-  TexUnified3DU32Float,
-  TexUnified3DU32FloatLevel,
-  TexUnified3DU32FloatGrad,
-  TexUnifiedCubeFloatFloat,
-  TexUnifiedCubeFloatFloatLevel,
-  TexUnifiedCubeS32Float,
-  TexUnifiedCubeS32FloatLevel,
-  TexUnifiedCubeU32Float,
-  TexUnifiedCubeU32FloatLevel,
-  TexUnifiedCubeArrayFloatFloat,
-  TexUnifiedCubeArrayFloatFloatLevel,
-  TexUnifiedCubeArrayS32Float,
-  TexUnifiedCubeArrayS32FloatLevel,
-  TexUnifiedCubeArrayU32Float,
-  TexUnifiedCubeArrayU32FloatLevel,
-  TexUnifiedCubeFloatFloatGrad,
-  TexUnifiedCubeS32FloatGrad,
-  TexUnifiedCubeU32FloatGrad,
-  TexUnifiedCubeArrayFloatFloatGrad,
-  TexUnifiedCubeArrayS32FloatGrad,
-  TexUnifiedCubeArrayU32FloatGrad,
-  Tld4UnifiedR2DFloatFloat,
-  Tld4UnifiedG2DFloatFloat,
-  Tld4UnifiedB2DFloatFloat,
-  Tld4UnifiedA2DFloatFloat,
-  Tld4UnifiedR2DS64Float,
-  Tld4UnifiedG2DS64Float,
-  Tld4UnifiedB2DS64Float,
-  Tld4UnifiedA2DS64Float,
-  Tld4UnifiedR2DU64Float,
-  Tld4UnifiedG2DU64Float,
-  Tld4UnifiedB2DU64Float,
-  Tld4UnifiedA2DU64Float,
-
-  // Surface intrinsics
-  Suld1DI8Clamp,
-  Suld1DI16Clamp,
-  Suld1DI32Clamp,
-  Suld1DI64Clamp,
-  Suld1DV2I8Clamp,
-  Suld1DV2I16Clamp,
-  Suld1DV2I32Clamp,
-  Suld1DV2I64Clamp,
-  Suld1DV4I8Clamp,
-  Suld1DV4I16Clamp,
-  Suld1DV4I32Clamp,
-
-  Suld1DArrayI8Clamp,
-  Suld1DArrayI16Clamp,
-  Suld1DArrayI32Clamp,
-  Suld1DArrayI64Clamp,
-  Suld1DArrayV2I8Clamp,
-  Suld1DArrayV2I16Clamp,
-  Suld1DArrayV2I32Clamp,
-  Suld1DArrayV2I64Clamp,
-  Suld1DArrayV4I8Clamp,
-  Suld1DArrayV4I16Clamp,
-  Suld1DArrayV4I32Clamp,
-
-  Suld2DI8Clamp,
-  Suld2DI16Clamp,
-  Suld2DI32Clamp,
-  Suld2DI64Clamp,
-  Suld2DV2I8Clamp,
-  Suld2DV2I16Clamp,
-  Suld2DV2I32Clamp,
-  Suld2DV2I64Clamp,
-  Suld2DV4I8Clamp,
-  Suld2DV4I16Clamp,
-  Suld2DV4I32Clamp,
-
-  Suld2DArrayI8Clamp,
-  Suld2DArrayI16Clamp,
-  Suld2DArrayI32Clamp,
-  Suld2DArrayI64Clamp,
-  Suld2DArrayV2I8Clamp,
-  Suld2DArrayV2I16Clamp,
-  Suld2DArrayV2I32Clamp,
-  Suld2DArrayV2I64Clamp,
-  Suld2DArrayV4I8Clamp,
-  Suld2DArrayV4I16Clamp,
-  Suld2DArrayV4I32Clamp,
-
-  Suld3DI8Clamp,
-  Suld3DI16Clamp,
-  Suld3DI32Clamp,
-  Suld3DI64Clamp,
-  Suld3DV2I8Clamp,
-  Suld3DV2I16Clamp,
-  Suld3DV2I32Clamp,
-  Suld3DV2I64Clamp,
-  Suld3DV4I8Clamp,
-  Suld3DV4I16Clamp,
-  Suld3DV4I32Clamp,
-
-  Suld1DI8Trap,
-  Suld1DI16Trap,
-  Suld1DI32Trap,
-  Suld1DI64Trap,
-  Suld1DV2I8Trap,
-  Suld1DV2I16Trap,
-  Suld1DV2I32Trap,
-  Suld1DV2I64Trap,
-  Suld1DV4I8Trap,
-  Suld1DV4I16Trap,
-  Suld1DV4I32Trap,
-
-  Suld1DArrayI8Trap,
-  Suld1DArrayI16Trap,
-  Suld1DArrayI32Trap,
-  Suld1DArrayI64Trap,
-  Suld1DArrayV2I8Trap,
-  Suld1DArrayV2I16Trap,
-  Suld1DArrayV2I32Trap,
-  Suld1DArrayV2I64Trap,
-  Suld1DArrayV4I8Trap,
-  Suld1DArrayV4I16Trap,
-  Suld1DArrayV4I32Trap,
-
-  Suld2DI8Trap,
-  Suld2DI16Trap,
-  Suld2DI32Trap,
-  Suld2DI64Trap,
-  Suld2DV2I8Trap,
-  Suld2DV2I16Trap,
-  Suld2DV2I32Trap,
-  Suld2DV2I64Trap,
-  Suld2DV4I8Trap,
-  Suld2DV4I16Trap,
-  Suld2DV4I32Trap,
-
-  Suld2DArrayI8Trap,
-  Suld2DArrayI16Trap,
-  Suld2DArrayI32Trap,
-  Suld2DArrayI64Trap,
-  Suld2DArrayV2I8Trap,
-  Suld2DArrayV2I16Trap,
-  Suld2DArrayV2I32Trap,
-  Suld2DArrayV2I64Trap,
-  Suld2DArrayV4I8Trap,
-  Suld2DArrayV4I16Trap,
-  Suld2DArrayV4I32Trap,
-
-  Suld3DI8Trap,
-  Suld3DI16Trap,
-  Suld3DI32Trap,
-  Suld3DI64Trap,
-  Suld3DV2I8Trap,
-  Suld3DV2I16Trap,
-  Suld3DV2I32Trap,
-  Suld3DV2I64Trap,
-  Suld3DV4I8Trap,
-  Suld3DV4I16Trap,
-  Suld3DV4I32Trap,
-
-  Suld1DI8Zero,
-  Suld1DI16Zero,
-  Suld1DI32Zero,
-  Suld1DI64Zero,
-  Suld1DV2I8Zero,
-  Suld1DV2I16Zero,
-  Suld1DV2I32Zero,
-  Suld1DV2I64Zero,
-  Suld1DV4I8Zero,
-  Suld1DV4I16Zero,
-  Suld1DV4I32Zero,
-
-  Suld1DArrayI8Zero,
-  Suld1DArrayI16Zero,
-  Suld1DArrayI32Zero,
-  Suld1DArrayI64Zero,
-  Suld1DArrayV2I8Zero,
-  Suld1DArrayV2I16Zero,
-  Suld1DArrayV2I32Zero,
-  Suld1DArrayV2I64Zero,
-  Suld1DArrayV4I8Zero,
-  Suld1DArrayV4I16Zero,
-  Suld1DArrayV4I32Zero,
-
-  Suld2DI8Zero,
-  Suld2DI16Zero,
-  Suld2DI32Zero,
-  Suld2DI64Zero,
-  Suld2DV2I8Zero,
-  Suld2DV2I16Zero,
-  Suld2DV2I32Zero,
-  Suld2DV2I64Zero,
-  Suld2DV4I8Zero,
-  Suld2DV4I16Zero,
-  Suld2DV4I32Zero,
-
-  Suld2DArrayI8Zero,
-  Suld2DArrayI16Zero,
-  Suld2DArrayI32Zero,
-  Suld2DArrayI64Zero,
-  Suld2DArrayV2I8Zero,
-  Suld2DArrayV2I16Zero,
-  Suld2DArrayV2I32Zero,
-  Suld2DArrayV2I64Zero,
-  Suld2DArrayV4I8Zero,
-  Suld2DArrayV4I16Zero,
-  Suld2DArrayV4I32Zero,
-
-  Suld3DI8Zero,
-  Suld3DI16Zero,
-  Suld3DI32Zero,
-  Suld3DI64Zero,
-  Suld3DV2I8Zero,
-  Suld3DV2I16Zero,
-  Suld3DV2I32Zero,
-  Suld3DV2I64Zero,
-  Suld3DV4I8Zero,
-  Suld3DV4I16Zero,
-  Suld3DV4I32Zero
 };
 }
 
diff --git a/llvm/lib/Target/NVPTX/NVPTXIntrinsics.td b/llvm/lib/Target/NVPTX/NVPTXIntrinsics.td
index 429e019163a388..644da01cff618a 100644
--- a/llvm/lib/Target/NVPTX/NVPTXIntrinsics.td
+++ b/llvm/lib/Target/NVPTX/NVPTXIntrinsics.td
@@ -3548,6 +3548,7 @@ defm TLD4_A_2D_U32_F32
 }
 
 
+
 // texmode_unified
 let IsTex = true, IsTexModeUnified = true in {
 // Texture fetch instructions using handles
@@ -7078,3 +7079,738 @@ defm INT_SET_MAXNREG_DEC : SET_MAXNREG<"dec", int_nvvm_setmaxnreg_dec_sync_align
 } // isConvergent
 
 def INT_EXIT : NVPTXInst<(outs), (ins), "exit;", [(int_nvvm_exit)]>;
+
+def : Pat<(int_nvvm_tex_1d_v4f32_s32 i64:$t, i64:$s, i32:$x),
+          (TEX_1D_F32_S32_RR $t, $s, $x)>;
+def : Pat<(int_nvvm_tex_1d_v4f32_f32 i64:$t, i64:$s, f32:$x),
+          (TEX_1D_F32_F32_RR $t, $s, $x)>;
+def : Pat<(int_nvvm_tex_1d_v4s32_s32 i64:$t, i64:$s, i32:$x),
+          (TEX_1D_S32_S32_RR $t, $s, $x)>;
+def : Pat<(int_nvvm_tex_1d_v4s32_f32 i64:$t, i64:$s, f32:$x),
+          (TEX_1D_S32_F32_RR $t, $s, $x)>;
+def : Pat<(int_nvvm_tex_1d_v4u32_s32 i64:$t, i64:$s, i32:$x),
+          (TEX_1D_U32_S32_RR $t, $s, $x)>;
+def : Pat<(int_nvvm_tex_1d_v4u32_f32 i64:$t, i64:$s, f32:$x),
+          (TEX_1D_U32_F32_RR $t, $s, $x)>;
+
+def : Pat<(int_nvvm_tex_1d_level_v4f32_f32 i64:$t, i64:$s, f32:$x, f32:$lod),
+          (TEX_1D_F32_F32_LEVEL_RR $t, $s, $x, $lod)>;
+def : Pat<(int_nvvm_tex_1d_level_v4s32_f32 i64:$t, i64:$s, f32:$x, f32:$lod),
+          (TEX_1D_S32_F32_LEVEL_RR $t, $s, $x, $lod)>;
+def : Pat<(int_nvvm_tex_1d_level_v4u32_f32 i64:$t, i64:$s, f32:$x, f32:$lod),
+          (TEX_1D_U32_F32_LEVEL_RR $t, $s, $x, $lod)>;
+
+def : Pat<(int_nvvm_tex_1d_grad_v4f32_f32 i64:$t, i64:$s, f32:$x, f32:$gradx, f32:$grady),
+          (TEX_1D_F32_F32_GRAD_RR $t, $s, $x, $gradx, $grady)>;
+def : Pat<(int_nvvm_tex_1d_grad_v4s32_f32 i64:$t, i64:$s, f32:$x, f32:$gradx, f32:$grady),
+          (TEX_1D_S32_F32_GRAD_RR $t, $s, $x, $gradx, $grady)>;
+def : Pat<(int_nvvm_tex_1d_grad_v4u32_f32 i64:$t, i64:$s, f32:$x, f32:$gradx, f32:$grady),
+          (TEX_1D_U32_F32_GRAD_RR $t, $s, $x, $gradx, $grady)>;
+
+def : Pat<(int_nvvm_tex_1d_array_v4f32_f32 i64:$t, i64:$s, i32:$l, f32:$x),
+          (TEX_1D_ARRAY_F32_F32_RR $t, $s, $l, $x)>;
+def : Pat<(int_nvvm_tex_1d_array_v4f32_s32 i64:$t, i64:$s, i32:$l, i32:$x),
+          (TEX_1D_ARRAY_F32_S32_RR $t, $s, $l, $x)>;
+def : Pat<(int_nvvm_tex_1d_array_v4s32_s32 i64:$t, i64:$s, i32:$l, i32:$x),
+          (TEX_1D_ARRAY_S32_S32_RR $t, $s, $l, $x)>;
+def : Pat<(int_nvvm_tex_1d_array_v4s32_f32 i64:$t, i64:$s, i32:$l, f32:$x),
+          (TEX_1D_ARRAY_S32_F32_RR $t, $s, $l, $x)>;
+def : Pat<(int_nvvm_tex_1d_array_v4u32_s32 i64:$t, i64:$s, i32:$l, i32:$x),
+          (TEX_1D_ARRAY_U32_S32_RR $t, $s, $l, $x)>;
+def : Pat<(int_nvvm_tex_1d_array_v4u32_f32 i64:$t, i64:$s, i32:$l, f32:$x),
+          (TEX_1D_ARRAY_U32_F32_RR $t, $s, $l, $x)>;
+
+def : Pat<(int_nvvm_tex_1d_array_level_v4f32_f32 i64:$t, i64:$s, i32:$l, f32:$x, f32:$lod),
+          (TEX_1D_ARRAY_F32_F32_LEVEL_RR $t, $s, $l, $x, $lod)>;
+def : Pat<(int_nvvm_tex_1d_array_level_v4s32_f32 i64:$t, i64:$s, i32:$l, f32:$x, f32:$lod),
+          (TEX_1D_ARRAY_S32_F32_LEVEL_RR $t, $s, $l, $x, $lod)>;
+def : Pat<(int_nvvm_tex_1d_array_level_v4u32_f32 i64:$t, i64:$s, i32:$l, f32:$x, f32:$lod),
+          (TEX_1D_ARRAY_U32_F32_LEVEL_RR $t, $s, $l, $x, $lod)>;
+
+def : Pat<(int_nvvm_tex_1d_array_grad_v4f32_f32 i64:$t, i64:$s, i32:$l, f32:$x, f32:$gradx, f32:$grady),
+          (TEX_1D_ARRAY_F32_F32_GRAD_RR $t, $s, $l, $x, $gradx, $grady)>;
+def : Pat<(int_nvvm_tex_1d_array_grad_v4s32_f32 i64:$t, i64:$s, i32:$l, f32:$x, f32:$gradx, f32:$grady),
+          (TEX_1D_ARRAY_S32_F32_GRAD_RR $t, $s, $l, $x, $gradx, $grady)>;
+def : Pat<(int_nvvm_tex_1d_array_grad_v4u32_f32 i64:$t, i64:$s, i32:$l, f32:$x, f32:$gradx, f32:$grady),
+          (TEX_1D_ARRAY_U32_F32_GRAD_RR $t, $s, $l, $x, $gradx, $grady)>;
+
+def : Pat<(int_nvvm_tex_2d_v4f32_f32 i64:$t, i64:$s, f32:$x, f32:$y),
+          (TEX_2D_F32_F32_RR $t, $s, $x, $y)>;
+def : Pat<(int_nvvm_tex_2d_v4f32_s32 i64:$t, i64:$s, i32:$x, i32:$y),
+          (TEX_2D_F32_S32_RR $t, $s, $x, $y)>;
+def : Pat<(int_nvvm_tex_2d_v4s32_s32 i64:$t, i64:$s, i32:$x, i32:$y),
+          (TEX_2D_S32_S32_RR $t, $s, $x, $y)>;
+def : Pat<(int_nvvm_tex_2d_v4s32_f32 i64:$t, i64:$s, f32:$x, f32:$y),
+          (TEX_2D_S32_F32_RR $t, $s, $x, $y)>;
+def : Pat<(int_nvvm_tex_2d_v4u32_s32 i64:$t, i64:$s, i32:$x, i32:$y),
+          (TEX_2D_U32_S32_RR $t, $s, $x, $y)>;
+def : Pat<(int_nvvm_tex_2d_v4u32_f32 i64:$t, i64:$s, f32:$x, f32:$y),
+          (TEX_2D_U32_F32_RR $t, $s, $x, $y)>;
+
+def : Pat<(int_nvvm_tex_2d_level_v4f32_f32 i64:$t, i64:$s, f32:$x, f32:$y, f32:$lod),
+          (TEX_2D_F32_F32_LEVEL_RR $t, $s, $x, $y, $lod)>;
+def : Pat<(int_nvvm_tex_2d_level_v4s32_f32 i64:$t, i64:$s, f32:$x, f32:$y, f32:$lod),
+          (TEX_2D_S32_F32_LEVEL_RR $t, $s, $x, $y, $lod)>;
+def : Pat<(int_nvvm_tex_2d_level_v4u32_f32 i64:$t, i64:$s, f32:$x, f32:$y, f32:$lod),
+          (TEX_2D_U32_F32_LEVEL_RR $t, $s, $x, $y, $lod)>;
+
+def : Pat<(int_nvvm_tex_2d_grad_v4f32_f32 i64:$t, i64:$s, f32:$x, f32:$y, f32:$gradx0, f32:$gradx1, f32:$grady0, f32:$grady1),
+          (TEX_2D_F32_F32_GRAD_RR $t, $s, $x, $y, $gradx0, $gradx1, $grady0, $grady1)>;
+def : Pat<(int_nvvm_tex_2d_grad_v4s32_f32 i64:$t, i64:$s, f32:$x, f32:$y, f32:$gradx0, f32:$gradx1, f32:$grady0, f32:$grady1),
+          (TEX_2D_S32_F32_GRAD_RR $t, $s, $x, $y, $gradx0, $gradx1, $grady0, $grady1)>;
+def : Pat<(int_nvvm_tex_2d_grad_v4u32_f32 i64:$t, i64:$s, f32:$x, f32:$y, f32:$gradx0, f32:$gradx1, f32:$grady0, f32:$grady1),
+          (TEX_2D_U32_F32_GRAD_RR $t, $s, $x, $y, $gradx0, $gradx1, $grady0, $grady1)>;
+
+def : Pat<(int_nvvm_tex_2d_array_v4f32_f32 i64:$t, i64:$s, i32:$l, f32:$x, f32:$y),
+          (TEX_2D_ARRAY_F32_F32_RR $t, $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_tex_2d_array_v4f32_s32 i64:$t, i64:$s, i32:$l, i32:$x, i32:$y),
+          (TEX_2D_ARRAY_F32_S32_RR $t, $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_tex_2d_array_v4s32_s32 i64:$t, i64:$s, i32:$l, i32:$x, i32:$y),
+          (TEX_2D_ARRAY_S32_S32_RR $t, $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_tex_2d_array_v4s32_f32 i64:$t, i64:$s, i32:$l, f32:$x, f32:$y),
+          (TEX_2D_ARRAY_S32_F32_RR $t, $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_tex_2d_array_v4u32_s32 i64:$t, i64:$s, i32:$l, i32:$x, i32:$y),
+          (TEX_2D_ARRAY_U32_S32_RR $t, $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_tex_2d_array_v4u32_f32 i64:$t, i64:$s, i32:$l, f32:$x, f32:$y),
+          (TEX_2D_ARRAY_U32_F32_RR $t, $s, $l, $x, $y)>;
+
+def : Pat<(int_nvvm_tex_2d_array_level_v4f32_f32 i64:$t, i64:$s, i32:$l, f32:$x, f32:$y, f32:$lod),
+          (TEX_2D_ARRAY_F32_F32_LEVEL_RR $t, $s, $l, $x, $y, $lod)>;
+def : Pat<(int_nvvm_tex_2d_array_level_v4s32_f32 i64:$t, i64:$s, i32:$l, f32:$x, f32:$y, f32:$lod),
+          (TEX_2D_ARRAY_S32_F32_LEVEL_RR $t, $s, $l, $x, $y, $lod)>;
+def : Pat<(int_nvvm_tex_2d_array_level_v4u32_f32 i64:$t, i64:$s, i32:$l, f32:$x, f32:$y, f32:$lod),
+          (TEX_2D_ARRAY_U32_F32_LEVEL_RR $t, $s, $l, $x, $y, $lod)>;
+
+def : Pat<(int_nvvm_tex_2d_array_grad_v4f32_f32 i64:$t, i64:$s, i32:$l, f32:$x, f32:$y, f32:$gradx0, f32:$gradx1, f32:$grady0, f32:$grady1),
+          (TEX_2D_ARRAY_F32_F32_GRAD_RR $t, $s, $l, $x, $y, $gradx0, $gradx1, $grady0, $grady1)>;
+def : Pat<(int_nvvm_tex_2d_array_grad_v4s32_f32 i64:$t, i64:$s, i32:$l, f32:$x, f32:$y, f32:$gradx0, f32:$gradx1, f32:$grady0, f32:$grady1),
+          (TEX_2D_ARRAY_S32_F32_GRAD_RR $t, $s, $l, $x, $y, $gradx0, $gradx1, $grady0, $grady1)>;
+def : Pat<(int_nvvm_tex_2d_array_grad_v4u32_f32 i64:$t, i64:$s, i32:$l, f32:$x, f32:$y, f32:$gradx0, f32:$gradx1, f32:$grady0, f32:$grady1),
+          (TEX_2D_ARRAY_U32_F32_GRAD_RR $t, $s, $l, $x, $y, $gradx0, $gradx1, $grady0, $grady1)>;
+
+def : Pat<(int_nvvm_tex_3d_v4f32_f32 i64:$t, i64:$s, f32:$x, f32:$y, f32:$z),
+          (TEX_3D_F32_F32_RR $t, $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_tex_3d_v4f32_s32 i64:$t, i64:$s, i32:$x, i32:$y, i32:$z),
+          (TEX_3D_F32_S32_RR $t, $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_tex_3d_v4s32_s32 i64:$t, i64:$s, i32:$x, i32:$y, i32:$z),
+          (TEX_3D_S32_S32_RR $t, $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_tex_3d_v4s32_f32 i64:$t, i64:$s, f32:$x, f32:$y, f32:$z),
+          (TEX_3D_S32_F32_RR $t, $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_tex_3d_v4u32_s32 i64:$t, i64:$s, i32:$x, i32:$y, i32:$z),
+          (TEX_3D_U32_S32_RR $t, $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_tex_3d_v4u32_f32 i64:$t, i64:$s, f32:$x, f32:$y, f32:$z),
+          (TEX_3D_U32_F32_RR $t, $s, $x, $y, $z)>;
+
+def : Pat<(int_nvvm_tex_3d_level_v4f32_f32 i64:$t, i64:$s, f32:$x, f32:$y, f32:$z, f32:$lod),
+          (TEX_3D_F32_F32_LEVEL_RR $t, $s, $x, $y, $z, $lod)>;
+def : Pat<(int_nvvm_tex_3d_level_v4s32_f32 i64:$t, i64:$s, f32:$x, f32:$y, f32:$z, f32:$lod),
+          (TEX_3D_S32_F32_LEVEL_RR $t, $s, $x, $y, $z, $lod)>;
+def : Pat<(int_nvvm_tex_3d_level_v4u32_f32 i64:$t, i64:$s, f32:$x, f32:$y, f32:$z, f32:$lod),
+          (TEX_3D_U32_F32_LEVEL_RR $t, $s, $x, $y, $z, $lod)>;
+
+def : Pat<(int_nvvm_tex_3d_grad_v4f32_f32 i64:$t, i64:$s, f32:$x, f32:$y, f32:$z, f32:$gradx0, f32:$gradx1, f32:$gradx2, f32:$grady0, f32:$grady1, f32:$grady2),
+          (TEX_3D_F32_F32_GRAD_RR $t, $s, $x, $y, $z, $gradx0, $gradx1, $gradx2, $grady0, $grady1, $grady2)>;
+def : Pat<(int_nvvm_tex_3d_grad_v4s32_f32 i64:$t, i64:$s, f32:$x, f32:$y, f32:$z, f32:$gradx0, f32:$gradx1, f32:$gradx2, f32:$grady0, f32:$grady1, f32:$grady2),
+          (TEX_3D_S32_F32_GRAD_RR $t, $s, $x, $y, $z, $gradx0, $gradx1, $gradx2, $grady0, $grady1, $grady2)>;
+def : Pat<(int_nvvm_tex_3d_grad_v4u32_f32 i64:$t, i64:$s, f32:$x, f32:$y, f32:$z, f32:$gradx0, f32:$gradx1, f32:$gradx2, f32:$grady0, f32:$grady1, f32:$grady2),
+          (TEX_3D_U32_F32_GRAD_RR $t, $s, $x, $y, $z, $gradx0, $gradx1, $gradx2, $grady0, $grady1, $grady2)>;
+
+def : Pat<(int_nvvm_tex_cube_v4f32_f32 i64:$t, i64:$s, f32:$x, f32:$y, f32:$z),
+          (TEX_CUBE_F32_F32_RR $t, $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_tex_cube_v4s32_f32 i64:$t, i64:$s, f32:$x, f32:$y, f32:$z),
+          (TEX_CUBE_S32_F32_RR $t, $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_tex_cube_v4u32_f32 i64:$t, i64:$s, f32:$x, f32:$y, f32:$z),
+          (TEX_CUBE_U32_F32_RR $t, $s, $x, $y, $z)>;
+
+def : Pat<(int_nvvm_tex_cube_level_v4f32_f32 i64:$t, i64:$s, f32:$x, f32:$y, f32:$z, f32:$lod),
+          (TEX_CUBE_F32_F32_LEVEL_RR $t, $s, $x, $y, $z, $lod)>;
+def : Pat<(int_nvvm_tex_cube_level_v4s32_f32 i64:$t, i64:$s, f32:$x, f32:$y, f32:$z, f32:$lod),
+          (TEX_CUBE_S32_F32_LEVEL_RR $t, $s, $x, $y, $z, $lod)>;
+def : Pat<(int_nvvm_tex_cube_level_v4u32_f32 i64:$t, i64:$s, f32:$x, f32:$y, f32:$z, f32:$lod),
+          (TEX_CUBE_U32_F32_LEVEL_RR $t, $s, $x, $y, $z, $lod)>;
+
+def : Pat<(int_nvvm_tex_cube_array_v4f32_f32 i64:$t, i64:$s, i32:$l, f32:$x, f32:$y, f32:$z),
+          (TEX_CUBE_ARRAY_F32_F32_RR $t, $s, $l, $x, $y, $z)>;
+def : Pat<(int_nvvm_tex_cube_array_v4s32_f32 i64:$t, i64:$s, i32:$l, f32:$x, f32:$y, f32:$z),
+          (TEX_CUBE_ARRAY_S32_F32_RR $t, $s, $l, $x, $y, $z)>;
+def : Pat<(int_nvvm_tex_cube_array_v4u32_f32 i64:$t, i64:$s, i32:$l, f32:$x, f32:$y, f32:$z),
+          (TEX_CUBE_ARRAY_U32_F32_RR $t, $s, $l, $x, $y, $z)>;
+
+def : Pat<(int_nvvm_tex_cube_array_level_v4f32_f32 i64:$t, i64:$s, i32:$l, f32:$x, f32:$y, f32:$z, f32:$lod),
+          (TEX_CUBE_ARRAY_F32_F32_LEVEL_RR $t, $s, $l, $x, $y, $z, $lod)>;
+def : Pat<(int_nvvm_tex_cube_array_level_v4s32_f32 i64:$t, i64:$s, i32:$l, f32:$x, f32:$y, f32:$z, f32:$lod),
+          (TEX_CUBE_ARRAY_S32_F32_LEVEL_RR $t, $s, $l, $x, $y, $z, $lod)>;
+def : Pat<(int_nvvm_tex_cube_array_level_v4u32_f32 i64:$t, i64:$s, i32:$l, f32:$x, f32:$y, f32:$z, f32:$lod),
+          (TEX_CUBE_ARRAY_U32_F32_LEVEL_RR $t, $s, $l, $x, $y, $z, $lod)>;
+
+def : Pat<(int_nvvm_tld4_r_2d_v4f32_f32 i64:$t, i64:$s, f32:$x, f32:$y),
+          (TLD4_R_2D_F32_F32_RR $t, $s, $x, $y)>;
+def : Pat<(int_nvvm_tld4_g_2d_v4f32_f32 i64:$t, i64:$s, f32:$x, f32:$y),
+          (TLD4_G_2D_F32_F32_RR $t, $s, $x, $y)>;
+def : Pat<(int_nvvm_tld4_b_2d_v4f32_f32 i64:$t, i64:$s, f32:$x, f32:$y),
+          (TLD4_B_2D_F32_F32_RR $t, $s, $x, $y)>;
+def : Pat<(int_nvvm_tld4_a_2d_v4f32_f32 i64:$t, i64:$s, f32:$x, f32:$y),
+          (TLD4_A_2D_F32_F32_RR $t, $s, $x, $y)>;
+def : Pat<(int_nvvm_tld4_r_2d_v4s32_f32 i64:$t, i64:$s, f32:$x, f32:$y),
+          (TLD4_R_2D_S32_F32_RR $t, $s, $x, $y)>;
+def : Pat<(int_nvvm_tld4_g_2d_v4s32_f32 i64:$t, i64:$s, f32:$x, f32:$y),
+          (TLD4_G_2D_S32_F32_RR $t, $s, $x, $y)>;
+def : Pat<(int_nvvm_tld4_b_2d_v4s32_f32 i64:$t, i64:$s, f32:$x, f32:$y),
+          (TLD4_B_2D_S32_F32_RR $t, $s, $x, $y)>;
+def : Pat<(int_nvvm_tld4_a_2d_v4s32_f32 i64:$t, i64:$s, f32:$x, f32:$y),
+          (TLD4_A_2D_S32_F32_RR $t, $s, $x, $y)>;
+def : Pat<(int_nvvm_tld4_r_2d_v4u32_f32 i64:$t, i64:$s, f32:$x, f32:$y),
+          (TLD4_R_2D_U32_F32_RR $t, $s, $x, $y)>;
+def : Pat<(int_nvvm_tld4_g_2d_v4u32_f32 i64:$t, i64:$s, f32:$x, f32:$y),
+          (TLD4_G_2D_U32_F32_RR $t, $s, $x, $y)>;
+def : Pat<(int_nvvm_tld4_b_2d_v4u32_f32 i64:$t, i64:$s, f32:$x, f32:$y),
+          (TLD4_B_2D_U32_F32_RR $t, $s, $x, $y)>;
+def : Pat<(int_nvvm_tld4_a_2d_v4u32_f32 i64:$t, i64:$s, f32:$x, f32:$y),
+          (TLD4_A_2D_U32_F32_RR $t, $s, $x, $y)>;
+
+def : Pat<(int_nvvm_tex_unified_1d_v4f32_s32 i64:$t, i32:$x),
+          (TEX_UNIFIED_1D_F32_S32_R $t, $x)>;
+def : Pat<(int_nvvm_tex_unified_1d_v4f32_f32 i64:$t, f32:$x),
+          (TEX_UNIFIED_1D_F32_F32_R $t, $x)>;
+def : Pat<(int_nvvm_tex_unified_1d_v4s32_s32 i64:$t, i32:$x),
+          (TEX_UNIFIED_1D_S32_S32_R $t, $x)>;
+def : Pat<(int_nvvm_tex_unified_1d_v4s32_f32 i64:$t, f32:$x),
+          (TEX_UNIFIED_1D_S32_F32_R $t, $x)>;
+def : Pat<(int_nvvm_tex_unified_1d_v4u32_s32 i64:$t, i32:$x),
+          (TEX_UNIFIED_1D_U32_S32_R $t, $x)>;
+def : Pat<(int_nvvm_tex_unified_1d_v4u32_f32 i64:$t, f32:$x),
+          (TEX_UNIFIED_1D_U32_F32_R $t, $x)>;
+
+def : Pat<(int_nvvm_tex_unified_1d_level_v4f32_f32 i64:$t, f32:$x, f32:$lod),
+          (TEX_UNIFIED_1D_F32_F32_LEVEL_R $t, $x, $lod)>;
+def : Pat<(int_nvvm_tex_unified_1d_level_v4s32_f32 i64:$t, f32:$x, f32:$lod),
+          (TEX_UNIFIED_1D_S32_F32_LEVEL_R $t, $x, $lod)>;
+def : Pat<(int_nvvm_tex_unified_1d_level_v4u32_f32 i64:$t, f32:$x, f32:$lod),
+          (TEX_UNIFIED_1D_U32_F32_LEVEL_R $t, $x, $lod)>;
+
+def : Pat<(int_nvvm_tex_unified_1d_grad_v4f32_f32 i64:$t, f32:$x, f32:$gradx, f32:$grady),
+          (TEX_UNIFIED_1D_F32_F32_GRAD_R $t, $x, $gradx, $grady)>;
+def : Pat<(int_nvvm_tex_unified_1d_grad_v4s32_f32 i64:$t, f32:$x, f32:$gradx, f32:$grady),
+          (TEX_UNIFIED_1D_S32_F32_GRAD_R $t, $x, $gradx, $grady)>;
+def : Pat<(int_nvvm_tex_unified_1d_grad_v4u32_f32 i64:$t, f32:$x, f32:$gradx, f32:$grady),
+          (TEX_UNIFIED_1D_U32_F32_GRAD_R $t, $x, $gradx, $grady)>;
+
+def : Pat<(int_nvvm_tex_unified_1d_array_v4f32_s32 i64:$t, i32:$l, i32:$x),
+          (TEX_UNIFIED_1D_ARRAY_F32_S32_R $t, $l, $x)>;
+def : Pat<(int_nvvm_tex_unified_1d_array_v4f32_f32 i64:$t, i32:$l, f32:$x),
+          (TEX_UNIFIED_1D_ARRAY_F32_F32_R $t, $l, $x)>;
+def : Pat<(int_nvvm_tex_unified_1d_array_v4s32_s32 i64:$t, i32:$l, i32:$x),
+          (TEX_UNIFIED_1D_ARRAY_S32_S32_R $t, $l, $x)>;
+def : Pat<(int_nvvm_tex_unified_1d_array_v4s32_f32 i64:$t, i32:$l, f32:$x),
+          (TEX_UNIFIED_1D_ARRAY_S32_F32_R $t, $l, $x)>;
+def : Pat<(int_nvvm_tex_unified_1d_array_v4u32_s32 i64:$t, i32:$l, i32:$x),
+          (TEX_UNIFIED_1D_ARRAY_U32_S32_R $t, $l, $x)>;
+def : Pat<(int_nvvm_tex_unified_1d_array_v4u32_f32 i64:$t, i32:$l, f32:$x),
+          (TEX_UNIFIED_1D_ARRAY_U32_F32_R $t, $l, $x)>;
+
+def : Pat<(int_nvvm_tex_unified_1d_array_level_v4f32_f32 i64:$t, i32:$l, f32:$x, f32:$lod),
+          (TEX_UNIFIED_1D_ARRAY_F32_F32_LEVEL_R $t, $l, $x, $lod)>;
+def : Pat<(int_nvvm_tex_unified_1d_array_level_v4s32_f32 i64:$t, i32:$l, f32:$x, f32:$lod),
+          (TEX_UNIFIED_1D_ARRAY_S32_F32_LEVEL_R $t, $l, $x, $lod)>;
+def : Pat<(int_nvvm_tex_unified_1d_array_level_v4u32_f32 i64:$t, i32:$l, f32:$x, f32:$lod),
+          (TEX_UNIFIED_1D_ARRAY_U32_F32_LEVEL_R $t, $l, $x, $lod)>;
+
+def : Pat<(int_nvvm_tex_unified_1d_array_grad_v4f32_f32 i64:$t, i32:$l, f32:$x, f32:$gradx, f32:$grady),
+          (TEX_UNIFIED_1D_ARRAY_F32_F32_GRAD_R $t, $l, $x, $gradx, $grady)>;
+def : Pat<(int_nvvm_tex_unified_1d_array_grad_v4s32_f32 i64:$t, i32:$l, f32:$x, f32:$gradx, f32:$grady),
+          (TEX_UNIFIED_1D_ARRAY_S32_F32_GRAD_R $t, $l, $x, $gradx, $grady)>;
+def : Pat<(int_nvvm_tex_unified_1d_array_grad_v4u32_f32 i64:$t, i32:$l, f32:$x, f32:$gradx, f32:$grady),
+          (TEX_UNIFIED_1D_ARRAY_U32_F32_GRAD_R $t, $l, $x, $gradx, $grady)>;
+
+def : Pat<(int_nvvm_tex_unified_2d_v4f32_s32 i64:$t, i32:$x, i32:$y),
+          (TEX_UNIFIED_2D_F32_S32_R $t, $x, $y)>;
+def : Pat<(int_nvvm_tex_unified_2d_v4f32_f32 i64:$t, f32:$x, f32:$y),
+          (TEX_UNIFIED_2D_F32_F32_R $t, $x, $y)>;
+def : Pat<(int_nvvm_tex_unified_2d_v4s32_s32 i64:$t, i32:$x, i32:$y),
+          (TEX_UNIFIED_2D_S32_S32_R $t, $x, $y)>;
+def : Pat<(int_nvvm_tex_unified_2d_v4s32_f32 i64:$t, f32:$x, f32:$y),
+          (TEX_UNIFIED_2D_S32_F32_R $t, $x, $y)>;
+def : Pat<(int_nvvm_tex_unified_2d_v4u32_s32 i64:$t, i32:$x, i32:$y),
+          (TEX_UNIFIED_2D_U32_S32_R $t, $x, $y)>;
+def : Pat<(int_nvvm_tex_unified_2d_v4u32_f32 i64:$t, f32:$x, f32:$y),
+          (TEX_UNIFIED_2D_U32_F32_R $t, $x, $y)>;
+
+def : Pat<(int_nvvm_tex_unified_2d_level_v4f32_f32 i64:$t, f32:$x, f32:$y, f32:$lod),
+          (TEX_UNIFIED_2D_F32_F32_LEVEL_R $t, $x, $y, $lod)>;
+def : Pat<(int_nvvm_tex_unified_2d_level_v4s32_f32 i64:$t, f32:$x, f32:$y, f32:$lod),
+          (TEX_UNIFIED_2D_S32_F32_LEVEL_R $t, $x, $y, $lod)>;
+def : Pat<(int_nvvm_tex_unified_2d_level_v4u32_f32 i64:$t, f32:$x, f32:$y, f32:$lod),
+          (TEX_UNIFIED_2D_U32_F32_LEVEL_R $t, $x, $y, $lod)>;
+
+def : Pat<(int_nvvm_tex_unified_2d_grad_v4f32_f32 i64:$t, f32:$x, f32:$y, f32:$gradx0, f32:$gradx1, f32:$grady0, f32:$grady1),
+          (TEX_UNIFIED_2D_F32_F32_GRAD_R $t, $x, $y, $gradx0, $gradx1, $grady0, $grady1)>;
+def : Pat<(int_nvvm_tex_unified_2d_grad_v4s32_f32 i64:$t, f32:$x, f32:$y, f32:$gradx0, f32:$gradx1, f32:$grady0, f32:$grady1),
+          (TEX_UNIFIED_2D_S32_F32_GRAD_R $t, $x, $y, $gradx0, $gradx1, $grady0, $grady1)>;
+def : Pat<(int_nvvm_tex_unified_2d_grad_v4u32_f32 i64:$t, f32:$x, f32:$y, f32:$gradx0, f32:$gradx1, f32:$grady0, f32:$grady1),
+          (TEX_UNIFIED_2D_U32_F32_GRAD_R $t, $x, $y, $gradx0, $gradx1, $grady0, $grady1)>;
+
+def : Pat<(int_nvvm_tex_unified_2d_array_v4f32_s32 i64:$t, i32:$l, i32:$x, i32:$y),
+          (TEX_UNIFIED_2D_ARRAY_F32_S32_R $t, $l, $x, $y)>;
+def : Pat<(int_nvvm_tex_unified_2d_array_v4f32_f32 i64:$t, i32:$l, f32:$x, f32:$y),
+          (TEX_UNIFIED_2D_ARRAY_F32_F32_R $t, $l, $x, $y)>;
+def : Pat<(int_nvvm_tex_unified_2d_array_v4s32_s32 i64:$t, i32:$l, i32:$x, i32:$y),
+          (TEX_UNIFIED_2D_ARRAY_S32_S32_R $t, $l, $x, $y)>;
+def : Pat<(int_nvvm_tex_unified_2d_array_v4s32_f32 i64:$t, i32:$l, f32:$x, f32:$y),
+          (TEX_UNIFIED_2D_ARRAY_S32_F32_R $t, $l, $x, $y)>;
+def : Pat<(int_nvvm_tex_unified_2d_array_v4u32_s32 i64:$t, i32:$l, i32:$x, i32:$y),
+          (TEX_UNIFIED_2D_ARRAY_U32_S32_R $t, $l, $x, $y)>;
+def : Pat<(int_nvvm_tex_unified_2d_array_v4u32_f32 i64:$t, i32:$l, f32:$x, f32:$y),
+          (TEX_UNIFIED_2D_ARRAY_U32_F32_R $t, $l, $x, $y)>;
+
+def : Pat<(int_nvvm_tex_unified_2d_array_level_v4f32_f32 i64:$t, i32:$l, f32:$x, f32:$y, f32:$lod),
+          (TEX_UNIFIED_2D_ARRAY_F32_F32_LEVEL_R $t, $l, $x, $y, $lod)>;
+def : Pat<(int_nvvm_tex_unified_2d_array_level_v4s32_f32 i64:$t, i32:$l, f32:$x, f32:$y, f32:$lod),
+          (TEX_UNIFIED_2D_ARRAY_S32_F32_LEVEL_R $t, $l, $x, $y, $lod)>;
+def : Pat<(int_nvvm_tex_unified_2d_array_level_v4u32_f32 i64:$t, i32:$l, f32:$x, f32:$y, f32:$lod),
+          (TEX_UNIFIED_2D_ARRAY_U32_F32_LEVEL_R $t, $l, $x, $y, $lod)>;
+
+def : Pat<(int_nvvm_tex_unified_2d_array_grad_v4f32_f32 i64:$t, i32:$l, f32:$x, f32:$y, f32:$gradx0, f32:$gradx1, f32:$grady0, f32:$grady1),
+          (TEX_UNIFIED_2D_ARRAY_F32_F32_GRAD_R $t, $l, $x, $y, $gradx0, $gradx1, $grady0, $grady1)>;
+def : Pat<(int_nvvm_tex_unified_2d_array_grad_v4s32_f32 i64:$t, i32:$l, f32:$x, f32:$y, f32:$gradx0, f32:$gradx1, f32:$grady0, f32:$grady1),
+          (TEX_UNIFIED_2D_ARRAY_S32_F32_GRAD_R $t, $l, $x, $y, $gradx0, $gradx1, $grady0, $grady1)>;
+def : Pat<(int_nvvm_tex_unified_2d_array_grad_v4u32_f32 i64:$t, i32:$l, f32:$x, f32:$y, f32:$gradx0, f32:$gradx1, f32:$grady0, f32:$grady1),
+          (TEX_UNIFIED_2D_ARRAY_U32_F32_GRAD_R $t, $l, $x, $y, $gradx0, $gradx1, $grady0, $grady1)>;
+
+def : Pat<(int_nvvm_tex_unified_3d_v4f32_s32 i64:$t, i32:$x, i32:$y, i32:$z),
+          (TEX_UNIFIED_3D_F32_S32_R $t, $x, $y, $z)>;
+def : Pat<(int_nvvm_tex_unified_3d_v4f32_f32 i64:$t, f32:$x, f32:$y, f32:$z),
+          (TEX_UNIFIED_3D_F32_F32_R $t, $x, $y, $z)>;
+def : Pat<(int_nvvm_tex_unified_3d_v4s32_s32 i64:$t, i32:$x, i32:$y, i32:$z),
+          (TEX_UNIFIED_3D_S32_S32_R $t, $x, $y, $z)>;
+def : Pat<(int_nvvm_tex_unified_3d_v4s32_f32 i64:$t, f32:$x, f32:$y, f32:$z),
+          (TEX_UNIFIED_3D_S32_F32_R $t, $x, $y, $z)>;
+def : Pat<(int_nvvm_tex_unified_3d_v4u32_s32 i64:$t, i32:$x, i32:$y, i32:$z),
+          (TEX_UNIFIED_3D_U32_S32_R $t, $x, $y, $z)>;
+def : Pat<(int_nvvm_tex_unified_3d_v4u32_f32 i64:$t, f32:$x, f32:$y, f32:$z),
+          (TEX_UNIFIED_3D_U32_F32_R $t, $x, $y, $z)>;
+
+def : Pat<(int_nvvm_tex_unified_3d_level_v4f32_f32 i64:$t, f32:$x, f32:$y, f32:$z, f32:$lod),
+          (TEX_UNIFIED_3D_F32_F32_LEVEL_R $t, $x, $y, $z, $lod)>;
+def : Pat<(int_nvvm_tex_unified_3d_level_v4s32_f32 i64:$t, f32:$x, f32:$y, f32:$z, f32:$lod),
+          (TEX_UNIFIED_3D_S32_F32_LEVEL_R $t, $x, $y, $z, $lod)>;
+def : Pat<(int_nvvm_tex_unified_3d_level_v4u32_f32 i64:$t, f32:$x, f32:$y, f32:$z, f32:$lod),
+          (TEX_UNIFIED_3D_U32_F32_LEVEL_R $t, $x, $y, $z, $lod)>;
+
+def : Pat<(int_nvvm_tex_unified_3d_grad_v4f32_f32 i64:$t, f32:$x, f32:$y, f32:$z, f32:$gradx0, f32:$gradx1, f32:$gradx2, f32:$grady0, f32:$grady1, f32:$grady2),
+          (TEX_UNIFIED_3D_F32_F32_GRAD_R $t, $x, $y, $z, $gradx0, $gradx1, $gradx2, $grady0, $grady1, $grady2)>;
+def : Pat<(int_nvvm_tex_unified_3d_grad_v4s32_f32 i64:$t, f32:$x, f32:$y, f32:$z, f32:$gradx0, f32:$gradx1, f32:$gradx2, f32:$grady0, f32:$grady1, f32:$grady2),
+          (TEX_UNIFIED_3D_S32_F32_GRAD_R $t, $x, $y, $z, $gradx0, $gradx1, $gradx2, $grady0, $grady1, $grady2)>;
+def : Pat<(int_nvvm_tex_unified_3d_grad_v4u32_f32 i64:$t, f32:$x, f32:$y, f32:$z, f32:$gradx0, f32:$gradx1, f32:$gradx2, f32:$grady0, f32:$grady1, f32:$grady2),
+          (TEX_UNIFIED_3D_U32_F32_GRAD_R $t, $x, $y, $z, $gradx0, $gradx1, $gradx2, $grady0, $grady1, $grady2)>;
+
+def : Pat<(int_nvvm_tex_unified_cube_v4f32_f32 i64:$t, f32:$x, f32:$y, f32:$z),
+          (TEX_UNIFIED_CUBE_F32_F32_R $t, $x, $y, $z)>;
+def : Pat<(int_nvvm_tex_unified_cube_v4s32_f32 i64:$t, f32:$x, f32:$y, f32:$z),
+          (TEX_UNIFIED_CUBE_S32_F32_R $t, $x, $y, $z)>;
+def : Pat<(int_nvvm_tex_unified_cube_v4u32_f32 i64:$t, f32:$x, f32:$y, f32:$z),
+          (TEX_UNIFIED_CUBE_U32_F32_R $t, $x, $y, $z)>;
+
+def : Pat<(int_nvvm_tex_unified_cube_level_v4f32_f32 i64:$t, f32:$x, f32:$y, f32:$z, f32:$lod),
+          (TEX_UNIFIED_CUBE_F32_F32_LEVEL_R $t, $x, $y, $z, $lod)>;
+def : Pat<(int_nvvm_tex_unified_cube_level_v4s32_f32 i64:$t, f32:$x, f32:$y, f32:$z, f32:$lod),
+          (TEX_UNIFIED_CUBE_S32_F32_LEVEL_R $t, $x, $y, $z, $lod)>;
+def : Pat<(int_nvvm_tex_unified_cube_level_v4u32_f32 i64:$t, f32:$x, f32:$y, f32:$z, f32:$lod),
+          (TEX_UNIFIED_CUBE_U32_F32_LEVEL_R $t, $x, $y, $z, $lod)>;
+
+def : Pat<(int_nvvm_tex_unified_cube_array_v4f32_f32 i64:$t, i32:$l, f32:$x, f32:$y, f32:$z),
+          (TEX_UNIFIED_CUBE_ARRAY_F32_F32_R $t, $l, $x, $y, $z)>;
+def : Pat<(int_nvvm_tex_unified_cube_array_v4s32_f32 i64:$t, i32:$l, f32:$x, f32:$y, f32:$z),
+          (TEX_UNIFIED_CUBE_ARRAY_S32_F32_R $t, $l, $x, $y, $z)>;
+def : Pat<(int_nvvm_tex_unified_cube_array_v4u32_f32 i64:$t, i32:$l, f32:$x, f32:$y, f32:$z),
+          (TEX_UNIFIED_CUBE_ARRAY_U32_F32_R $t, $l, $x, $y, $z)>;
+
+def : Pat<(int_nvvm_tex_unified_cube_array_level_v4f32_f32 i64:$t, i32:$l, f32:$x, f32:$y, f32:$z, f32:$lod),
+          (TEX_UNIFIED_CUBE_ARRAY_F32_F32_LEVEL_R $t, $l, $x, $y, $z, $lod)>;
+def : Pat<(int_nvvm_tex_unified_cube_array_level_v4s32_f32 i64:$t, i32:$l, f32:$x, f32:$y, f32:$z, f32:$lod),
+          (TEX_UNIFIED_CUBE_ARRAY_S32_F32_LEVEL_R $t, $l, $x, $y, $z, $lod)>;
+def : Pat<(int_nvvm_tex_unified_cube_array_level_v4u32_f32 i64:$t, i32:$l, f32:$x, f32:$y, f32:$z, f32:$lod),
+          (TEX_UNIFIED_CUBE_ARRAY_U32_F32_LEVEL_R $t, $l, $x, $y, $z, $lod)>;
+
+def : Pat<(int_nvvm_tex_unified_cube_grad_v4f32_f32 i64:$t, f32:$x, f32:$y, f32:$z, f32:$gradx0, f32:$gradx1, f32:$gradx2, f32:$grady0, f32:$grady1, f32:$grady2),
+          (TEX_UNIFIED_CUBE_F32_F32_GRAD_R $t, $x, $y, $z, $gradx0, $gradx1, $gradx2, $grady0, $grady1, $grady2)>;
+def : Pat<(int_nvvm_tex_unified_cube_grad_v4s32_f32 i64:$t, f32:$x, f32:$y, f32:$z, f32:$gradx0, f32:$gradx1, f32:$gradx2, f32:$grady0, f32:$grady1, f32:$grady2),
+          (TEX_UNIFIED_CUBE_S32_F32_GRAD_R $t, $x, $y, $z, $gradx0, $gradx1, $gradx2, $grady0, $grady1, $grady2)>;
+def : Pat<(int_nvvm_tex_unified_cube_grad_v4u32_f32 i64:$t, f32:$x, f32:$y, f32:$z, f32:$gradx0, f32:$gradx1, f32:$gradx2, f32:$grady0, f32:$grady1, f32:$grady2),
+          (TEX_UNIFIED_CUBE_U32_F32_GRAD_R $t, $x, $y, $z, $gradx0, $gradx1, $gradx2, $grady0, $grady1, $grady2)>;
+
+def : Pat<(int_nvvm_tex_unified_cube_array_grad_v4f32_f32 i64:$t, i32:$l, f32:$x, f32:$y, f32:$z, f32:$gradx0, f32:$gradx1, f32:$gradx2, f32:$grady0, f32:$grady1, f32:$grady2),
+          (TEX_UNIFIED_CUBE_ARRAY_F32_F32_GRAD_R $t, $l, $x, $y, $z, $gradx0, $gradx1, $gradx2, $grady0, $grady1, $grady2)>;
+def : Pat<(int_nvvm_tex_unified_cube_array_grad_v4s32_f32 i64:$t, i32:$l, f32:$x, f32:$y, f32:$z, f32:$gradx0, f32:$gradx1, f32:$gradx2, f32:$grady0, f32:$grady1, f32:$grady2),
+          (TEX_UNIFIED_CUBE_ARRAY_S32_F32_GRAD_R $t, $l, $x, $y, $z, $gradx0, $gradx1, $gradx2, $grady0, $grady1, $grady2)>;
+def : Pat<(int_nvvm_tex_unified_cube_array_grad_v4u32_f32 i64:$t, i32:$l, f32:$x, f32:$y, f32:$z, f32:$gradx0, f32:$gradx1, f32:$gradx2, f32:$grady0, f32:$grady1, f32:$grady2),
+          (TEX_UNIFIED_CUBE_ARRAY_U32_F32_GRAD_R $t, $l, $x, $y, $z, $gradx0, $gradx1, $gradx2, $grady0, $grady1, $grady2)>;
+
+def : Pat<(int_nvvm_tld4_unified_r_2d_v4f32_f32 i64:$t, f32:$x, f32:$y),
+          (TLD4_UNIFIED_R_2D_F32_F32_R $t, $x, $y)>;
+def : Pat<(int_nvvm_tld4_unified_g_2d_v4f32_f32 i64:$t, f32:$x, f32:$y),
+          (TLD4_UNIFIED_G_2D_F32_F32_R $t, $x, $y)>;
+def : Pat<(int_nvvm_tld4_unified_b_2d_v4f32_f32 i64:$t, f32:$x, f32:$y),
+          (TLD4_UNIFIED_B_2D_F32_F32_R $t, $x, $y)>;
+def : Pat<(int_nvvm_tld4_unified_a_2d_v4f32_f32 i64:$t, f32:$x, f32:$y),
+          (TLD4_UNIFIED_A_2D_F32_F32_R $t, $x, $y)>;
+def : Pat<(int_nvvm_tld4_unified_r_2d_v4s32_f32 i64:$t, f32:$x, f32:$y),
+          (TLD4_UNIFIED_R_2D_S32_F32_R $t, $x, $y)>;
+def : Pat<(int_nvvm_tld4_unified_g_2d_v4s32_f32 i64:$t, f32:$x, f32:$y),
+          (TLD4_UNIFIED_G_2D_S32_F32_R $t, $x, $y)>;
+def : Pat<(int_nvvm_tld4_unified_b_2d_v4s32_f32 i64:$t, f32:$x, f32:$y),
+          (TLD4_UNIFIED_B_2D_S32_F32_R $t, $x, $y)>;
+def : Pat<(int_nvvm_tld4_unified_a_2d_v4s32_f32 i64:$t, f32:$x, f32:$y),
+          (TLD4_UNIFIED_A_2D_S32_F32_R $t, $x, $y)>;
+def : Pat<(int_nvvm_tld4_unified_r_2d_v4u32_f32 i64:$t, f32:$x, f32:$y),
+          (TLD4_UNIFIED_R_2D_U32_F32_R $t, $x, $y)>;
+def : Pat<(int_nvvm_tld4_unified_g_2d_v4u32_f32 i64:$t, f32:$x, f32:$y),
+          (TLD4_UNIFIED_G_2D_U32_F32_R $t, $x, $y)>;
+def : Pat<(int_nvvm_tld4_unified_b_2d_v4u32_f32 i64:$t, f32:$x, f32:$y),
+          (TLD4_UNIFIED_B_2D_U32_F32_R $t, $x, $y)>;
+def : Pat<(int_nvvm_tld4_unified_a_2d_v4u32_f32 i64:$t, f32:$x, f32:$y),
+          (TLD4_UNIFIED_A_2D_U32_F32_R $t, $x, $y)>;
+
+def : Pat<(int_nvvm_suld_1d_i8_clamp i64:$s, i32:$x),
+          (SULD_1D_I8_CLAMP_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_i16_clamp i64:$s, i32:$x),
+          (SULD_1D_I16_CLAMP_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_i32_clamp i64:$s, i32:$x),
+          (SULD_1D_I32_CLAMP_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_i64_clamp i64:$s, i32:$x),
+          (SULD_1D_I64_CLAMP_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_v2i8_clamp i64:$s, i32:$x),
+          (SULD_1D_V2I8_CLAMP_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_v2i16_clamp i64:$s, i32:$x),
+          (SULD_1D_V2I16_CLAMP_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_v2i32_clamp i64:$s, i32:$x),
+          (SULD_1D_V2I32_CLAMP_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_v2i64_clamp i64:$s, i32:$x),
+          (SULD_1D_V2I64_CLAMP_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_v4i8_clamp i64:$s, i32:$x),
+          (SULD_1D_V4I8_CLAMP_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_v4i16_clamp i64:$s, i32:$x),
+          (SULD_1D_V4I16_CLAMP_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_v4i32_clamp i64:$s, i32:$x),
+          (SULD_1D_V4I32_CLAMP_R $s, $x)>;
+
+def : Pat<(int_nvvm_suld_1d_array_i8_clamp i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_I8_CLAMP_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_i16_clamp i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_I16_CLAMP_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_i32_clamp i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_I32_CLAMP_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_i64_clamp i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_I64_CLAMP_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_v2i8_clamp i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_V2I8_CLAMP_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_v2i16_clamp i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_V2I16_CLAMP_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_v2i32_clamp i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_V2I32_CLAMP_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_v2i64_clamp i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_V2I64_CLAMP_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_v4i8_clamp i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_V4I8_CLAMP_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_v4i16_clamp i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_V4I16_CLAMP_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_v4i32_clamp i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_V4I32_CLAMP_R $s, $l, $x)>;
+
+def : Pat<(int_nvvm_suld_2d_i8_clamp i64:$s, i32:$x, i32:$y),
+          (SULD_2D_I8_CLAMP_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_i16_clamp i64:$s, i32:$x, i32:$y),
+          (SULD_2D_I16_CLAMP_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_i32_clamp i64:$s, i32:$x, i32:$y),
+          (SULD_2D_I32_CLAMP_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_i64_clamp i64:$s, i32:$x, i32:$y),
+          (SULD_2D_I64_CLAMP_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_v2i8_clamp i64:$s, i32:$x, i32:$y),
+          (SULD_2D_V2I8_CLAMP_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_v2i16_clamp i64:$s, i32:$x, i32:$y),
+          (SULD_2D_V2I16_CLAMP_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_v2i32_clamp i64:$s, i32:$x, i32:$y),
+          (SULD_2D_V2I32_CLAMP_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_v2i64_clamp i64:$s, i32:$x, i32:$y),
+          (SULD_2D_V2I64_CLAMP_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_v4i8_clamp i64:$s, i32:$x, i32:$y),
+          (SULD_2D_V4I8_CLAMP_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_v4i16_clamp i64:$s, i32:$x, i32:$y),
+          (SULD_2D_V4I16_CLAMP_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_v4i32_clamp i64:$s, i32:$x, i32:$y),
+          (SULD_2D_V4I32_CLAMP_R $s, $x, $y)>;
+
+def : Pat<(int_nvvm_suld_2d_array_i8_clamp i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_I8_CLAMP_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_i16_clamp i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_I16_CLAMP_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_i32_clamp i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_I32_CLAMP_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_i64_clamp i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_I64_CLAMP_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_v2i8_clamp i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_V2I8_CLAMP_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_v2i16_clamp i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_V2I16_CLAMP_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_v2i32_clamp i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_V2I32_CLAMP_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_v2i64_clamp i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_V2I64_CLAMP_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_v4i8_clamp i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_V4I8_CLAMP_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_v4i16_clamp i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_V4I16_CLAMP_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_v4i32_clamp i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_V4I32_CLAMP_R $s, $l, $x, $y)>;
+
+def : Pat<(int_nvvm_suld_3d_i8_clamp i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_I8_CLAMP_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_i16_clamp i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_I16_CLAMP_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_i32_clamp i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_I32_CLAMP_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_i64_clamp i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_I64_CLAMP_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_v2i8_clamp i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_V2I8_CLAMP_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_v2i16_clamp i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_V2I16_CLAMP_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_v2i32_clamp i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_V2I32_CLAMP_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_v2i64_clamp i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_V2I64_CLAMP_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_v4i8_clamp i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_V4I8_CLAMP_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_v4i16_clamp i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_V4I16_CLAMP_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_v4i32_clamp i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_V4I32_CLAMP_R $s, $x, $y, $z)>;
+
+def : Pat<(int_nvvm_suld_1d_i8_trap i64:$s, i32:$x),
+          (SULD_1D_I8_TRAP_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_i16_trap i64:$s, i32:$x),
+          (SULD_1D_I16_TRAP_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_i32_trap i64:$s, i32:$x),
+          (SULD_1D_I32_TRAP_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_i64_trap i64:$s, i32:$x),
+          (SULD_1D_I64_TRAP_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_v2i8_trap i64:$s, i32:$x),
+          (SULD_1D_V2I8_TRAP_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_v2i16_trap i64:$s, i32:$x),
+          (SULD_1D_V2I16_TRAP_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_v2i32_trap i64:$s, i32:$x),
+          (SULD_1D_V2I32_TRAP_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_v2i64_trap i64:$s, i32:$x),
+          (SULD_1D_V2I64_TRAP_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_v4i8_trap i64:$s, i32:$x),
+          (SULD_1D_V4I8_TRAP_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_v4i16_trap i64:$s, i32:$x),
+          (SULD_1D_V4I16_TRAP_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_v4i32_trap i64:$s, i32:$x),
+          (SULD_1D_V4I32_TRAP_R $s, $x)>;
+
+def : Pat<(int_nvvm_suld_1d_array_i8_trap i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_I8_TRAP_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_i16_trap i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_I16_TRAP_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_i32_trap i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_I32_TRAP_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_i64_trap i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_I64_TRAP_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_v2i8_trap i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_V2I8_TRAP_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_v2i16_trap i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_V2I16_TRAP_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_v2i32_trap i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_V2I32_TRAP_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_v2i64_trap i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_V2I64_TRAP_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_v4i8_trap i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_V4I8_TRAP_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_v4i16_trap i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_V4I16_TRAP_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_v4i32_trap i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_V4I32_TRAP_R $s, $l, $x)>;
+
+def : Pat<(int_nvvm_suld_2d_i8_trap i64:$s, i32:$x, i32:$y),
+          (SULD_2D_I8_TRAP_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_i16_trap i64:$s, i32:$x, i32:$y),
+          (SULD_2D_I16_TRAP_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_i32_trap i64:$s, i32:$x, i32:$y),
+          (SULD_2D_I32_TRAP_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_i64_trap i64:$s, i32:$x, i32:$y),
+          (SULD_2D_I64_TRAP_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_v2i8_trap i64:$s, i32:$x, i32:$y),
+          (SULD_2D_V2I8_TRAP_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_v2i16_trap i64:$s, i32:$x, i32:$y),
+          (SULD_2D_V2I16_TRAP_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_v2i32_trap i64:$s, i32:$x, i32:$y),
+          (SULD_2D_V2I32_TRAP_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_v2i64_trap i64:$s, i32:$x, i32:$y),
+          (SULD_2D_V2I64_TRAP_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_v4i8_trap i64:$s, i32:$x, i32:$y),
+          (SULD_2D_V4I8_TRAP_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_v4i16_trap i64:$s, i32:$x, i32:$y),
+          (SULD_2D_V4I16_TRAP_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_v4i32_trap i64:$s, i32:$x, i32:$y),
+          (SULD_2D_V4I32_TRAP_R $s, $x, $y)>;
+
+def : Pat<(int_nvvm_suld_2d_array_i8_trap i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_I8_TRAP_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_i16_trap i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_I16_TRAP_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_i32_trap i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_I32_TRAP_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_i64_trap i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_I64_TRAP_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_v2i8_trap i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_V2I8_TRAP_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_v2i16_trap i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_V2I16_TRAP_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_v2i32_trap i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_V2I32_TRAP_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_v2i64_trap i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_V2I64_TRAP_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_v4i8_trap i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_V4I8_TRAP_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_v4i16_trap i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_V4I16_TRAP_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_v4i32_trap i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_V4I32_TRAP_R $s, $l, $x, $y)>;
+
+def : Pat<(int_nvvm_suld_3d_i8_trap i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_I8_TRAP_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_i16_trap i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_I16_TRAP_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_i32_trap i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_I32_TRAP_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_i64_trap i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_I64_TRAP_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_v2i8_trap i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_V2I8_TRAP_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_v2i16_trap i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_V2I16_TRAP_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_v2i32_trap i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_V2I32_TRAP_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_v2i64_trap i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_V2I64_TRAP_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_v4i8_trap i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_V4I8_TRAP_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_v4i16_trap i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_V4I16_TRAP_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_v4i32_trap i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_V4I32_TRAP_R $s, $x, $y, $z)>;
+
+def : Pat<(int_nvvm_suld_1d_i8_zero i64:$s, i32:$x),
+          (SULD_1D_I8_ZERO_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_i16_zero i64:$s, i32:$x),
+          (SULD_1D_I16_ZERO_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_i32_zero i64:$s, i32:$x),
+          (SULD_1D_I32_ZERO_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_i64_zero i64:$s, i32:$x),
+          (SULD_1D_I64_ZERO_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_v2i8_zero i64:$s, i32:$x),
+          (SULD_1D_V2I8_ZERO_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_v2i16_zero i64:$s, i32:$x),
+          (SULD_1D_V2I16_ZERO_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_v2i32_zero i64:$s, i32:$x),
+          (SULD_1D_V2I32_ZERO_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_v2i64_zero i64:$s, i32:$x),
+          (SULD_1D_V2I64_ZERO_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_v4i8_zero i64:$s, i32:$x),
+          (SULD_1D_V4I8_ZERO_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_v4i16_zero i64:$s, i32:$x),
+          (SULD_1D_V4I16_ZERO_R $s, $x)>;
+def : Pat<(int_nvvm_suld_1d_v4i32_zero i64:$s, i32:$x),
+          (SULD_1D_V4I32_ZERO_R $s, $x)>;
+
+def : Pat<(int_nvvm_suld_1d_array_i8_zero i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_I8_ZERO_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_i16_zero i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_I16_ZERO_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_i32_zero i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_I32_ZERO_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_i64_zero i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_I64_ZERO_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_v2i8_zero i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_V2I8_ZERO_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_v2i16_zero i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_V2I16_ZERO_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_v2i32_zero i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_V2I32_ZERO_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_v2i64_zero i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_V2I64_ZERO_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_v4i8_zero i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_V4I8_ZERO_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_v4i16_zero i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_V4I16_ZERO_R $s, $l, $x)>;
+def : Pat<(int_nvvm_suld_1d_array_v4i32_zero i64:$s, i32:$l, i32:$x),
+          (SULD_1D_ARRAY_V4I32_ZERO_R $s, $l, $x)>;
+
+def : Pat<(int_nvvm_suld_2d_i8_zero i64:$s, i32:$x, i32:$y),
+          (SULD_2D_I8_ZERO_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_i16_zero i64:$s, i32:$x, i32:$y),
+          (SULD_2D_I16_ZERO_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_i32_zero i64:$s, i32:$x, i32:$y),
+          (SULD_2D_I32_ZERO_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_i64_zero i64:$s, i32:$x, i32:$y),
+          (SULD_2D_I64_ZERO_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_v2i8_zero i64:$s, i32:$x, i32:$y),
+          (SULD_2D_V2I8_ZERO_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_v2i16_zero i64:$s, i32:$x, i32:$y),
+          (SULD_2D_V2I16_ZERO_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_v2i32_zero i64:$s, i32:$x, i32:$y),
+          (SULD_2D_V2I32_ZERO_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_v2i64_zero i64:$s, i32:$x, i32:$y),
+          (SULD_2D_V2I64_ZERO_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_v4i8_zero i64:$s, i32:$x, i32:$y),
+          (SULD_2D_V4I8_ZERO_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_v4i16_zero i64:$s, i32:$x, i32:$y),
+          (SULD_2D_V4I16_ZERO_R $s, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_v4i32_zero i64:$s, i32:$x, i32:$y),
+          (SULD_2D_V4I32_ZERO_R $s, $x, $y)>;
+
+def : Pat<(int_nvvm_suld_2d_array_i8_zero i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_I8_ZERO_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_i16_zero i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_I16_ZERO_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_i32_zero i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_I32_ZERO_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_i64_zero i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_I64_ZERO_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_v2i8_zero i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_V2I8_ZERO_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_v2i16_zero i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_V2I16_ZERO_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_v2i32_zero i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_V2I32_ZERO_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_v2i64_zero i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_V2I64_ZERO_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_v4i8_zero i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_V4I8_ZERO_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_v4i16_zero i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_V4I16_ZERO_R $s, $l, $x, $y)>;
+def : Pat<(int_nvvm_suld_2d_array_v4i32_zero i64:$s, i32:$l, i32:$x, i32:$y),
+          (SULD_2D_ARRAY_V4I32_ZERO_R $s, $l, $x, $y)>;
+
+def : Pat<(int_nvvm_suld_3d_i8_zero i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_I8_ZERO_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_i16_zero i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_I16_ZERO_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_i32_zero i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_I32_ZERO_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_i64_zero i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_I64_ZERO_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_v2i8_zero i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_V2I8_ZERO_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_v2i16_zero i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_V2I16_ZERO_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_v2i32_zero i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_V2I32_ZERO_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_v2i64_zero i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_V2I64_ZERO_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_v4i8_zero i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_V4I8_ZERO_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_v4i16_zero i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_V4I16_ZERO_R $s, $x, $y, $z)>;
+def : Pat<(int_nvvm_suld_3d_v4i32_zero i64:$s, i32:$x, i32:$y, i32:$z),
+          (SULD_3D_V4I32_ZERO_R $s, $x, $y, $z)>;

>From bdc66dd2f1196a9ca81f19b863362eecb52d3633 Mon Sep 17 00:00:00 2001
From: Sergei Barannikov <barannikov88 at gmail.com>
Date: Sat, 14 Dec 2024 23:32:24 +0300
Subject: [PATCH 2/2] Integrate surface intrinsic patterns into instructions

---
 llvm/lib/Target/NVPTX/NVPTXIntrinsics.td | 510 ++++++-----------------
 1 file changed, 120 insertions(+), 390 deletions(-)

diff --git a/llvm/lib/Target/NVPTX/NVPTXIntrinsics.td b/llvm/lib/Target/NVPTX/NVPTXIntrinsics.td
index 644da01cff618a..8263276cd40ab6 100644
--- a/llvm/lib/Target/NVPTX/NVPTXIntrinsics.td
+++ b/llvm/lib/Target/NVPTX/NVPTXIntrinsics.td
@@ -4127,13 +4127,17 @@ defm TLD4_UNIFIED_A_2D_U32_F32
 
 let IsSuld = true in {
 
-class SULD_1D_base<string inst, NVPTXRegClass outtype, dag surf>
+class SULD_1D_base<string inst, NVPTXRegClass outtype, dag surf,
+                   list<dag> pattern = []>
     : NVPTXInst<(outs outtype:$r),
                 !con(surf, (ins Int32Regs:$x)),
                 inst # " \\{$r\\}, [$s, \\{$x\\}];",
-                []>;
+                pattern>;
 multiclass SULD_1D<string inst, NVPTXRegClass outtype> {
-  def _R : SULD_1D_base<inst, outtype, (ins Int64Regs:$s)>;
+  defvar intr = !cast<Intrinsic>("int_nvvm_" # !tolower(NAME));
+
+  def _R : SULD_1D_base<inst, outtype, (ins Int64Regs:$s),
+                        [(set outtype:$r, (intr i64:$s, i32:$x))]>;
   def _I : SULD_1D_base<inst, outtype, (ins i64imm:$s)>;
 }
 
@@ -4152,13 +4156,18 @@ defm SULD_1D_I16_ZERO : SULD_1D<"suld.b.1d.b16.zero", Int16Regs>;
 defm SULD_1D_I32_ZERO : SULD_1D<"suld.b.1d.b32.zero", Int32Regs>;
 defm SULD_1D_I64_ZERO : SULD_1D<"suld.b.1d.b64.zero", Int64Regs>;
 
-class SULD_1D_ARRAY_base<string inst, NVPTXRegClass outtype, dag surf>
+class SULD_1D_ARRAY_base<string inst, NVPTXRegClass outtype, dag surf,
+                         list<dag> pattern = []>
     : NVPTXInst<(outs outtype:$r),
                 !con(surf, (ins Int32Regs:$l, Int32Regs:$x)),
                 inst # " \\{$r\\}, [$s, \\{$l, $x\\}];",
-                []>;
+                pattern>;
 multiclass SULD_1D_ARRAY<string inst, NVPTXRegClass outtype> {
-  def _R : SULD_1D_ARRAY_base<inst, outtype, (ins Int64Regs:$s)>;
+  defvar intr = !cast<Intrinsic>("int_nvvm_" # !tolower(NAME));
+
+  def _R : SULD_1D_ARRAY_base<inst, outtype, (ins Int64Regs:$s),
+                              [(set outtype:$r,
+                                    (intr i64:$s, i32:$l, i32:$x))]>;
   def _I : SULD_1D_ARRAY_base<inst, outtype, (ins i64imm:$s)>;
 }
 
@@ -4189,13 +4198,17 @@ defm SULD_1D_ARRAY_I32_ZERO
 defm SULD_1D_ARRAY_I64_ZERO
   : SULD_1D_ARRAY<"suld.b.a1d.b64.zero", Int64Regs>;
 
-class SULD_2D_base<string inst, NVPTXRegClass outtype, dag surf>
+class SULD_2D_base<string inst, NVPTXRegClass outtype, dag surf,
+                   list<dag> pattern = []>
     : NVPTXInst<(outs outtype:$r),
                 !con(surf, (ins Int32Regs:$x, Int32Regs:$y)),
                 inst # " \\{$r\\}, [$s, \\{$x, $y\\}];",
-                []>;
+                pattern>;
 multiclass SULD_2D<string inst, NVPTXRegClass outtype> {
-  def _R : SULD_2D_base<inst, outtype, (ins Int64Regs:$s)>;
+  defvar intr = !cast<Intrinsic>("int_nvvm_" # !tolower(NAME));
+
+  def _R : SULD_2D_base<inst, outtype, (ins Int64Regs:$s),
+                        [(set outtype:$r, (intr i64:$s, i32:$x, i32:$y))]>;
   def _I : SULD_2D_base<inst, outtype, (ins i64imm:$s)>;
 }
 
@@ -4214,13 +4227,18 @@ defm SULD_2D_I16_ZERO : SULD_2D<"suld.b.2d.b16.zero", Int16Regs>;
 defm SULD_2D_I32_ZERO : SULD_2D<"suld.b.2d.b32.zero", Int32Regs>;
 defm SULD_2D_I64_ZERO : SULD_2D<"suld.b.2d.b64.zero", Int64Regs>;
 
-class SULD_2D_ARRAY_base<string inst, NVPTXRegClass outtype, dag surf>
+class SULD_2D_ARRAY_base<string inst, NVPTXRegClass outtype, dag surf,
+                         list<dag> pattern = []>
     : NVPTXInst<(outs outtype:$r),
                 !con(surf, (ins Int32Regs:$l, Int32Regs:$x, Int32Regs:$y)),
                 inst # " \\{$r\\}, [$s, \\{$l, $x, $y, $y\\}];",
-                []>;
+                pattern>;
 multiclass SULD_2D_ARRAY<string inst, NVPTXRegClass outtype> {
-  def _R : SULD_2D_ARRAY_base<inst, outtype, (ins Int64Regs:$s)>;
+  defvar intr = !cast<Intrinsic>("int_nvvm_" # !tolower(NAME));
+
+  def _R : SULD_2D_ARRAY_base<inst, outtype, (ins Int64Regs:$s),
+                              [(set outtype:$r,
+                                    (intr i64:$s, i32:$l, i32:$x, i32:$y))]>;
   def _I : SULD_2D_ARRAY_base<inst, outtype, (ins i64imm:$s)>;
 }
 
@@ -4239,13 +4257,18 @@ defm SULD_2D_ARRAY_I16_ZERO : SULD_2D_ARRAY<"suld.b.a2d.b16.zero", Int16Regs>;
 defm SULD_2D_ARRAY_I32_ZERO : SULD_2D_ARRAY<"suld.b.a2d.b32.zero", Int32Regs>;
 defm SULD_2D_ARRAY_I64_ZERO : SULD_2D_ARRAY<"suld.b.a2d.b64.zero", Int64Regs>;
 
-class SULD_3D_base<string inst, NVPTXRegClass outtype, dag surf>
+class SULD_3D_base<string inst, NVPTXRegClass outtype, dag surf,
+                   list<dag> pattern = []>
     : NVPTXInst<(outs outtype:$r),
                 !con(surf, (ins Int32Regs:$x, Int32Regs:$y, Int32Regs:$z)),
                 inst # " \\{$r\\}, [$s, \\{$x, $y, $z, $z\\}];",
-                []>;
+                pattern>;
 multiclass SULD_3D<string inst, NVPTXRegClass outtype> {
-  def _R : SULD_3D_base<inst, outtype, (ins Int64Regs:$s)>;
+  defvar intr = !cast<Intrinsic>("int_nvvm_" # !tolower(NAME));
+
+  def _R : SULD_3D_base<inst, outtype, (ins Int64Regs:$s),
+                        [(set outtype:$r,
+                              (intr i64:$s, i32:$x, i32:$y, i32:$z))]>;
   def _I : SULD_3D_base<inst, outtype, (ins i64imm:$s)>;
 }
 
@@ -4267,13 +4290,18 @@ defm SULD_3D_I64_ZERO : SULD_3D<"suld.b.3d.b64.zero", Int64Regs>;
 
 let IsSuld = 2 in {
 
-class SULD_1D_V2_base<string inst, NVPTXRegClass outtype, dag surf>
+class SULD_1D_V2_base<string inst, NVPTXRegClass outtype, dag surf,
+                      list<dag> pattern = []>
     : NVPTXInst<(outs outtype:$r, outtype:$g),
                 !con(surf, (ins Int32Regs:$x)),
                 inst # " \\{$r, $g\\}, [$s, \\{$x\\}];",
-                []>;
+                pattern>;
 multiclass SULD_1D_V2<string inst, NVPTXRegClass outtype> {
-  def _R : SULD_1D_V2_base<inst, outtype, (ins Int64Regs:$s)>;
+  defvar intr = !cast<Intrinsic>("int_nvvm_" # !tolower(NAME));
+
+  def _R : SULD_1D_V2_base<inst, outtype, (ins Int64Regs:$s),
+                           [(set outtype:$r, outtype:$g,
+                                 (intr i64:$s, i32:$x))]>;
   def _I : SULD_1D_V2_base<inst, outtype, (ins i64imm:$s)>;
 }
 
@@ -4292,13 +4320,18 @@ defm SULD_1D_V2I16_ZERO : SULD_1D_V2<"suld.b.1d.v2.b16.zero", Int16Regs>;
 defm SULD_1D_V2I32_ZERO : SULD_1D_V2<"suld.b.1d.v2.b32.zero", Int32Regs>;
 defm SULD_1D_V2I64_ZERO : SULD_1D_V2<"suld.b.1d.v2.b64.zero", Int64Regs>;
 
-class SULD_1D_ARRAY_V2_base<string inst, NVPTXRegClass outtype, dag surf>
+class SULD_1D_ARRAY_V2_base<string inst, NVPTXRegClass outtype, dag surf,
+                            list<dag> pattern = []>
     : NVPTXInst<(outs outtype:$r, outtype:$g),
                 !con(surf, (ins Int32Regs:$l, Int32Regs:$x)),
                 inst # " \\{$r, $g\\}, [$s, \\{$l, $x\\}];",
-                []>;
+                pattern>;
 multiclass SULD_1D_ARRAY_V2<string inst, NVPTXRegClass outtype> {
-  def _R : SULD_1D_ARRAY_V2_base<inst, outtype, (ins Int64Regs:$s)>;
+  defvar intr = !cast<Intrinsic>("int_nvvm_" # !tolower(NAME));
+
+  def _R : SULD_1D_ARRAY_V2_base<inst, outtype, (ins Int64Regs:$s),
+                                 [(set outtype:$r, outtype:$g,
+                                       (intr i64:$s, i32:$l, i32:$x))]>;
   def _I : SULD_1D_ARRAY_V2_base<inst, outtype, (ins i64imm:$s)>;
 }
 
@@ -4329,13 +4362,18 @@ defm SULD_1D_ARRAY_V2I32_ZERO
 defm SULD_1D_ARRAY_V2I64_ZERO
   : SULD_1D_ARRAY_V2<"suld.b.a1d.v2.b64.zero", Int64Regs>;
 
-class SULD_2D_V2_base<string inst, NVPTXRegClass outtype, dag surf>
+class SULD_2D_V2_base<string inst, NVPTXRegClass outtype, dag surf,
+                      list<dag> pattern = []>
     : NVPTXInst<(outs outtype:$r, outtype:$g),
                 !con(surf, (ins Int32Regs:$x, Int32Regs:$y)),
                 inst # " \\{$r, $g\\}, [$s, \\{$x, $y\\}];",
-                []>;
+                pattern>;
 multiclass SULD_2D_V2<string inst, NVPTXRegClass outtype> {
-  def _R : SULD_2D_V2_base<inst, outtype, (ins Int64Regs:$s)>;
+  defvar intr = !cast<Intrinsic>("int_nvvm_" # !tolower(NAME));
+
+  def _R : SULD_2D_V2_base<inst, outtype, (ins Int64Regs:$s),
+                           [(set outtype:$r, outtype:$g,
+                                 (intr i64:$s, i32:$x, i32:$y))]>;
   def _I : SULD_2D_V2_base<inst, outtype, (ins i64imm:$s)>;
 }
 
@@ -4366,13 +4404,18 @@ defm SULD_2D_V2I32_ZERO
 defm SULD_2D_V2I64_ZERO
   : SULD_2D_V2<"suld.b.2d.v2.b64.zero", Int64Regs>;
 
-class SULD_2D_ARRAY_V2_base<string inst, NVPTXRegClass outtype, dag surf>
+class SULD_2D_ARRAY_V2_base<string inst, NVPTXRegClass outtype, dag surf,
+                            list<dag> pattern = []>
     : NVPTXInst<(outs outtype:$r, outtype:$g),
                 !con(surf, (ins Int32Regs:$l, Int32Regs:$x, Int32Regs:$y)),
                 inst # " \\{$r, $g\\}, [$s, \\{$l, $x, $y, $y\\}];",
-                []>;
+                pattern>;
 multiclass SULD_2D_ARRAY_V2<string inst, NVPTXRegClass outtype> {
-  def _R : SULD_2D_ARRAY_V2_base<inst, outtype, (ins Int64Regs:$s)>;
+  defvar intr = !cast<Intrinsic>("int_nvvm_" # !tolower(NAME));
+
+  def _R : SULD_2D_ARRAY_V2_base<inst, outtype, (ins Int64Regs:$s),
+                                 [(set outtype:$r, outtype:$g,
+                                       (intr i64:$s, i32:$l, i32:$x, i32:$y))]>;
   def _I : SULD_2D_ARRAY_V2_base<inst, outtype, (ins i64imm:$s)>;
 }
 
@@ -4403,13 +4446,18 @@ defm SULD_2D_ARRAY_V2I32_ZERO
 defm SULD_2D_ARRAY_V2I64_ZERO
   : SULD_2D_ARRAY_V2<"suld.b.a2d.v2.b64.zero", Int64Regs>;
 
-class SULD_3D_V2_base<string inst, NVPTXRegClass outtype, dag surf>
+class SULD_3D_V2_base<string inst, NVPTXRegClass outtype, dag surf,
+                      list<dag> pattern = []>
     : NVPTXInst<(outs outtype:$r, outtype:$g),
                 !con(surf, (ins Int32Regs:$x, Int32Regs:$y, Int32Regs:$z)),
                 inst # " \\{$r, $g\\}, [$s, \\{$x, $y, $z, $z\\}];",
-                []>;
+                pattern>;
 multiclass SULD_3D_V2<string inst, NVPTXRegClass outtype> {
-  def _R : SULD_3D_V2_base<inst, outtype, (ins Int64Regs:$s)>;
+  defvar intr = !cast<Intrinsic>("int_nvvm_" # !tolower(NAME));
+
+  def _R : SULD_3D_V2_base<inst, outtype, (ins Int64Regs:$s),
+                           [(set outtype:$r, outtype:$g,
+                                 (intr i64:$s, i32:$x, i32:$y, i32:$z))]>;
   def _I : SULD_3D_V2_base<inst, outtype, (ins i64imm:$s)>;
 }
 
@@ -4432,13 +4480,18 @@ defm SULD_3D_V2I64_ZERO : SULD_3D_V2<"suld.b.3d.v2.b64.zero", Int64Regs>;
 
 let IsSuld = 3 in {
 
-class SULD_1D_V4_base<string inst, NVPTXRegClass outtype, dag surf>
+class SULD_1D_V4_base<string inst, NVPTXRegClass outtype, dag surf,
+                      list<dag> pattern = []>
     : NVPTXInst<(outs outtype:$r, outtype:$g, outtype:$b, outtype:$a),
                 !con(surf, (ins Int32Regs:$x)),
                 inst # " \\{$r, $g, $b, $a\\}, [$s, \\{$x\\}];",
-                []>;
+                pattern>;
 multiclass SULD_1D_V4<string inst, NVPTXRegClass outtype> {
-  def _R : SULD_1D_V4_base<inst, outtype, (ins Int64Regs:$s)>;
+  defvar intr = !cast<Intrinsic>("int_nvvm_" # !tolower(NAME));
+
+  def _R : SULD_1D_V4_base<inst, outtype, (ins Int64Regs:$s),
+                           [(set outtype:$r, outtype:$g, outtype:$b, outtype:$a,
+                                 (intr i64:$s, i32:$x))]>;
   def _I : SULD_1D_V4_base<inst, outtype, (ins i64imm:$s)>;
 }
 
@@ -4454,13 +4507,19 @@ defm SULD_1D_V4I8_ZERO : SULD_1D_V4<"suld.b.1d.v4.b8.zero", Int16Regs>;
 defm SULD_1D_V4I16_ZERO : SULD_1D_V4<"suld.b.1d.v4.b16.zero", Int16Regs>;
 defm SULD_1D_V4I32_ZERO : SULD_1D_V4<"suld.b.1d.v4.b32.zero", Int32Regs>;
 
-class SULD_1D_ARRAY_V4_base<string inst, NVPTXRegClass outtype, dag surf>
+class SULD_1D_ARRAY_V4_base<string inst, NVPTXRegClass outtype, dag surf,
+                            list<dag> pattern = []>
     : NVPTXInst<(outs outtype:$r, outtype:$g, outtype:$b, outtype:$a),
                 !con(surf, (ins Int32Regs:$l, Int32Regs:$x)),
                 inst # " \\{$r, $g, $b, $a\\}, [$s, \\{$l, $x\\}];",
-                []>;
+                pattern>;
 multiclass SULD_1D_ARRAY_V4<string inst, NVPTXRegClass outtype> {
-  def _R : SULD_1D_ARRAY_V4_base<inst, outtype, (ins Int64Regs:$s)>;
+  defvar intr = !cast<Intrinsic>("int_nvvm_" # !tolower(NAME));
+
+  def _R : SULD_1D_ARRAY_V4_base<inst, outtype, (ins Int64Regs:$s),
+                                 [(set outtype:$r, outtype:$g, outtype:$b,
+                                       outtype:$a,
+                                       (intr i64:$s, i32:$l, i32:$x))]>;
   def _I : SULD_1D_ARRAY_V4_base<inst, outtype, (ins i64imm:$s)>;
 }
 
@@ -4485,13 +4544,18 @@ defm SULD_1D_ARRAY_V4I16_ZERO
 defm SULD_1D_ARRAY_V4I32_ZERO
   : SULD_1D_ARRAY_V4<"suld.b.a1d.v4.b32.zero", Int32Regs>;
 
-class SULD_2D_V4_base<string inst, NVPTXRegClass outtype, dag surf>
+class SULD_2D_V4_base<string inst, NVPTXRegClass outtype, dag surf,
+                      list<dag> pattern = []>
     : NVPTXInst<(outs outtype:$r, outtype:$g, outtype:$b, outtype:$a),
                 !con(surf, (ins Int32Regs:$x, Int32Regs:$y)),
                 inst # " \\{$r, $g, $b, $a\\}, [$s, \\{$x, $y\\}];",
-                []>;
+                pattern>;
 multiclass SULD_2D_V4<string inst, NVPTXRegClass outtype> {
-  def _R : SULD_2D_V4_base<inst, outtype, (ins Int64Regs:$s)>;
+  defvar intr = !cast<Intrinsic>("int_nvvm_" # !tolower(NAME));
+
+  def _R : SULD_2D_V4_base<inst, outtype, (ins Int64Regs:$s),
+                           [(set outtype:$r, outtype:$g, outtype:$b, outtype:$a,
+                                 (intr i64:$s, i32:$x, i32:$y))]>;
   def _I : SULD_2D_V4_base<inst, outtype, (ins i64imm:$s)>;
 }
 
@@ -4507,13 +4571,19 @@ defm SULD_2D_V4I8_ZERO : SULD_2D_V4<"suld.b.2d.v4.b8.zero", Int16Regs>;
 defm SULD_2D_V4I16_ZERO : SULD_2D_V4<"suld.b.2d.v4.b16.zero", Int16Regs>;
 defm SULD_2D_V4I32_ZERO : SULD_2D_V4<"suld.b.2d.v4.b32.zero", Int32Regs>;
 
-class SULD_2D_ARRAY_V4_base<string inst, NVPTXRegClass outtype, dag surf>
+class SULD_2D_ARRAY_V4_base<string inst, NVPTXRegClass outtype, dag surf,
+                            list<dag> pattern = []>
     : NVPTXInst<(outs outtype:$r, outtype:$g, outtype:$b, outtype:$a),
                 !con(surf, (ins Int32Regs:$l, Int32Regs:$x, Int32Regs:$y)),
                 inst # " \\{$r, $g, $b, $a\\}, [$s, \\{$l, $x, $y, $y\\}];",
-                []>;
+                pattern>;
 multiclass SULD_2D_ARRAY_V4<string inst, NVPTXRegClass outtype> {
-  def _R : SULD_2D_ARRAY_V4_base<inst, outtype, (ins Int64Regs:$s)>;
+  defvar intr = !cast<Intrinsic>("int_nvvm_" # !tolower(NAME));
+
+  def _R : SULD_2D_ARRAY_V4_base<inst, outtype, (ins Int64Regs:$s),
+                                 [(set outtype:$r, outtype:$g, outtype:$b,
+                                       outtype:$a,
+                                       (intr i64:$s, i32:$l, i32:$x, i32:$y))]>;
   def _I : SULD_2D_ARRAY_V4_base<inst, outtype, (ins i64imm:$s)>;
 }
 
@@ -4538,13 +4608,18 @@ defm SULD_2D_ARRAY_V4I16_ZERO
 defm SULD_2D_ARRAY_V4I32_ZERO
   : SULD_2D_ARRAY_V4<"suld.b.a2d.v4.b32.zero", Int32Regs>;
 
-class SULD_3D_V4_base<string inst, NVPTXRegClass outtype, dag surf>
+class SULD_3D_V4_base<string inst, NVPTXRegClass outtype, dag surf,
+                      list<dag> pattern = []>
     : NVPTXInst<(outs outtype:$r, outtype:$g, outtype:$b, outtype:$a),
                 !con(surf, (ins Int32Regs:$x, Int32Regs:$y, Int32Regs:$z)),
                 inst # " \\{$r, $g, $b, $a\\}, [$s, \\{$x, $y, $z, $z\\}];",
-                []>;
+                pattern>;
 multiclass SULD_3D_V4<string inst, NVPTXRegClass outtype> {
-  def _R : SULD_3D_V4_base<inst, outtype, (ins Int64Regs:$s)>;
+  defvar intr = !cast<Intrinsic>("int_nvvm_" # !tolower(NAME));
+
+  def _R : SULD_3D_V4_base<inst, outtype, (ins Int64Regs:$s),
+                           [(set outtype:$r, outtype:$g, outtype:$b, outtype:$a,
+                                 (intr i64:$s, i32:$x, i32:$y, i32:$z))]>;
   def _I : SULD_3D_V4_base<inst, outtype, (ins i64imm:$s)>;
 }
 
@@ -7469,348 +7544,3 @@ def : Pat<(int_nvvm_tld4_unified_b_2d_v4u32_f32 i64:$t, f32:$x, f32:$y),
           (TLD4_UNIFIED_B_2D_U32_F32_R $t, $x, $y)>;
 def : Pat<(int_nvvm_tld4_unified_a_2d_v4u32_f32 i64:$t, f32:$x, f32:$y),
           (TLD4_UNIFIED_A_2D_U32_F32_R $t, $x, $y)>;
-
-def : Pat<(int_nvvm_suld_1d_i8_clamp i64:$s, i32:$x),
-          (SULD_1D_I8_CLAMP_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_i16_clamp i64:$s, i32:$x),
-          (SULD_1D_I16_CLAMP_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_i32_clamp i64:$s, i32:$x),
-          (SULD_1D_I32_CLAMP_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_i64_clamp i64:$s, i32:$x),
-          (SULD_1D_I64_CLAMP_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_v2i8_clamp i64:$s, i32:$x),
-          (SULD_1D_V2I8_CLAMP_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_v2i16_clamp i64:$s, i32:$x),
-          (SULD_1D_V2I16_CLAMP_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_v2i32_clamp i64:$s, i32:$x),
-          (SULD_1D_V2I32_CLAMP_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_v2i64_clamp i64:$s, i32:$x),
-          (SULD_1D_V2I64_CLAMP_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_v4i8_clamp i64:$s, i32:$x),
-          (SULD_1D_V4I8_CLAMP_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_v4i16_clamp i64:$s, i32:$x),
-          (SULD_1D_V4I16_CLAMP_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_v4i32_clamp i64:$s, i32:$x),
-          (SULD_1D_V4I32_CLAMP_R $s, $x)>;
-
-def : Pat<(int_nvvm_suld_1d_array_i8_clamp i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_I8_CLAMP_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_i16_clamp i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_I16_CLAMP_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_i32_clamp i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_I32_CLAMP_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_i64_clamp i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_I64_CLAMP_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_v2i8_clamp i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_V2I8_CLAMP_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_v2i16_clamp i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_V2I16_CLAMP_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_v2i32_clamp i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_V2I32_CLAMP_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_v2i64_clamp i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_V2I64_CLAMP_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_v4i8_clamp i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_V4I8_CLAMP_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_v4i16_clamp i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_V4I16_CLAMP_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_v4i32_clamp i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_V4I32_CLAMP_R $s, $l, $x)>;
-
-def : Pat<(int_nvvm_suld_2d_i8_clamp i64:$s, i32:$x, i32:$y),
-          (SULD_2D_I8_CLAMP_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_i16_clamp i64:$s, i32:$x, i32:$y),
-          (SULD_2D_I16_CLAMP_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_i32_clamp i64:$s, i32:$x, i32:$y),
-          (SULD_2D_I32_CLAMP_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_i64_clamp i64:$s, i32:$x, i32:$y),
-          (SULD_2D_I64_CLAMP_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_v2i8_clamp i64:$s, i32:$x, i32:$y),
-          (SULD_2D_V2I8_CLAMP_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_v2i16_clamp i64:$s, i32:$x, i32:$y),
-          (SULD_2D_V2I16_CLAMP_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_v2i32_clamp i64:$s, i32:$x, i32:$y),
-          (SULD_2D_V2I32_CLAMP_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_v2i64_clamp i64:$s, i32:$x, i32:$y),
-          (SULD_2D_V2I64_CLAMP_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_v4i8_clamp i64:$s, i32:$x, i32:$y),
-          (SULD_2D_V4I8_CLAMP_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_v4i16_clamp i64:$s, i32:$x, i32:$y),
-          (SULD_2D_V4I16_CLAMP_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_v4i32_clamp i64:$s, i32:$x, i32:$y),
-          (SULD_2D_V4I32_CLAMP_R $s, $x, $y)>;
-
-def : Pat<(int_nvvm_suld_2d_array_i8_clamp i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_I8_CLAMP_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_i16_clamp i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_I16_CLAMP_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_i32_clamp i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_I32_CLAMP_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_i64_clamp i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_I64_CLAMP_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_v2i8_clamp i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_V2I8_CLAMP_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_v2i16_clamp i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_V2I16_CLAMP_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_v2i32_clamp i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_V2I32_CLAMP_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_v2i64_clamp i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_V2I64_CLAMP_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_v4i8_clamp i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_V4I8_CLAMP_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_v4i16_clamp i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_V4I16_CLAMP_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_v4i32_clamp i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_V4I32_CLAMP_R $s, $l, $x, $y)>;
-
-def : Pat<(int_nvvm_suld_3d_i8_clamp i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_I8_CLAMP_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_i16_clamp i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_I16_CLAMP_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_i32_clamp i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_I32_CLAMP_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_i64_clamp i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_I64_CLAMP_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_v2i8_clamp i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_V2I8_CLAMP_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_v2i16_clamp i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_V2I16_CLAMP_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_v2i32_clamp i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_V2I32_CLAMP_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_v2i64_clamp i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_V2I64_CLAMP_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_v4i8_clamp i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_V4I8_CLAMP_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_v4i16_clamp i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_V4I16_CLAMP_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_v4i32_clamp i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_V4I32_CLAMP_R $s, $x, $y, $z)>;
-
-def : Pat<(int_nvvm_suld_1d_i8_trap i64:$s, i32:$x),
-          (SULD_1D_I8_TRAP_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_i16_trap i64:$s, i32:$x),
-          (SULD_1D_I16_TRAP_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_i32_trap i64:$s, i32:$x),
-          (SULD_1D_I32_TRAP_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_i64_trap i64:$s, i32:$x),
-          (SULD_1D_I64_TRAP_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_v2i8_trap i64:$s, i32:$x),
-          (SULD_1D_V2I8_TRAP_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_v2i16_trap i64:$s, i32:$x),
-          (SULD_1D_V2I16_TRAP_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_v2i32_trap i64:$s, i32:$x),
-          (SULD_1D_V2I32_TRAP_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_v2i64_trap i64:$s, i32:$x),
-          (SULD_1D_V2I64_TRAP_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_v4i8_trap i64:$s, i32:$x),
-          (SULD_1D_V4I8_TRAP_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_v4i16_trap i64:$s, i32:$x),
-          (SULD_1D_V4I16_TRAP_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_v4i32_trap i64:$s, i32:$x),
-          (SULD_1D_V4I32_TRAP_R $s, $x)>;
-
-def : Pat<(int_nvvm_suld_1d_array_i8_trap i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_I8_TRAP_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_i16_trap i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_I16_TRAP_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_i32_trap i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_I32_TRAP_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_i64_trap i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_I64_TRAP_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_v2i8_trap i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_V2I8_TRAP_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_v2i16_trap i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_V2I16_TRAP_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_v2i32_trap i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_V2I32_TRAP_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_v2i64_trap i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_V2I64_TRAP_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_v4i8_trap i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_V4I8_TRAP_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_v4i16_trap i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_V4I16_TRAP_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_v4i32_trap i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_V4I32_TRAP_R $s, $l, $x)>;
-
-def : Pat<(int_nvvm_suld_2d_i8_trap i64:$s, i32:$x, i32:$y),
-          (SULD_2D_I8_TRAP_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_i16_trap i64:$s, i32:$x, i32:$y),
-          (SULD_2D_I16_TRAP_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_i32_trap i64:$s, i32:$x, i32:$y),
-          (SULD_2D_I32_TRAP_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_i64_trap i64:$s, i32:$x, i32:$y),
-          (SULD_2D_I64_TRAP_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_v2i8_trap i64:$s, i32:$x, i32:$y),
-          (SULD_2D_V2I8_TRAP_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_v2i16_trap i64:$s, i32:$x, i32:$y),
-          (SULD_2D_V2I16_TRAP_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_v2i32_trap i64:$s, i32:$x, i32:$y),
-          (SULD_2D_V2I32_TRAP_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_v2i64_trap i64:$s, i32:$x, i32:$y),
-          (SULD_2D_V2I64_TRAP_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_v4i8_trap i64:$s, i32:$x, i32:$y),
-          (SULD_2D_V4I8_TRAP_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_v4i16_trap i64:$s, i32:$x, i32:$y),
-          (SULD_2D_V4I16_TRAP_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_v4i32_trap i64:$s, i32:$x, i32:$y),
-          (SULD_2D_V4I32_TRAP_R $s, $x, $y)>;
-
-def : Pat<(int_nvvm_suld_2d_array_i8_trap i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_I8_TRAP_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_i16_trap i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_I16_TRAP_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_i32_trap i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_I32_TRAP_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_i64_trap i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_I64_TRAP_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_v2i8_trap i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_V2I8_TRAP_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_v2i16_trap i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_V2I16_TRAP_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_v2i32_trap i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_V2I32_TRAP_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_v2i64_trap i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_V2I64_TRAP_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_v4i8_trap i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_V4I8_TRAP_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_v4i16_trap i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_V4I16_TRAP_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_v4i32_trap i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_V4I32_TRAP_R $s, $l, $x, $y)>;
-
-def : Pat<(int_nvvm_suld_3d_i8_trap i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_I8_TRAP_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_i16_trap i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_I16_TRAP_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_i32_trap i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_I32_TRAP_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_i64_trap i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_I64_TRAP_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_v2i8_trap i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_V2I8_TRAP_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_v2i16_trap i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_V2I16_TRAP_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_v2i32_trap i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_V2I32_TRAP_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_v2i64_trap i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_V2I64_TRAP_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_v4i8_trap i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_V4I8_TRAP_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_v4i16_trap i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_V4I16_TRAP_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_v4i32_trap i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_V4I32_TRAP_R $s, $x, $y, $z)>;
-
-def : Pat<(int_nvvm_suld_1d_i8_zero i64:$s, i32:$x),
-          (SULD_1D_I8_ZERO_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_i16_zero i64:$s, i32:$x),
-          (SULD_1D_I16_ZERO_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_i32_zero i64:$s, i32:$x),
-          (SULD_1D_I32_ZERO_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_i64_zero i64:$s, i32:$x),
-          (SULD_1D_I64_ZERO_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_v2i8_zero i64:$s, i32:$x),
-          (SULD_1D_V2I8_ZERO_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_v2i16_zero i64:$s, i32:$x),
-          (SULD_1D_V2I16_ZERO_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_v2i32_zero i64:$s, i32:$x),
-          (SULD_1D_V2I32_ZERO_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_v2i64_zero i64:$s, i32:$x),
-          (SULD_1D_V2I64_ZERO_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_v4i8_zero i64:$s, i32:$x),
-          (SULD_1D_V4I8_ZERO_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_v4i16_zero i64:$s, i32:$x),
-          (SULD_1D_V4I16_ZERO_R $s, $x)>;
-def : Pat<(int_nvvm_suld_1d_v4i32_zero i64:$s, i32:$x),
-          (SULD_1D_V4I32_ZERO_R $s, $x)>;
-
-def : Pat<(int_nvvm_suld_1d_array_i8_zero i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_I8_ZERO_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_i16_zero i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_I16_ZERO_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_i32_zero i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_I32_ZERO_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_i64_zero i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_I64_ZERO_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_v2i8_zero i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_V2I8_ZERO_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_v2i16_zero i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_V2I16_ZERO_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_v2i32_zero i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_V2I32_ZERO_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_v2i64_zero i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_V2I64_ZERO_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_v4i8_zero i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_V4I8_ZERO_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_v4i16_zero i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_V4I16_ZERO_R $s, $l, $x)>;
-def : Pat<(int_nvvm_suld_1d_array_v4i32_zero i64:$s, i32:$l, i32:$x),
-          (SULD_1D_ARRAY_V4I32_ZERO_R $s, $l, $x)>;
-
-def : Pat<(int_nvvm_suld_2d_i8_zero i64:$s, i32:$x, i32:$y),
-          (SULD_2D_I8_ZERO_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_i16_zero i64:$s, i32:$x, i32:$y),
-          (SULD_2D_I16_ZERO_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_i32_zero i64:$s, i32:$x, i32:$y),
-          (SULD_2D_I32_ZERO_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_i64_zero i64:$s, i32:$x, i32:$y),
-          (SULD_2D_I64_ZERO_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_v2i8_zero i64:$s, i32:$x, i32:$y),
-          (SULD_2D_V2I8_ZERO_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_v2i16_zero i64:$s, i32:$x, i32:$y),
-          (SULD_2D_V2I16_ZERO_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_v2i32_zero i64:$s, i32:$x, i32:$y),
-          (SULD_2D_V2I32_ZERO_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_v2i64_zero i64:$s, i32:$x, i32:$y),
-          (SULD_2D_V2I64_ZERO_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_v4i8_zero i64:$s, i32:$x, i32:$y),
-          (SULD_2D_V4I8_ZERO_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_v4i16_zero i64:$s, i32:$x, i32:$y),
-          (SULD_2D_V4I16_ZERO_R $s, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_v4i32_zero i64:$s, i32:$x, i32:$y),
-          (SULD_2D_V4I32_ZERO_R $s, $x, $y)>;
-
-def : Pat<(int_nvvm_suld_2d_array_i8_zero i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_I8_ZERO_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_i16_zero i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_I16_ZERO_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_i32_zero i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_I32_ZERO_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_i64_zero i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_I64_ZERO_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_v2i8_zero i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_V2I8_ZERO_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_v2i16_zero i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_V2I16_ZERO_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_v2i32_zero i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_V2I32_ZERO_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_v2i64_zero i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_V2I64_ZERO_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_v4i8_zero i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_V4I8_ZERO_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_v4i16_zero i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_V4I16_ZERO_R $s, $l, $x, $y)>;
-def : Pat<(int_nvvm_suld_2d_array_v4i32_zero i64:$s, i32:$l, i32:$x, i32:$y),
-          (SULD_2D_ARRAY_V4I32_ZERO_R $s, $l, $x, $y)>;
-
-def : Pat<(int_nvvm_suld_3d_i8_zero i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_I8_ZERO_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_i16_zero i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_I16_ZERO_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_i32_zero i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_I32_ZERO_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_i64_zero i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_I64_ZERO_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_v2i8_zero i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_V2I8_ZERO_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_v2i16_zero i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_V2I16_ZERO_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_v2i32_zero i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_V2I32_ZERO_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_v2i64_zero i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_V2I64_ZERO_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_v4i8_zero i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_V4I8_ZERO_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_v4i16_zero i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_V4I16_ZERO_R $s, $x, $y, $z)>;
-def : Pat<(int_nvvm_suld_3d_v4i32_zero i64:$s, i32:$x, i32:$y, i32:$z),
-          (SULD_3D_V4I32_ZERO_R $s, $x, $y, $z)>;



More information about the llvm-commits mailing list