[IndVars] Forget the SCEV when the instruction has been sunk.
authorluxufan <luxufan@iscas.ac.cn>
Sun, 6 Nov 2022 02:44:50 +0000 (10:44 +0800)
committerluxufan <luxufan@iscas.ac.cn>
Sun, 6 Nov 2022 14:46:49 +0000 (22:46 +0800)
commit49143f9d1471e3f01a6d32001676b29274298e22
tree825ba3dbf4a3336baac293850031305c0fc5749e
parent4e56aa252fc983574e32a0cb8b73333831f66700
[IndVars] Forget the SCEV when the instruction has been sunk.

In the past, the SCEV expression of the sunk instruction was not
forgetted. This led to the incorrect block dispositions after the
instruction be sunk.

Fixes https://github.com/llvm/llvm-project/issues/58662

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D137060
llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
llvm/test/Transforms/IndVarSimplify/scev-invalidation.ll