summaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/SimplifyIndVar.cpp
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2011-08-10 04:22:26 +0000
committerAndrew Trick <atrick@apple.com>2011-08-10 04:22:26 +0000
commitbddb7f82103deb226baa6793f41c5961661167e7 (patch)
treecbdd86ff1b4ac7c67828e0880bfc573f087b9d29 /lib/Transforms/Utils/SimplifyIndVar.cpp
parentea23daa4461de489abbfd54a9641091862945f3e (diff)
downloadllvm-bddb7f82103deb226baa6793f41c5961661167e7.tar.gz
llvm-bddb7f82103deb226baa6793f41c5961661167e7.tar.bz2
llvm-bddb7f82103deb226baa6793f41c5961661167e7.tar.xz
Cleanup. Make ScalarEvolution an explicit argument of the
SimplifyIndVar utility since it is required. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137202 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/SimplifyIndVar.cpp')
-rw-r--r--lib/Transforms/Utils/SimplifyIndVar.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/Transforms/Utils/SimplifyIndVar.cpp b/lib/Transforms/Utils/SimplifyIndVar.cpp
index be6a1e0019..0cf372a53f 100644
--- a/lib/Transforms/Utils/SimplifyIndVar.cpp
+++ b/lib/Transforms/Utils/SimplifyIndVar.cpp
@@ -54,16 +54,16 @@ namespace {
bool Changed;
public:
- SimplifyIndvar(Loop *Loop, LPPassManager *LPM,
+ SimplifyIndvar(Loop *Loop, ScalarEvolution *SE, LPPassManager *LPM,
SmallVectorImpl<WeakVH> &Dead, IVUsers *IVU = NULL) :
L(Loop),
LI(LPM->getAnalysisIfAvailable<LoopInfo>()),
- SE(LPM->getAnalysisIfAvailable<ScalarEvolution>()),
+ SE(SE),
IU(IVU),
TD(LPM->getAnalysisIfAvailable<TargetData>()),
DeadInsts(Dead),
Changed(false) {
- assert(LI && SE && "IV simplification requires ScalarEvolution");
+ assert(LI && "IV simplification requires LoopInfo");
}
bool hasChanged() const { return Changed; }
@@ -372,22 +372,22 @@ namespace llvm {
/// simplifyUsersOfIV - Simplify instructions that use this induction variable
/// by using ScalarEvolution to analyze the IV's recurrence.
-bool simplifyUsersOfIV(PHINode *CurrIV, LPPassManager *LPM,
+bool simplifyUsersOfIV(PHINode *CurrIV, ScalarEvolution *SE, LPPassManager *LPM,
SmallVectorImpl<WeakVH> &Dead, IVVisitor *V)
{
LoopInfo *LI = &LPM->getAnalysis<LoopInfo>();
- SimplifyIndvar SIV(LI->getLoopFor(CurrIV->getParent()), LPM, Dead);
+ SimplifyIndvar SIV(LI->getLoopFor(CurrIV->getParent()), SE, LPM, Dead);
SIV.simplifyUsers(CurrIV, V);
return SIV.hasChanged();
}
/// simplifyLoopIVs - Simplify users of induction variables within this
/// loop. This does not actually change or add IVs.
-bool simplifyLoopIVs(Loop *L, LPPassManager *LPM,
+bool simplifyLoopIVs(Loop *L, ScalarEvolution *SE, LPPassManager *LPM,
SmallVectorImpl<WeakVH> &Dead) {
bool Changed = false;
for (BasicBlock::iterator I = L->getHeader()->begin(); isa<PHINode>(I); ++I) {
- Changed |= simplifyUsersOfIV(cast<PHINode>(I), LPM, Dead);
+ Changed |= simplifyUsersOfIV(cast<PHINode>(I), SE, LPM, Dead);
}
return Changed;
}
@@ -397,9 +397,9 @@ bool simplifyLoopIVs(Loop *L, LPPassManager *LPM,
///
/// This is the old approach to IV simplification to be replaced by
/// SimplifyLoopIVs.
-bool simplifyIVUsers(IVUsers *IU, LPPassManager *LPM,
+bool simplifyIVUsers(IVUsers *IU, ScalarEvolution *SE, LPPassManager *LPM,
SmallVectorImpl<WeakVH> &Dead) {
- SimplifyIndvar SIV(IU->getLoop(), LPM, Dead);
+ SimplifyIndvar SIV(IU->getLoop(), SE, LPM, Dead);
// Each round of simplification involves a round of eliminating operations
// followed by a round of widening IVs. A single IVUsers worklist is used