Fixed #190672. The issue is caused by invalid intermediate IR when `getSCEV()` is called during transformation: the exiting block of `pre-loop` did not re-connect to preheader of the `post-loop`, causing `LI.verify()` unable to correctly recompute another LoopInfo for verification. To fix, reconnect the edge earlier before calling `getSCEV()`. Also moved the DT updates to more appropriate places right after IR control flow has changed. and added a few LI and DT verifications to improve robustness of the pass.
17 KiB
17 KiB