diff options
author | Chris Lattner <sabre@nondot.org> | 2003-10-05 21:20:13 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-10-05 21:20:13 +0000 |
commit | 43f820d1f7638656be2158efac7dd8f5b08b8b77 (patch) | |
tree | 0c76a6800c38ea268a5d0e75a88f3ddea34ea9ed /lib/Transforms/Scalar/ScalarReplAggregates.cpp | |
parent | 5b15deedc01babcf40d74e0c9e48efead6a888e2 (diff) |
Change the interface to PromoteMemToReg to also take a DominatorTree
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8883 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/ScalarReplAggregates.cpp')
-rw-r--r-- | lib/Transforms/Scalar/ScalarReplAggregates.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/lib/Transforms/Scalar/ScalarReplAggregates.cpp index adcbaffac0..4b23ea2fbd 100644 --- a/lib/Transforms/Scalar/ScalarReplAggregates.cpp +++ b/lib/Transforms/Scalar/ScalarReplAggregates.cpp @@ -38,6 +38,7 @@ namespace { // getAnalysisUsage - This pass does not require any passes, but we know it // will not alter the CFG, so say so. virtual void getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequired<DominatorTree>(); AU.addRequired<DominanceFrontier>(); AU.addRequired<TargetData>(); AU.setPreservesCFG(); @@ -74,6 +75,8 @@ bool SROA::runOnFunction(Function &F) { bool SROA::performPromotion(Function &F) { std::vector<AllocaInst*> Allocas; const TargetData &TD = getAnalysis<TargetData>(); + DominatorTree &DT = getAnalysis<DominatorTree>(); + DominanceFrontier &DF = getAnalysis<DominanceFrontier>(); BasicBlock &BB = F.getEntryBlock(); // Get the entry node for the function @@ -91,7 +94,7 @@ bool SROA::performPromotion(Function &F) { if (Allocas.empty()) break; - PromoteMemToReg(Allocas, getAnalysis<DominanceFrontier>(), TD); + PromoteMemToReg(Allocas, DT, DF, TD); NumPromoted += Allocas.size(); Changed = true; } |