Skip to content

Commit 5585d99

Browse files
committed
[NVPTX] Fix issues in ptxas integration to LIT tests
1) Fixed a typo in PTXAS_EXECUTABLE CMake variable (PXTAS -> PTXAS). 2) Version check was implemented incorrectly, now version (major, minor) is converted to int for comparison. 3) ptxas -arch argument was incorrect (or missing) in 3 tests. Differential Revision: https://reviews.llvm.org/D127866
1 parent 3933c43 commit 5585d99

File tree

5 files changed

+15
-11
lines changed

5 files changed

+15
-11
lines changed

llvm/test/CodeGen/NVPTX/atomicrmw-expand.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; RUN: llc < %s -march=nvptx64 -mcpu=sm_30 | FileCheck %s --check-prefixes=ALL,SM30
22
; RUN: llc < %s -march=nvptx64 -mcpu=sm_60 | FileCheck %s --check-prefixes=ALL,SM60
3-
; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_30 | %ptxas-verify %}
4-
; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_60 | %ptxas-verify %}
3+
; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_30 | %ptxas-verify %if !ptxas-11.0 %{-arch=sm_30%} %}
4+
; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_60 | %ptxas-verify -arch=sm_60 %}
55

66
; CHECK-LABEL: fadd_double
77
define void @fadd_double(ptr %0, double %1) {

llvm/test/CodeGen/NVPTX/bug52623.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
; RUN: llc < %s -march=nvptx -mcpu=sm_75 -verify-machineinstrs
2-
; RUN: %if ptxas %{ llc < %s -march=nvptx -mcpu=sm_75 | %ptxas-verify %}
1+
; RUN: llc < %s -march=nvptx -verify-machineinstrs
2+
; RUN: %if ptxas %{ llc < %s -march=nvptx | %ptxas-verify %}
33

44
; Check that llc will not crash even when first MBB doesn't contain
55
; any instruction.

llvm/test/CodeGen/NVPTX/ldu-ldg.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
2-
; RUN: %if ptxas %{ llc < %s -march=nvptx -mcpu=sm_20 | %ptxas-verify %}
1+
; RUN: llc < %s -march=nvptx -mcpu=sm_32 | FileCheck %s
2+
; RUN: %if ptxas %{ llc < %s -march=nvptx -mcpu=sm_32 | %ptxas-verify %if !ptxas-11.0 %{-arch=sm_32%} %}
33

44

55
declare i8 @llvm.nvvm.ldu.global.i.i8.p1i8(i8 addrspace(1)* %ptr, i32 %align)

llvm/test/lit.cfg.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,19 +216,23 @@ def enable_ptxas(ptxas_executable):
216216
(11, 0), (11, 1), (11, 2), (11, 3), (11, 4), (11, 5), (11, 6),
217217
]
218218

219+
def version_int(ver):
220+
return ver[0] * 100 + ver[1]
221+
219222
# ignore ptxas if its version is below the minimum supported
220223
# version
221224
min_version = ptxas_known_versions[0]
222-
if version[0] < min_version[0] or version[1] < min_version[1]:
225+
if version_int(version) < version_int(min_version):
223226
print(
224227
'Warning: ptxas version {}.{} is not supported'.format(
225228
version[0], version[1]))
226229
return
227230

228-
for known_major, known_minor in ptxas_known_versions:
229-
if known_major <= version[0] and known_minor <= version[1]:
231+
for known_version in ptxas_known_versions:
232+
if version_int(known_version) <= version_int(version):
233+
major, minor = known_version
230234
config.available_features.add(
231-
'ptxas-{}.{}'.format(known_major, known_minor))
235+
'ptxas-{}.{}'.format(major, minor))
232236

233237
config.available_features.add('ptxas')
234238
tools.extend([ToolSubst('%ptxas', ptxas_executable),

llvm/test/lit.site.cfg.py.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ config.have_ocamlopt = @HAVE_OCAMLOPT@
2323
config.ocaml_flags = "@OCAMLFLAGS@"
2424
config.include_go_tests = @LLVM_INCLUDE_GO_TESTS@
2525
config.go_executable = "@GO_EXECUTABLE@"
26-
config.ptxas_executable = "@PXTAS_EXECUTABLE@"
26+
config.ptxas_executable = "@PTXAS_EXECUTABLE@"
2727
config.enable_shared = @ENABLE_SHARED@
2828
config.enable_assertions = @ENABLE_ASSERTIONS@
2929
config.targets_to_build = "@TARGETS_TO_BUILD@"

0 commit comments

Comments
 (0)