[llvm] [VPlan] Move addExplicitVectorLength to tryToBuildVPlanWithVPRecipes (PR #166164)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 11 02:50:32 PST 2025
================
@@ -605,9 +605,12 @@ createScalarIVSteps(VPlan &Plan, InductionDescriptor::InductionKind Kind,
VPBuilder &Builder) {
VPRegionBlock *LoopRegion = Plan.getVectorLoopRegion();
VPBasicBlock *HeaderVPBB = LoopRegion->getEntryBasicBlock();
- VPCanonicalIVPHIRecipe *CanonicalIV = LoopRegion->getCanonicalIV();
- VPSingleDefRecipe *BaseIV = Builder.createDerivedIV(
- Kind, FPBinOp, StartV, CanonicalIV, Step, "offset.idx");
+ VPHeaderPHIRecipe *IV = LoopRegion->getCanonicalIV();
+ if (auto *EVLIV =
+ dyn_cast<VPEVLBasedIVPHIRecipe>(std::next(IV->getIterator())))
----------------
fhahn wrote:
Why would it be incorrect?
If the movement means every optimization must be careful whether to use the canonical IV or EVL based IV, and adding new users to the canonical IV could cause incorrect transformations, then I am not sure if that is the best direction forward?
https://github.com/llvm/llvm-project/pull/166164
More information about the llvm-commits
mailing list