[llvm] [LoopPeel] LCSSA form is destroyed by LoopPeel, preserve it (PR #78696)
Vedant Paranjape via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 20 05:17:28 PST 2024
================
@@ -644,6 +644,13 @@ bool SimplifyIndvar::replaceIVUserWithLoopInvariant(Instruction *I) {
auto *Invariant = Rewriter.expandCodeFor(S, I->getType(), IP);
+ if (!LI->replacementPreservesLCSSAForm(I, Invariant)) {
+ LLVM_DEBUG(dbgs() << "INDVARS: Can not replace IV user: " << *I
+ << " with loop invariant: " << *S
+ << " as it breaks LCSSA form " << '\n');
+ return false;
+ }
----------------
vedantparanjape-amd wrote:
There's call to `fixupLCSSAFormFor` in SCEVExpander::expand, which in turn calls formLCSSAForInstructions. So, I am not sure why it's failing to insert a LCSSA Phi
https://github.com/llvm/llvm-project/pull/78696
More information about the llvm-commits
mailing list