[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:50:00 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:
@nikic it seems the LI is not being updated, because UseLoop and DefLoop can't be equal that's for sure. The InsertionPt and DefI are not in the same loop !
https://github.com/llvm/llvm-project/pull/78696
More information about the llvm-commits
mailing list