From 9f8c2853ca16fec0096ce59dcb12f827c20666db Mon Sep 17 00:00:00 2001 From: Andrew Trick Date: Wed, 6 Jul 2011 21:07:10 +0000 Subject: [PATCH] indvars -disable-iv-rewrite: ExprToMap lives in Pass data, so be more careful about referencing values. llvm-svn: 134537 --- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp index 477f42c50e03..31dbd42f2c03 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. -- GitLab