[llvm] [polly] [SimpleLoopUnswitch] Generalize the notion of trivial unswitching (PR #193989)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 12 09:24:43 PDT 2026


================

----------------
nikic wrote:

Can you please add some more test coverage? A few things I'd be interested in are:

 * Negative test for side effect before the guard. (It seems like the calling function handles that case, which was not immediately obvious to me.)
 * Negative test for side effect in the latch block.
 * Negative test for getUniqueLatchExitBlock() returning false. This is just a limitation to simplify the implementation, not a fundamental requirement, right?
 * Negative test for areLoopExitPHIsLoopInvariant() failing on the latch, given the special handling you have for that.
 * Also just a test where there are loop exit phis at all to test the updating logic. Your test here doesn't have phis.
 * Test for multiple guards. (Not sure if this will end up being negative or positive...)

https://github.com/llvm/llvm-project/pull/193989


More information about the llvm-commits mailing list