diff options
author | Dan Gohman <gohman@apple.com> | 2010-04-02 14:48:31 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-04-02 14:48:31 +0000 |
commit | d7bfd0028b273f2e3935e8c7ff95db6fa2b21789 (patch) | |
tree | b9ec0d98e7b147ce3b71e5279231e7e17274158f /lib/Transforms/Scalar/IndVarSimplify.cpp | |
parent | 86bfd34ece523d863282ef2a2e4cf451c387c559 (diff) | |
download | external_llvm-d7bfd0028b273f2e3935e8c7ff95db6fa2b21789.tar.gz external_llvm-d7bfd0028b273f2e3935e8c7ff95db6fa2b21789.tar.bz2 external_llvm-d7bfd0028b273f2e3935e8c7ff95db6fa2b21789.zip |
Manually notify ScalarEvolution before making an operand replacement, since
it can't currently observe such changes automatically.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100186 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/IndVarSimplify.cpp')
-rw-r--r-- | lib/Transforms/Scalar/IndVarSimplify.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index 988a4cb3f2..2722a66aeb 100644 --- a/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -510,6 +510,13 @@ void IndVarSimplify::RewriteIVExpressions(Loop *L, SCEVExpander &Rewriter) { // Now expand it into actual Instructions and patch it into place. Value *NewVal = Rewriter.expandCodeFor(AR, UseTy, InsertPt); + // Inform ScalarEvolution that this value is changing. The change doesn't + // affect its value, but it does potentially affect which use lists the + // value will be on after the replacement, which affects ScalarEvolution's + // ability to walk use lists and drop dangling pointers when a value is + // deleted. + SE->forgetValue(User); + // Patch the new value into place. if (Op->hasName()) NewVal->takeName(Op); |