[llvm] [VPlan] Add VPInstruction::StepVector and use it in VPWidenIntOrFpInductionRecipe (PR #129508)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Wed May 7 06:49:21 PDT 2025
================
@@ -2586,6 +2595,29 @@ void VPlanTransforms::handleUncountableEarlyExit(
LatchExitingBranch->eraseFromParent();
}
+void VPlanTransforms::materializeStepVectors(VPlan &Plan) {
+ for (auto &Phi : Plan.getVectorLoopRegion()->getEntryBasicBlock()->phis()) {
+ auto *IVR = dyn_cast<VPWidenIntOrFpInductionRecipe>(&Phi);
+ if (!IVR)
+ continue;
+
+ // Infer an up-to-date type since
+ // optimizeVectorInductionWidthForTCAndVFUF may have truncated the start
+ // and step values.
+ Type *Ty = IVR->getPHINode()->getType();
+ if (TruncInst *Trunc = IVR->getTruncInst())
+ Ty = Trunc->getType();
+ if (Ty->isFloatingPointTy())
+ Ty = IntegerType::get(Ty->getContext(), Ty->getScalarSizeInBits());
----------------
fhahn wrote:
Is this still needed? We now run before `optimizeVectorInductionWidthForTCAndVFUF` AFAICT
https://github.com/llvm/llvm-project/pull/129508
More information about the llvm-commits
mailing list