diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp index 477f42c50e0388206802e6bdba6a068ce435c622..31dbd42f2c03deee9fbff3377c77e9763820f11c 100644 --- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -81,7 +81,7 @@ static cl::opt DisableIVRewrite( namespace { class IndVarSimplify : public LoopPass { - typedef DenseMap ExprToIVMapTy; + typedef DenseMap< const SCEV *, AssertingVH > ExprToIVMapTy; IVUsers *IU; LoopInfo *LI; @@ -1375,6 +1375,7 @@ 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.