summaryrefslogtreecommitdiff
path: root/test/CodeGen/NVPTX/vote.ll
diff options
context:
space:
mode:
authorArtem Belevich <tra@google.com>2017-09-21 18:44:49 +0000
committerArtem Belevich <tra@google.com>2017-09-21 18:44:49 +0000
commitc02a4f5a57b8786e77949bba6c6383cd068d2105 (patch)
treee0cc6a28894f34e1224fdd5daf482e069e525a36 /test/CodeGen/NVPTX/vote.ll
parent84148478f0f79ad695d82601769f7e353815fcd4 (diff)
[NVPTX] Implemented bar.warp.sync, barrier.sync, and vote{.sync} instructions/intrinsics/builtins.
Differential Revision: https://reviews.llvm.org/D38148 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313898 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/NVPTX/vote.ll')
-rw-r--r--test/CodeGen/NVPTX/vote.ll65
1 files changed, 65 insertions, 0 deletions
diff --git a/test/CodeGen/NVPTX/vote.ll b/test/CodeGen/NVPTX/vote.ll
new file mode 100644
index 00000000000..c28e795fe57
--- /dev/null
+++ b/test/CodeGen/NVPTX/vote.ll
@@ -0,0 +1,65 @@
+; RUN: llc < %s -march=nvptx64 -mcpu=sm_30 -mattr=+ptx60 | FileCheck %s
+
+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
+}