[llvm] [LV] codegen for tail-folded epilogue loop (PR #208764)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 27 06:45:51 PDT 2026


================
@@ -7562,7 +7646,7 @@ static SmallVector<Instruction *> preparePlanForEpilogueVectorLoop(
   auto *Increment = vputils::findCanonicalIVIncrement(Plan);
   assert(Increment && "Must have a canonical IV increment at this point");
   IV->replaceUsesWithIf(Add, [Add, Increment](VPUser &U, unsigned) {
-    return &U != Add && &U != Increment;
+    return &U != Add && &U != Increment && !isa<VPWidenCanonicalIVRecipe>(&U);
----------------
david-arm wrote:

Might be worth adding a comment explaining why this is needed. Also, it looks like this is fixing an existing bug - could it be committed separately?

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


More information about the llvm-commits mailing list