[SimpleLoopUnswitch] Forget SCEVs for replaced phis.
authorFlorian Hahn <flo@fhahn.com>
Sun, 13 Nov 2022 17:38:39 +0000 (17:38 +0000)
committerFlorian Hahn <flo@fhahn.com>
Sun, 13 Nov 2022 17:38:39 +0000 (17:38 +0000)
commit7854a1abfd9a52dec0fe5d668e26de19614faefb
treed1d0c40bcafe54b216776b0c3c1d7ec80942fa15
parentae461d8b99e63e26726ce3047f00b78180d427d8
[SimpleLoopUnswitch] Forget SCEVs for replaced phis.

Forget SCEVs based on exit phis in case SCEV looked through the phi.
After unswitching, it may not be possible to look through the phi due to
it having multiple incoming values, so it needs to be re-computed.

Fixes #58868
llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
llvm/test/Transforms/SimpleLoopUnswitch/pr58868-scev-invalidation-for-phis.ll [new file with mode: 0644]