[LoopDeletion] Invalidate SCEV after moving instruction.
authorFlorian Hahn <flo@fhahn.com>
Fri, 23 Sep 2022 14:13:30 +0000 (15:13 +0100)
committerFlorian Hahn <flo@fhahn.com>
Fri, 23 Sep 2022 14:14:11 +0000 (15:14 +0100)
commitd72eb9c9854d638ca04c1e245e7edfb0ae04f11c
tree1a872440cb52381a954688ebd12fddfc2984fed8
parent1cd4d63fb9ab0f04c7151911dde0d58b673823de
[LoopDeletion] Invalidate SCEV after moving instruction.

LoopDeletion may hoist instructions out of a loop using
makeLoopInvariant without invalidating the SCEV for the moved
instruction.

Moving the instruction to a different block may change its
cached block disposition, so invalidate the cached info.

Fixes #57837.
llvm/lib/Transforms/Scalar/LoopDeletion.cpp
llvm/test/Transforms/LoopDeletion/pr57837-invalidate-scev-after-hoisting.ll [new file with mode: 0644]