[llvm] [VPlan] Add VPInstruction::StepVector and use it in VPWidenIntOrFpInductionRecipe (PR #129508)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 28 06:17:15 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,
+ const InductionDescriptor &IndDesc, DebugLoc DL)
: VPWidenInductionRecipe(VPDef::VPWidenIntOrFpInductionSC, IV, Start,
Step, IndDesc, DL),
Trunc(nullptr) {
addOperand(VF);
+ // Dummy StepVector replaced in convertToConcreteRecipes
+ addOperand(StepVector);
}
VPWidenIntOrFpInductionRecipe(PHINode *IV, VPValue *Start, VPValue *Step,
- VPValue *VF, const InductionDescriptor &IndDesc,
+ VPValue *VF, VPValue *StepVector,
+ const InductionDescriptor &IndDesc,
TruncInst *Trunc, DebugLoc DL)
: VPWidenInductionRecipe(VPDef::VPWidenIntOrFpInductionSC, IV, Start,
Step, IndDesc, DL),
Trunc(Trunc) {
addOperand(VF);
+ // Dummy StepVector replaced in convertToConcreteRecipes
----------------
fhahn wrote:
Comment doesn't seem accurate now, as we pass in `StepVector`. Could we still create the poison value here and maybe say something like `Temporarily use Poison for step-vector, which will only be introduced when needed, when preparing to execute.`
Also, should we exclude it from printing, if poison?
https://github.com/llvm/llvm-project/pull/129508
More information about the llvm-commits
mailing list