Skip to content

Commit

Permalink
[NVPTX] Associate a minimum PTX version for each SM architecture
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jholewinski committed Mar 30, 2015
1 parent 3637bab commit e6d6461
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 21 deletions.
14 changes: 5 additions & 9 deletions lib/Target/NVPTX/NVPTX.td
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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 {
Expand Down
6 changes: 0 additions & 6 deletions test/CodeGen/NVPTX/ptx-version-30.ll

This file was deleted.

6 changes: 0 additions & 6 deletions test/CodeGen/NVPTX/ptx-version-31.ll

This file was deleted.

1 change: 1 addition & 0 deletions test/CodeGen/NVPTX/sm-version-30.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
; RUN: llc < %s -march=nvptx64 -mcpu=sm_30 | FileCheck %s


; CHECK: .version 3.2
; CHECK: .target sm_30

1 change: 1 addition & 0 deletions test/CodeGen/NVPTX/sm-version-32.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
; RUN: llc < %s -march=nvptx64 -mcpu=sm_32 | FileCheck %s


; CHECK: .version 4.0
; CHECK: .target sm_32

1 change: 1 addition & 0 deletions test/CodeGen/NVPTX/sm-version-35.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
; RUN: llc < %s -march=nvptx64 -mcpu=sm_35 | FileCheck %s


; CHECK: .version 3.2
; CHECK: .target sm_35

1 change: 1 addition & 0 deletions test/CodeGen/NVPTX/sm-version-37.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
; RUN: llc < %s -march=nvptx64 -mcpu=sm_37 | FileCheck %s


; CHECK: .version 4.1
; CHECK: .target sm_37

7 changes: 7 additions & 0 deletions test/CodeGen/NVPTX/sm-version-50.ll
Original file line number Diff line number Diff line change
@@ -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

1 change: 1 addition & 0 deletions test/CodeGen/NVPTX/sm-version-52.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
; RUN: llc < %s -march=nvptx64 -mcpu=sm_52 | FileCheck %s


; CHECK: .version 4.1
; CHECK: .target sm_52

1 change: 1 addition & 0 deletions test/CodeGen/NVPTX/sm-version-53.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
; RUN: llc < %s -march=nvptx64 -mcpu=sm_53 | FileCheck %s


; CHECK: .version 4.2
; CHECK: .target sm_53

0 comments on commit e6d6461

Please sign in to comment.