[llvm] [LoopInterchange] Also look at lcssa phis in outer loop latch block (PR #160889)

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 2 06:25:39 PDT 2025


Meinersbur wrote:

Not removing all nodes, but only look for single-input PHI nodes that are not in a loop's exit block. A reason to not do it would be it is more computationally expensive (another iteration over all BBs), but would result in fewer special cases in LoopInterchange itself. So it might be worth the trade-off.

A PHI in the OuterLatch (if != InnerExit) would not be need to be considered tightly nested, the additional pass would just exist to normalize IR output from other passes, like a mini-SimplifyCFG.

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


More information about the llvm-commits mailing list