[llvm] r233575 - [NVPTX] Add options for PTX 4.1/4.2 and SM 3.2/3.7/5.2/5.3

Justin Holewinski jholewinski at nvidia.com
Mon Mar 30 11:27:37 PDT 2015


On Mar 30, 2015, at 2:23 PM, Eli Bendersky <eliben at google.com<mailto:eliben at google.com>> wrote:

On Mon, Mar 30, 2015 at 11:12 AM, Justin Holewinski <jholewinski at nvidia.com<mailto:jholewinski at nvidia.com>> wrote:
Author: jholewinski
Date: Mon Mar 30 13:12:50 2015
New Revision: 233575

URL: http://llvm.org/viewvc/llvm-project?rev=233575&view=rev
Log:
[NVPTX] Add options for PTX 4.1/4.2 and SM 3.2/3.7/5.2/5.3

Added:
    llvm/trunk/test/CodeGen/NVPTX/sm-version-32.ll
    llvm/trunk/test/CodeGen/NVPTX/sm-version-37.ll
    llvm/trunk/test/CodeGen/NVPTX/sm-version-52.ll
    llvm/trunk/test/CodeGen/NVPTX/sm-version-53.ll
Modified:
    llvm/trunk/lib/Target/NVPTX/NVPTX.td

Thanks Justin, one question below...




Modified: llvm/trunk/lib/Target/NVPTX/NVPTX.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTX.td?rev=233575&r1=233574&r2=233575&view=diff
==============================================================================
--- llvm/trunk/lib/Target/NVPTX/NVPTX.td (original)
+++ llvm/trunk/lib/Target/NVPTX/NVPTX.td Mon Mar 30 13:12:50 2015
@@ -32,10 +32,18 @@ def SM21 : SubtargetFeature<"sm_21", "Sm
                             "Target SM 2.1">;
 def SM30 : SubtargetFeature<"sm_30", "SmVersion", "30",
                             "Target SM 3.0">;
+def SM32 : SubtargetFeature<"sm_32", "SmVersion", "32",
+                            "Target SM 3.2">;
 def SM35 : SubtargetFeature<"sm_35", "SmVersion", "35",
                             "Target SM 3.5">;
+def SM37 : SubtargetFeature<"sm_37", "SmVersion", "37",
+                            "Target SM 3.7">;
 def SM50 : SubtargetFeature<"sm_50", "SmVersion", "50",
                             "Target SM 5.0">;
+def SM52 : SubtargetFeature<"sm_52", "SmVersion", "52",
+                            "Target SM 5.2">;
+def SM53 : SubtargetFeature<"sm_53", "SmVersion", "53",
+                            "Target SM 5.3">;

 // PTX Versions
 def PTX30 : SubtargetFeature<"ptx30", "PTXVersion", "30",
@@ -46,6 +54,10 @@ def PTX32 : SubtargetFeature<"ptx32", "P
                              "Use PTX version 3.2">;
 def PTX40 : SubtargetFeature<"ptx40", "PTXVersion", "40",
                              "Use PTX version 4.0">;
+def PTX41 : SubtargetFeature<"ptx41", "PTXVersion", "41",
+                             "Use PTX version 4.1">;
+def PTX42 : SubtargetFeature<"ptx42", "PTXVersion", "42",
+                             "Use PTX version 4.2">;

 //===----------------------------------------------------------------------===//
 // NVPTX supported processors.
@@ -57,8 +69,12 @@ class Proc<string Name, list<SubtargetFe
 def : Proc<"sm_20", [SM20]>;
 def : Proc<"sm_21", [SM21]>;
 def : Proc<"sm_30", [SM30]>;
+def : Proc<"sm_32", [SM32]>;
 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 NVPTXInstrInfo : InstrInfo {

Added: llvm/trunk/test/CodeGen/NVPTX/sm-version-32.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/NVPTX/sm-version-32.ll?rev=233575&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/NVPTX/sm-version-32.ll (added)
+++ llvm/trunk/test/CodeGen/NVPTX/sm-version-32.ll Mon Mar 30 13:12:50 2015
@@ -0,0 +1,6 @@
+; RUN: llc < %s -march=nvptx -mcpu=sm_32 | FileCheck %s
+; RUN: llc < %s -march=nvptx64 -mcpu=sm_32 | FileCheck %s
+
+
+; CHECK: .target sm_32
+

Added: llvm/trunk/test/CodeGen/NVPTX/sm-version-37.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/NVPTX/sm-version-37.ll?rev=233575&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/NVPTX/sm-version-37.ll (added)
+++ llvm/trunk/test/CodeGen/NVPTX/sm-version-37.ll Mon Mar 30 13:12:50 2015
@@ -0,0 +1,6 @@
+; RUN: llc < %s -march=nvptx -mcpu=sm_37 | FileCheck %s
+; RUN: llc < %s -march=nvptx64 -mcpu=sm_37 | FileCheck %s
+
+
+; CHECK: .target sm_37
+

Added: llvm/trunk/test/CodeGen/NVPTX/sm-version-52.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/NVPTX/sm-version-52.ll?rev=233575&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/NVPTX/sm-version-52.ll (added)
+++ llvm/trunk/test/CodeGen/NVPTX/sm-version-52.ll Mon Mar 30 13:12:50 2015
@@ -0,0 +1,6 @@
+; RUN: llc < %s -march=nvptx -mcpu=sm_52 | FileCheck %s
+; RUN: llc < %s -march=nvptx64 -mcpu=sm_52 | FileCheck %s
+
+
+; CHECK: .target sm_52
+

Added: llvm/trunk/test/CodeGen/NVPTX/sm-version-53.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/NVPTX/sm-version-53.ll?rev=233575&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/NVPTX/sm-version-53.ll (added)
+++ llvm/trunk/test/CodeGen/NVPTX/sm-version-53.ll Mon Mar 30 13:12:50 2015
@@ -0,0 +1,6 @@
+; RUN: llc < %s -march=nvptx -mcpu=sm_53 | FileCheck %s
+; RUN: llc < %s -march=nvptx64 -mcpu=sm_53 | FileCheck %s
+
+
+; CHECK: .target sm_53
+


No tests that the proper PTX version is set? That would probably be useful since ptxas forces a certain PTX version

That’s a good point.  Currently, there is no relationship between PTX version and SM version in the back-end.  Should be trivial to add.


Eli



-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150330/ab6b1fb7/attachment.html>


More information about the llvm-commits mailing list