summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/SpeculativeExecution
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Transforms/SpeculativeExecution')
-rw-r--r--llvm/test/Transforms/SpeculativeExecution/divergent-target.ll22
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/test/Transforms/SpeculativeExecution/divergent-target.ll b/llvm/test/Transforms/SpeculativeExecution/divergent-target.ll
new file mode 100644
index 00000000000..d3f2a3fa0d3
--- /dev/null
+++ b/llvm/test/Transforms/SpeculativeExecution/divergent-target.ll
@@ -0,0 +1,22 @@
+; RUN: opt < %s -S -mtriple=nvptx-nvidia-cuda -speculative-execution | \
+; RUN: FileCheck --check-prefix=ON %s
+; RUN: opt < %s -S -mtriple=nvptx-nvidia-cuda -speculative-execution \
+; RUN: -spec-exec-only-if-divergent-target | \
+; RUN: FileCheck --check-prefix=ON %s
+; RUN: opt < %s -S -march=x86_64 -speculative-execution \
+; RUN: -spec-exec-only-if-divergent-target | \
+; RUN: FileCheck --check-prefix=OFF %s
+
+; Hoist in if-then pattern.
+define void @f() {
+; ON: %x = add i32 2, 3
+; ON: br i1 true
+; OFF: br i1 true
+; OFF: %x = add i32 2, 3
+ br i1 true, label %a, label %b
+a:
+ %x = add i32 2, 3
+ br label %b
+b:
+ ret void
+}
OpenPOWER on IntegriCloud