[IndVarSimplify] Clear block and loop dispositions after moving instr.
authorFlorian Hahn <flo@fhahn.com>
Tue, 18 Oct 2022 15:17:49 +0000 (16:17 +0100)
committerFlorian Hahn <flo@fhahn.com>
Tue, 18 Oct 2022 15:18:14 +0000 (16:18 +0100)
commita8e9742bd44daa4632b07ccc37a6da8236781fa6
tree57af0018ea93f9d9f35753ec8c0259d0185024f0
parent6608908b1b7fd9146f632b040c0b48c2fb661966
[IndVarSimplify] Clear block and loop dispositions after moving instr.

Moving an instruction can invalidate the cached block dispositions of
the corresponding SCEV. Invalidate the cached dispositions.

Also fixes a copy-paste error in forgetBlockAndLoopDispositions where
the start expression S was removed from BlockDispositions in the loop
but not the current values. This was also exposed by the new test case.

Fixes #58439.
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
llvm/test/Transforms/IndVarSimplify/scev-invalidation.ll [moved from llvm/test/Transforms/IndVarSimplify/pr54434.ll with 62% similarity]