Skip to content

Commit 0f1b5f1

Browse files
committed
[NVPTX] Integrate ptxas to LIT tests
ptxas is a proprietary compiler from Nvidia that can compile PTX to machine code (SASS). It has a lot of diagnostics to catch errors in PTX, which can be used to verify PTX output from llc. Set -DPXTAS_EXECUTABLE=/path/to/ptxas CMake option to enable it. If this option is not set, then ptxas is substituted to true which effectively disables all ptxas RUN lines. LLVM_PTXAS_EXECUTABLE environment variable takes precedence over the CMake option, and allows to override ptxas executable that is used for LIT without complete re-configuration. Differential Revision: https://reviews.llvm.org/D121727
1 parent b1f1688 commit 0f1b5f1

File tree

190 files changed

+370
-16
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+370
-16
lines changed

llvm/test/CodeGen/NVPTX/LoadStoreVectorizer.ll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
; RUN: llc < %s | FileCheck -check-prefix=ENABLED %s
22
; RUN: llc -disable-nvptx-load-store-vectorizer < %s | FileCheck -check-prefix=DISABLED %s
3+
; RUN: %if ptxas %{ llc < %s | %ptxas-verify %}
4+
; RUN: %if ptxas %{ llc -disable-nvptx-load-store-vectorizer < %s | %ptxas-verify %}
5+
36
target triple = "nvptx64-nvidia-cuda"
47

58
; Check that the load-store vectorizer is enabled by default for nvptx, and

llvm/test/CodeGen/NVPTX/MachineSink-call.ll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
; RUN: llc < %s | FileCheck %s
2+
; RUN: %if ptxas %{ llc < %s | %ptxas-verify %}
3+
24
target triple = "nvptx64-nvidia-cuda"
35

46
declare void @foo()

llvm/test/CodeGen/NVPTX/MachineSink-convergent.ll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
; RUN: llc < %s | FileCheck %s
2+
; RUN: %if ptxas %{ llc < %s | %ptxas-verify %}
3+
24
target triple = "nvptx64-nvidia-cuda"
35

46
declare void @llvm.nvvm.barrier0()

llvm/test/CodeGen/NVPTX/TailDuplication-convergent.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
; RUN: llc -O2 -tail-dup-size=100 -enable-tail-merge=0 < %s | FileCheck %s
2+
; RUN: %if ptxas %{ llc -O2 -tail-dup-size=100 -enable-tail-merge=0 < %s | %ptxas-verify %}
23
target triple = "nvptx64-nvidia-cuda"
34

45
declare void @foo()

llvm/test/CodeGen/NVPTX/access-non-generic.ll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 | FileCheck %s --check-prefix PTX
33
; RUN: opt -mtriple=nvptx-- < %s -S -infer-address-spaces | FileCheck %s --check-prefix IR
44
; RUN: opt -mtriple=nvptx64-- < %s -S -infer-address-spaces | FileCheck %s --check-prefix IR
5+
; RUN: %if ptxas %{ llc < %s -march=nvptx -mcpu=sm_20 | %ptxas-verify %}
6+
; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_20 | %ptxas-verify %}
57

68
@array = internal addrspace(3) global [10 x float] zeroinitializer, align 4
79
@scalar = internal addrspace(3) global float 0.000000e+00, align 4

llvm/test/CodeGen/NVPTX/add-128bit.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
2+
; RUN: %if ptxas %{ llc < %s -march=nvptx -mcpu=sm_20 | %ptxas-verify %}
23

34
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-n16:32:64"
45

llvm/test/CodeGen/NVPTX/addrspacecast-gvar.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
2+
; RUN: %if ptxas %{ llc < %s -march=nvptx -mcpu=sm_20 | %ptxas-verify %}
23

34
; CHECK: .visible .global .align 4 .u32 g = 42;
45
; CHECK: .visible .global .align 4 .u32 g2 = generic(g);

llvm/test/CodeGen/NVPTX/addrspacecast.ll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
; RUN: llc -O0 < %s -march=nvptx -mcpu=sm_20 | FileCheck %s -check-prefixes=ALL,CLS32,G32
22
; RUN: llc -O0 < %s -march=nvptx64 -mcpu=sm_20 | FileCheck %s -check-prefixes=ALL,NOPTRCONV,CLS64,G64
33
; RUN: llc -O0 < %s -march=nvptx64 -mcpu=sm_20 --nvptx-short-ptr| FileCheck %s -check-prefixes=ALL,PTRCONV,CLS64,G64
4+
; RUN: %if ptxas %{ llc -O0 < %s -march=nvptx -mcpu=sm_20 | %ptxas-verify %}
5+
; RUN: %if ptxas %{ llc -O0 < %s -march=nvptx64 -mcpu=sm_20 | %ptxas-verify %}
6+
; RUN: %if ptxas %{ llc -O0 < %s -march=nvptx64 -mcpu=sm_20 --nvptx-short-ptr | %ptxas-verify %}
47

58
; ALL-LABEL: conv1
69
define i32 @conv1(i32 addrspace(1)* %ptr) {

llvm/test/CodeGen/NVPTX/aggr-param.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
2+
; RUN: %if ptxas %{ llc < %s -march=nvptx -mcpu=sm_20 | %ptxas-verify %}
23

34
; Make sure aggregate param types get emitted properly.
45

llvm/test/CodeGen/NVPTX/aggregate-return.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
; RUN: llc < %s -march=nvptx64 -mcpu=sm_35 | FileCheck %s
2+
; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_35 | %ptxas-verify -arch=sm_35 %}
23

34
declare <2 x float> @barv(<2 x float> %input)
45
declare <3 x float> @barv3(<3 x float> %input)

0 commit comments

Comments
 (0)