summaryrefslogtreecommitdiff
path: root/tools/opt/opt.cpp
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2013-07-27 00:01:07 +0000
committerTom Stellard <thomas.stellard@amd.com>2013-07-27 00:01:07 +0000
commit57e6b2d1f3de0bf459e96f7038e692d624f7e580 (patch)
tree42204d51445bcb178a24fa07fe9da2d1d22818ff /tools/opt/opt.cpp
parent018696db4587dc6a0d8081d0627543f5c08b6c97 (diff)
downloadllvm-57e6b2d1f3de0bf459e96f7038e692d624f7e580.tar.gz
llvm-57e6b2d1f3de0bf459e96f7038e692d624f7e580.tar.bz2
llvm-57e6b2d1f3de0bf459e96f7038e692d624f7e580.tar.xz
SimplifyCFG: Use parallel-and and parallel-or mode to consolidate branch conditions
Merge consecutive if-regions if they contain identical statements. Both transformations reduce number of branches. The transformation is guarded by a target-hook, and is currently enabled only for +R600, but the correctness has been tested on X86 target using a variety of CPU benchmarks. Patch by: Mei Ye git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187278 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/opt/opt.cpp')
-rw-r--r--tools/opt/opt.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp
index 68fca83c96..fa0a0ed2ba 100644
--- a/tools/opt/opt.cpp
+++ b/tools/opt/opt.cpp
@@ -667,6 +667,9 @@ int main(int argc, char **argv) {
FPasses.reset(new FunctionPassManager(M.get()));
if (TD)
FPasses->add(new DataLayout(*TD));
+ if (TM.get())
+ TM->addAnalysisPasses(*FPasses);
+
}
if (PrintBreakpoints) {