summaryrefslogtreecommitdiffstats
path: root/llvm/tools
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
commit8b1e021e85878c773e042dade2a30892f896c9c3 (patch)
tree603dd63f3e8f9a4281c1a80157f5a850a2f9fed3 /llvm/tools
parent94faa4d0d4258ab534c1c9642f46ae41b52f07e5 (diff)
downloadbcm5719-llvm-8b1e021e85878c773e042dade2a30892f896c9c3.tar.gz
bcm5719-llvm-8b1e021e85878c773e042dade2a30892f896c9c3.zip
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 llvm-svn: 187278
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/lto/LTOCodeGenerator.cpp2
-rw-r--r--llvm/tools/opt/opt.cpp3
2 files changed, 4 insertions, 1 deletions
diff --git a/llvm/tools/lto/LTOCodeGenerator.cpp b/llvm/tools/lto/LTOCodeGenerator.cpp
index 6139ade9bce..776a5b9e96f 100644
--- a/llvm/tools/lto/LTOCodeGenerator.cpp
+++ b/llvm/tools/lto/LTOCodeGenerator.cpp
@@ -118,7 +118,7 @@ void LTOCodeGenerator::initializeLTOPasses() {
initializeGVNPass(R);
initializeMemCpyOptPass(R);
initializeDCEPass(R);
- initializeCFGSimplifyPassPass(R);
+ initializeCFGCanonicalizePass(R);
}
bool LTOCodeGenerator::addModule(LTOModule* mod, std::string& errMsg) {
diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp
index 68fca83c96a..fa0a0ed2ba5 100644
--- a/llvm/tools/opt/opt.cpp
+++ b/llvm/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) {
OpenPOWER on IntegriCloud