[llvm] [VPlan] Support VPWidenPointerInductionRecipes with EVL tail folding (PR #152110)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 6 02:53:46 PDT 2025
================
@@ -2803,13 +2808,12 @@ static void expandVPWidenPointerInduction(VPWidenPointerInductionRecipe *R,
R->replaceAllUsesWith(PtrAdd);
// Create the backedge value for the scalar pointer phi.
- Builder.setInsertPoint(R->getParent(), R->getParent()->getFirstNonPhi());
+ VPBasicBlock *ExitingBB = Plan->getVectorLoopRegion()->getExitingBasicBlock();
+ Builder.setInsertPoint(ExitingBB, ExitingBB->getTerminator()->getIterator());
----------------
lukel97 wrote:
Previously the backedge value was created after the first non PHI, which uses VF.
However now that the VF passed might be the defined in the vector loop body (i.e. the VPInstruction::ExplicitVectorLength) this inserts it at the end of the region where it should dominate.
https://github.com/llvm/llvm-project/pull/152110
More information about the llvm-commits
mailing list