[llvm] [LoopPeel] LCSSA form is destroyed by LoopPeel, preserve it (PR #78696)

Vedant Paranjape via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 15 20:14:39 PST 2024


vedantparanjape-amd wrote:

> Quick question - I had seen a bug previously (and had a fix in phabricator, which I cannot access now). The issue is that `canPeel` doesn't check for LCSSA form, where as in fact peeling requires loop to be in LCSSA form. Can you check in your case if the loop already was in LCSSA form before peeling? What I described might be an entirely different issue (I could only trigger it from llvm unit tests at the time).

So, the issue is in SimplifyAfterUnroll call, it breaks the LCSSA form of the parent loop. The order of call is as follows:

LoopPeel -> LCCSA preserved
SimplifyLoopAfterUnroll -> LCSSA of parent loop destroyed
LoopPeel -> since LCSSA of parent loop was destroyed, this crashes.

To answer your question, during the 2nd call to LoopPeel, it is not in LCSSA form.

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


More information about the llvm-commits mailing list