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
23 lines
990 B
LLVM
23 lines
990 B
LLVM
; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s --check-prefix=PTX32
|
|
; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 | FileCheck %s --check-prefix=PTX64
|
|
; RUN: %if ptxas %{ llc < %s -march=nvptx -mcpu=sm_20 | %ptxas-verify %}
|
|
; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_20 | %ptxas-verify %}
|
|
|
|
; Make sure we emit these globals in def-use order
|
|
|
|
|
|
; PTX32: .visible .global .align 1 .u8 a = 2;
|
|
; PTX32-NEXT: .visible .global .align 4 .u32 a2 = a;
|
|
; PTX64: .visible .global .align 1 .u8 a = 2;
|
|
; PTX64-NEXT: .visible .global .align 8 .u64 a2 = a;
|
|
@a2 = addrspace(1) global i8 addrspace(1)* @a
|
|
@a = addrspace(1) global i8 2
|
|
|
|
|
|
; PTX32: .visible .global .align 1 .u8 b = 1;
|
|
; PTX32-NEXT: .visible .global .align 4 .u32 b2[2] = {b, b};
|
|
; PTX64: .visible .global .align 1 .u8 b = 1;
|
|
; PTX64-NEXT: .visible .global .align 8 .u64 b2[2] = {b, b};
|
|
@b2 = addrspace(1) global [2 x i8 addrspace(1)*] [i8 addrspace(1)* @b, i8 addrspace(1)* @b]
|
|
@b = addrspace(1) global i8 1
|