File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,9 @@ class NVPTXSubtarget : public NVPTXGenSubtargetInfo {
95
95
bool hasDotInstructions () const {
96
96
return SmVersion >= 61 && PTXVersion >= 50 ;
97
97
}
98
+ bool hasPTXASUnreachableBug () const {
99
+ return SmVersion < 70 && PTXVersion <= 74 ;
100
+ }
98
101
bool hasCvtaParam () const { return SmVersion >= 70 && PTXVersion >= 77 ; }
99
102
unsigned int getFullSmVersion () const { return FullSmVersion; }
100
103
unsigned int getSmVersion () const { return getFullSmVersion () / 10 ; }
Original file line number Diff line number Diff line change @@ -368,11 +368,9 @@ void NVPTXPassConfig::addIRPasses() {
368
368
addPass (createSROAPass ());
369
369
}
370
370
371
- if (ST.getPTXVersion () <= 74 ) {
372
- // This pass is a WAR for a bug that's present in `ptxas` binaries that are
373
- // shipped in or prior to CUDA Toolkit 11.4. The highest version that's
374
- // supported by `ptxas` in CUDA 11.4 is 7.4. Limit this pass to only run
375
- // when targeting PTX 7.4 or lower.
371
+ if (ST.hasPTXASUnreachableBug ()) {
372
+ // Run LowerUnreachable to WAR a ptxas bug. See the commit description of
373
+ // 1ee4d880e8760256c606fe55b7af85a4f70d006d for more details.
376
374
const auto &Options = getNVPTXTargetMachine ().Options ;
377
375
addPass (createNVPTXLowerUnreachablePass (Options.TrapUnreachable ,
378
376
Options.NoTrapAfterNoreturn ));
Original file line number Diff line number Diff line change 3
3
; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 -verify-machineinstrs \
4
4
; RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-NOTRAP
5
5
; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 -verify-machineinstrs -mattr=+ptx75 \
6
- ; RUN: | FileCheck %s --check-prefixes=CHECK-PTX75
6
+ ; RUN: | FileCheck %s --check-prefixes=CHECK-BUG-FIXED
7
+ ; RUN: llc < %s -march=nvptx64 -mcpu=sm_70 -verify-machineinstrs \
8
+ ; RUN: | FileCheck %s --check-prefixes=CHECK-BUG-FIXED
7
9
; RUN: llc < %s -march=nvptx -mcpu=sm_20 -verify-machineinstrs -trap-unreachable \
8
10
; RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-TRAP
9
11
; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 -verify-machineinstrs -trap-unreachable \
@@ -23,7 +25,7 @@ define void @kernel_func() {
23
25
; CHECK-TRAP: trap;
24
26
; CHECK-NOTRAP-NOT: trap;
25
27
; CHECK: exit;
26
- ; CHECK-PTX75 -NOT: exit;
28
+ ; CHECK-BUG-FIXED -NOT: exit;
27
29
unreachable
28
30
}
29
31
You can’t perform that action at this time.
0 commit comments