[llvm] [VPlan] Add VPInstruction::StepVector and use it in VPWidenIntOrFpInductionRecipe (PR #129508)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 28 06:22:13 PDT 2025


================
@@ -1844,23 +1854,30 @@ class VPWidenInductionRecipe : public VPHeaderPHIRecipe {
 class VPWidenIntOrFpInductionRecipe : public VPWidenInductionRecipe {
   TruncInst *Trunc;
 
+  bool isUnrolled() const { return getNumOperands() == 6; }
+
 public:
   VPWidenIntOrFpInductionRecipe(PHINode *IV, VPValue *Start, VPValue *Step,
-                                VPValue *VF, const InductionDescriptor &IndDesc,
-                                DebugLoc DL)
+                                VPValue *VF, VPValue *StepVector,
----------------
lukel97 wrote:

I think we need to create a live in though, which requires doing something like `Plan.getOrCreateLiveIn(PoisonValue::get(...))`. And I'm not sure if there's a good way to get it from inside the constructor?

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


More information about the llvm-commits mailing list