[llvm] [LoopPeel] LCSSA form is destroyed by LoopPeel, preserve it (PR #78696)
Manish Kausik H via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 1 02:23:02 PST 2024
Nirhar wrote:
> > Can you please explain in what way LCSSA form gets broken? How does the IR look like after peeling but before simplification?
> > Just calling formLCSSARecursively() is of course correct, but it's better to understand why LCSSA gets broken and whether we can fix it incrementally instead.
>
> Actually the issue seems something else imo, the Peeled Loop seems bogus, it just adds blocks with unconditional branch instructions, the loop it seems to evaluate is `Loop at depth 2 containing: %bb12<header><latch><exiting>` which is a loop with no blocks and also infinite. Maybe we need to stop loop peeling in such cases.
I think this is just because the loop bb12 contains only a branch, however the issue still persists if the loop was a meaning full one as in this example: https://godbolt.org/z/a6cYb4Ta6
https://github.com/llvm/llvm-project/pull/78696
More information about the llvm-commits
mailing list