Andrew Savonichev 0f1b5f115a [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
2022-04-28 14:59:45 +03:00

67 lines
1.9 KiB
LLVM

; RUN: llc < %s -march=nvptx64 -mcpu=sm_30 -mattr=+ptx60 | FileCheck %s
; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_30 -mattr=+ptx60 | %ptxas-verify %if !ptxas-11.0 %{-arch=sm_30%} %}
declare i1 @llvm.nvvm.vote.all(i1)
; CHECK-LABEL: .func{{.*}}vote_all
define i1 @vote_all(i1 %pred) {
; CHECK: vote.all.pred
%val = call i1 @llvm.nvvm.vote.all(i1 %pred)
ret i1 %val
}
declare i1 @llvm.nvvm.vote.any(i1)
; CHECK-LABEL: .func{{.*}}vote_any
define i1 @vote_any(i1 %pred) {
; CHECK: vote.any.pred
%val = call i1 @llvm.nvvm.vote.any(i1 %pred)
ret i1 %val
}
declare i1 @llvm.nvvm.vote.uni(i1)
; CHECK-LABEL: .func{{.*}}vote_uni
define i1 @vote_uni(i1 %pred) {
; CHECK: vote.uni.pred
%val = call i1 @llvm.nvvm.vote.uni(i1 %pred)
ret i1 %val
}
declare i32 @llvm.nvvm.vote.ballot(i1)
; CHECK-LABEL: .func{{.*}}vote_ballot
define i32 @vote_ballot(i1 %pred) {
; CHECK: vote.ballot.b32
%val = call i32 @llvm.nvvm.vote.ballot(i1 %pred)
ret i32 %val
}
declare i1 @llvm.nvvm.vote.all.sync(i32, i1)
; CHECK-LABEL: .func{{.*}}vote_sync_all
define i1 @vote_sync_all(i32 %mask, i1 %pred) {
; CHECK: vote.sync.all.pred
%val = call i1 @llvm.nvvm.vote.all.sync(i32 %mask, i1 %pred)
ret i1 %val
}
declare i1 @llvm.nvvm.vote.any.sync(i32, i1)
; CHECK-LABEL: .func{{.*}}vote_sync_any
define i1 @vote_sync_any(i32 %mask, i1 %pred) {
; CHECK: vote.sync.any.pred
%val = call i1 @llvm.nvvm.vote.any.sync(i32 %mask, i1 %pred)
ret i1 %val
}
declare i1 @llvm.nvvm.vote.uni.sync(i32, i1)
; CHECK-LABEL: .func{{.*}}vote_sync_uni
define i1 @vote_sync_uni(i32 %mask, i1 %pred) {
; CHECK: vote.sync.uni.pred
%val = call i1 @llvm.nvvm.vote.uni.sync(i32 %mask, i1 %pred)
ret i1 %val
}
declare i32 @llvm.nvvm.vote.ballot.sync(i32, i1)
; CHECK-LABEL: .func{{.*}}vote_sync_ballot
define i32 @vote_sync_ballot(i32 %mask, i1 %pred) {
; CHECK: vote.sync.ballot.b32
%val = call i32 @llvm.nvvm.vote.ballot.sync(i32 %mask, i1 %pred)
ret i32 %val
}