The sort used the block name as a tie-breaker, which will not work for unnamed blocks and can result in a strict weak ordering violation. Fix this by checking that all exiting blocks dominate the latch first, which means that we have a total dominance order. This makes the code structure here align with what optimizeLoopExits() does. Fixes https://github.com/llvm/llvm-project/issues/108618.
82 KiB
82 KiB