aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/Mem2Reg.cpp
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2011-01-17 01:08:59 +0000
committerCameron Zwarich <zwarich@apple.com>2011-01-17 01:08:59 +0000
commit814cd9233e8543904f6835e8f7badf894f2370ed (patch)
tree7618a232f9ca48fb5c4193e4855dcba27b0c584f /llvm/lib/Transforms/Utils/Mem2Reg.cpp
parent7d92ee38523f21d41593e953034a9069dfdda70d (diff)
downloadllvm-814cd9233e8543904f6835e8f7badf894f2370ed.zip
llvm-814cd9233e8543904f6835e8f7badf894f2370ed.tar.gz
llvm-814cd9233e8543904f6835e8f7badf894f2370ed.tar.bz2
Eliminate the use of dominance frontiers in PromoteMemToReg. In addition to
eliminating a potentially quadratic data structure, this also gives a 17% speedup when running -scalarrepl on test-suite + SPEC2000 + SPEC2006. My initial experiment gave a greater speedup around 25%, but I moved the dominator tree level computation from dominator tree construction to PromoteMemToReg. Since this approach to computing IDFs has a much lower overhead than the old code using precomputed DFs, it is worth looking at using this new code for the second scalarrepl pass as well. llvm-svn: 123609
Diffstat (limited to 'llvm/lib/Transforms/Utils/Mem2Reg.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Mem2Reg.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/Mem2Reg.cpp b/llvm/lib/Transforms/Utils/Mem2Reg.cpp
index 2b1364c..ea2f8fc 100644
--- a/llvm/lib/Transforms/Utils/Mem2Reg.cpp
+++ b/llvm/lib/Transforms/Utils/Mem2Reg.cpp
@@ -40,7 +40,6 @@ namespace {
//
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<DominatorTree>();
- AU.addRequired<DominanceFrontier>();
AU.setPreservesCFG();
// This is a cluster of orthogonal Transforms
AU.addPreserved<UnifyFunctionExitNodes>();
@@ -54,7 +53,6 @@ char PromotePass::ID = 0;
INITIALIZE_PASS_BEGIN(PromotePass, "mem2reg", "Promote Memory to Register",
false, false)
INITIALIZE_PASS_DEPENDENCY(DominatorTree)
-INITIALIZE_PASS_DEPENDENCY(DominanceFrontier)
INITIALIZE_PASS_END(PromotePass, "mem2reg", "Promote Memory to Register",
false, false)
@@ -66,7 +64,6 @@ bool PromotePass::runOnFunction(Function &F) {
bool Changed = false;
DominatorTree &DT = getAnalysis<DominatorTree>();
- DominanceFrontier &DF = getAnalysis<DominanceFrontier>();
while (1) {
Allocas.clear();
@@ -80,7 +77,7 @@ bool PromotePass::runOnFunction(Function &F) {
if (Allocas.empty()) break;
- PromoteMemToReg(Allocas, DT, DF);
+ PromoteMemToReg(Allocas, DT);
NumPromoted += Allocas.size();
Changed = true;
}