[llvm] [VPlan] Explicitly handle scalar pointer inductions. (PR #83068)

Kolya Panchenko via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 13 11:26:29 PDT 2024


================
@@ -538,21 +541,53 @@ static VPValue *createScalarIVSteps(VPlan &Plan, const InductionDescriptor &ID,
     VecPreheader->appendRecipe(Step->getDefiningRecipe());
   }
 
-  VPScalarIVStepsRecipe *Steps = new VPScalarIVStepsRecipe(ID, BaseIV, Step);
+  VPScalarIVStepsRecipe *Steps = new VPScalarIVStepsRecipe(
+      BaseIV, Step, InductionOpcode,
+      FPBinOp ? FPBinOp->getFastMathFlags() : FastMathFlags());
   HeaderVPBB->insert(Steps, IP);
   return Steps;
 }
 
-/// If any user of a VPWidenIntOrFpInductionRecipe needs scalar values,
-/// provide them by building scalar steps off of the canonical scalar IV and
+/// Legalize VPWidenPointer induction, by replacing it with a PtrAdd (IndStart,
----------------
nikolaypanchenko wrote:

Can you please elaborate "legalization" part ? Is it because `VPWidenPointerInductionRecipe` with `onlyScalarsGenerated == true` cannot be handled by generation part ?

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


More information about the llvm-commits mailing list