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

Andrew Trick atrick at apple.com
Wed Jul 6 14:07:10 PDT 2011


Author: atrick
Date: Wed Jul  6 16:07:10 2011
New Revision: 134537

URL: http://llvm.org/viewvc/llvm-project?rev=134537&view=rev
Log:
indvars -disable-iv-rewrite: ExprToMap lives in Pass data, so be more
careful about referencing values.

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=134537&r1=134536&r2=134537&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp Wed Jul  6 16:07:10 2011
@@ -81,7 +81,7 @@
 
 namespace {
   class IndVarSimplify : public LoopPass {
-    typedef DenseMap<const SCEV *, PHINode *> ExprToIVMapTy;
+    typedef DenseMap< const SCEV *, AssertingVH<PHINode> > ExprToIVMapTy;
 
     IVUsers         *IU;
     LoopInfo        *LI;
@@ -1375,6 +1375,7 @@
   // 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