OSDN Git Service

[NVPTX] Associate a minimum PTX version for each SM architecture
authorJustin Holewinski <jholewinski@nvidia.com>
Mon, 30 Mar 2015 19:30:55 +0000 (19:30 +0000)
committerJustin Holewinski <jholewinski@nvidia.com>
Mon, 30 Mar 2015 19:30:55 +0000 (19:30 +0000)
When a new SM architecture is introduced, it is only supported by the
current PTX version and later.  Make sure we are using at least the
minimum PTX version for the target architecture.

This also removes support for PTX ISA < 3.2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233583 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/NVPTX/NVPTX.td
test/CodeGen/NVPTX/ptx-version-30.ll [deleted file]
test/CodeGen/NVPTX/ptx-version-31.ll [deleted file]
test/CodeGen/NVPTX/sm-version-30.ll
test/CodeGen/NVPTX/sm-version-32.ll
test/CodeGen/NVPTX/sm-version-35.ll
test/CodeGen/NVPTX/sm-version-37.ll
test/CodeGen/NVPTX/sm-version-50.ll [new file with mode: 0644]
test/CodeGen/NVPTX/sm-version-52.ll
test/CodeGen/NVPTX/sm-version-53.ll

index e27fd75..96abfa8 100644 (file)
@@ -46,10 +46,6 @@ def SM53 : SubtargetFeature<"sm_53", "SmVersion", "53",
                             "Target SM 5.3">;
 
 // PTX Versions
-def PTX30 : SubtargetFeature<"ptx30", "PTXVersion", "30",
-                             "Use PTX version 3.0">;
-def PTX31 : SubtargetFeature<"ptx31", "PTXVersion", "31",
-                             "Use PTX version 3.1">;
 def PTX32 : SubtargetFeature<"ptx32", "PTXVersion", "32",
                              "Use PTX version 3.2">;
 def PTX40 : SubtargetFeature<"ptx40", "PTXVersion", "40",
@@ -69,12 +65,12 @@ class Proc<string Name, list<SubtargetFeature> Features>
 def : Proc<"sm_20", [SM20]>;
 def : Proc<"sm_21", [SM21]>;
 def : Proc<"sm_30", [SM30]>;
-def : Proc<"sm_32", [SM32]>;
+def : Proc<"sm_32", [SM32, PTX40]>;
 def : Proc<"sm_35", [SM35]>;
-def : Proc<"sm_37", [SM37]>;
-def : Proc<"sm_50", [SM50]>;
-def : Proc<"sm_52", [SM52]>;
-def : Proc<"sm_53", [SM53]>;
+def : Proc<"sm_37", [SM37, PTX41]>;
+def : Proc<"sm_50", [SM50, PTX40]>;
+def : Proc<"sm_52", [SM52, PTX41]>;
+def : Proc<"sm_53", [SM53, PTX42]>;
 
 
 def NVPTXInstrInfo : InstrInfo {
diff --git a/test/CodeGen/NVPTX/ptx-version-30.ll b/test/CodeGen/NVPTX/ptx-version-30.ll
deleted file mode 100644 (file)
index 0422b01..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llc < %s -march=nvptx -mcpu=sm_20 -mattr=ptx30 | FileCheck %s
-; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 -mattr=ptx30 | FileCheck %s
-
-
-; CHECK: .version 3.0
-
diff --git a/test/CodeGen/NVPTX/ptx-version-31.ll b/test/CodeGen/NVPTX/ptx-version-31.ll
deleted file mode 100644 (file)
index d6e5730..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llc < %s -march=nvptx -mcpu=sm_20 -mattr=ptx31 | FileCheck %s
-; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 -mattr=ptx31 | FileCheck %s
-
-
-; CHECK: .version 3.1
-
index 692b49a..4f35cf0 100644 (file)
@@ -2,5 +2,6 @@
 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_30 | FileCheck %s
 
 
+; CHECK: .version 3.2
 ; CHECK: .target sm_30
 
index b737f36..d6a5082 100644 (file)
@@ -2,5 +2,6 @@
 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_32 | FileCheck %s
 
 
+; CHECK: .version 4.0
 ; CHECK: .target sm_32
 
index 25368a0..8456c66 100644 (file)
@@ -2,5 +2,6 @@
 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_35 | FileCheck %s
 
 
+; CHECK: .version 3.2
 ; CHECK: .target sm_35
 
index 957a3d9..fd51a9c 100644 (file)
@@ -2,5 +2,6 @@
 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_37 | FileCheck %s
 
 
+; CHECK: .version 4.1
 ; CHECK: .target sm_37
 
diff --git a/test/CodeGen/NVPTX/sm-version-50.ll b/test/CodeGen/NVPTX/sm-version-50.ll
new file mode 100644 (file)
index 0000000..374c6ea
--- /dev/null
@@ -0,0 +1,7 @@
+; RUN: llc < %s -march=nvptx -mcpu=sm_50 | FileCheck %s
+; RUN: llc < %s -march=nvptx64 -mcpu=sm_50 | FileCheck %s
+
+
+; CHECK: .version 4.0
+; CHECK: .target sm_50
+
index 9b8fc72..18881b2 100644 (file)
@@ -2,5 +2,6 @@
 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_52 | FileCheck %s
 
 
+; CHECK: .version 4.1
 ; CHECK: .target sm_52
 
index f1b8e5b..50d2dec 100644 (file)
@@ -2,5 +2,6 @@
 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_53 | FileCheck %s
 
 
+; CHECK: .version 4.2
 ; CHECK: .target sm_53