3 Commits

Author SHA1 Message Date
Anna Thomas
27f8a62a54 [LoopPredication] Fix where we generate widened condition. PR61963
Loop predication's predicateLoopExit pass does two incorrect things:

It sinks the widenable call into the loop, thereby converting an invariant condition to a variant one
It widens the widenable call at a branch thereby converting the branch into a loop-varying one.

The latter is problematic when the branch may have been loop-invariant
and prior optimizations (such as indvars) may have relied on this
fact, and updated the deopt state accordingly.

Now, when we widen this with a loop-varying condition, the deopt state
is no longer correct.
https://github.com/llvm/llvm-project/issues/61963 fixed.

Differential Revision: https://reviews.llvm.org/D147662
2023-04-10 10:37:05 -04:00
Anna Thomas
975cc76020 Simplify test with deopt state in D147662. NFC 2023-04-10 10:37:04 -04:00
Anna Thomas
b3cabfdb83 Precommit test from D147662 2023-04-06 14:35:27 -04:00