aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2011-07-16 01:06:48 +0000
committerAndrew Trick <atrick@apple.com>2011-07-16 01:06:48 +0000
commit6f684b0becc4c1b2ece3ec6dcecf30b19343128d (patch)
treebb58f486073fec447be08075ce7a6c5fadf71088 /lib/Transforms
parentd152d03a476b8d0d4b26577db26e2ba76034b0f3 (diff)
indvars: remove ExprToIVMap because it won't be needed by LFTR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135334 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/IndVarSimplify.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp
index 677e7908f5..96a43cb665 100644
--- a/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -81,15 +81,12 @@ static cl::opt<bool> DisableIVRewrite(
namespace {
class IndVarSimplify : public LoopPass {
- typedef DenseMap< const SCEV *, AssertingVH<PHINode> > ExprToIVMapTy;
-
IVUsers *IU;
LoopInfo *LI;
ScalarEvolution *SE;
DominatorTree *DT;
TargetData *TD;
- ExprToIVMapTy ExprToIVMap;
SmallVector<WeakVH, 16> DeadInsts;
bool Changed;
public:
@@ -120,7 +117,6 @@ namespace {
private:
virtual void releaseMemory() {
- ExprToIVMap.clear();
DeadInsts.clear();
}
@@ -1409,13 +1405,14 @@ void IndVarSimplify::SimplifyIVUsersNoRewrite(Loop *L, SCEVExpander &Rewriter) {
/// populate ExprToIVMap for use later.
///
void IndVarSimplify::SimplifyCongruentIVs(Loop *L) {
+ DenseMap<const SCEV *, PHINode *> ExprToIVMap;
for (BasicBlock::iterator I = L->getHeader()->begin(); isa<PHINode>(I); ++I) {
PHINode *Phi = cast<PHINode>(I);
if (!SE->isSCEVable(Phi->getType()))
continue;
const SCEV *S = SE->getSCEV(Phi);
- ExprToIVMapTy::const_iterator Pos;
+ DenseMap<const SCEV *, PHINode *>::const_iterator Pos;
bool Inserted;
tie(Pos, Inserted) = ExprToIVMap.insert(std::make_pair(S, Phi));
if (Inserted)
@@ -1709,7 +1706,6 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
DT = &getAnalysis<DominatorTree>();
TD = getAnalysisIfAvailable<TargetData>();
- ExprToIVMap.clear();
DeadInsts.clear();
Changed = false;
@@ -1746,8 +1742,7 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
if (!DisableIVRewrite)
SimplifyIVUsers(Rewriter);
- // Eliminate redundant IV cycles and populate ExprToIVMap.
- // TODO: use ExprToIVMap to allow LFTR without canonical IVs
+ // Eliminate redundant IV cycles.
if (DisableIVRewrite)
SimplifyCongruentIVs(L);
@@ -1838,7 +1833,6 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
// can be deleted in the loop below, causing the AssertingVH in the cache to
// trigger.
Rewriter.clear();
- ExprToIVMap.clear();
// Now that we're done iterating through lists, clean up any instructions
// which are now dead.