[llvm-commits] [llvm] r135334 - /llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp

Andrew Trick atrick at apple.com
Fri Jul 15 18:06:48 PDT 2011


Author: atrick
Date: Fri Jul 15 20:06:48 2011
New Revision: 135334

URL: http://llvm.org/viewvc/llvm-project?rev=135334&view=rev
Log:
indvars: remove ExprToIVMap because it won't be needed by LFTR.

Modified:
    llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp?rev=135334&r1=135333&r2=135334&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp Fri Jul 15 20:06:48 2011
@@ -81,15 +81,12 @@
 
 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 @@
 
   private:
     virtual void releaseMemory() {
-      ExprToIVMap.clear();
       DeadInsts.clear();
     }
 
@@ -1409,13 +1405,14 @@
 /// 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 @@
   DT = &getAnalysis<DominatorTree>();
   TD = getAnalysisIfAvailable<TargetData>();
 
-  ExprToIVMap.clear();
   DeadInsts.clear();
   Changed = false;
 
@@ -1746,8 +1742,7 @@
   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 @@
   // 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.





More information about the llvm-commits mailing list