summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Lebar <jlebar@google.com>2016-04-15 00:32:12 +0000
committerJustin Lebar <jlebar@google.com>2016-04-15 00:32:12 +0000
commitcf63b64fc645406939abdec1d8879c8bc8f24d0d (patch)
tree112aa233249e19941700186cb5980277a9e505d7
parentcad81cf6b3032d9956f4e772431bb499a74a9ddb (diff)
downloadbcm5719-llvm-cf63b64fc645406939abdec1d8879c8bc8f24d0d.tar.gz
bcm5719-llvm-cf63b64fc645406939abdec1d8879c8bc8f24d0d.zip
[PM] Add a SpeculativeExecution pass for targets with divergent branches.
Summary: This IR pass is helpful for GPUs, and other targets with divergent branches. It's a nop on targets without divergent branches. Reviewers: chandlerc Subscribers: llvm-commits, jingyue, rnk, joker.eph, tra Differential Revision: http://reviews.llvm.org/D18626 llvm-svn: 266399
-rw-r--r--llvm/lib/Transforms/IPO/PassManagerBuilder.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
index 880dffa7a95..91b7dd0b52e 100644
--- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
+++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -234,6 +234,8 @@ void PassManagerBuilder::addFunctionSimplificationPasses(
else
MPM.add(createScalarReplAggregatesPass(-1, false));
MPM.add(createEarlyCSEPass()); // Catch trivial redundancies
+ // Speculative execution if the target has divergent branches; otherwise nop.
+ MPM.add(createSpeculativeExecutionIfHasBranchDivergencePass());
MPM.add(createJumpThreadingPass()); // Thread jumps.
MPM.add(createCorrelatedValuePropagationPass()); // Propagate conditionals
MPM.add(createCFGSimplificationPass()); // Merge & remove BBs
OpenPOWER on IntegriCloud