diff options
author | Justin Lebar <jlebar@google.com> | 2016-04-15 00:32:09 +0000 |
---|---|---|
committer | Justin Lebar <jlebar@google.com> | 2016-04-15 00:32:09 +0000 |
commit | cad81cf6b3032d9956f4e772431bb499a74a9ddb (patch) | |
tree | fa748b79d42db7712980c77ac8f5edc75fcbf2b8 /llvm/test/Transforms | |
parent | 812e5595890da74e531c47b90db8ddd24b57fe8c (diff) | |
download | bcm5719-llvm-cad81cf6b3032d9956f4e772431bb499a74a9ddb.tar.gz bcm5719-llvm-cad81cf6b3032d9956f4e772431bb499a74a9ddb.zip |
[Speculation] Add a SpeculativeExecution mode where the pass does nothing unless TTI::hasBranchDivergence() is true.
Summary:
This lets us add this pass to the IR pass manager unconditionally; it
will simply not do anything on targets without branch divergence.
Reviewers: tra
Subscribers: llvm-commits, jingyue, rnk, chandlerc
Differential Revision: http://reviews.llvm.org/D18625
llvm-svn: 266398
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r-- | llvm/test/Transforms/SpeculativeExecution/divergent-target.ll | 22 |
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 +} |