[llvm] [VPlan] Relax type of DerivedIV start value (NFC) (PR #206464)
Ramkumar Ramachandra via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 29 04:27:58 PDT 2026
https://github.com/artagnon created https://github.com/llvm/llvm-project/pull/206464
Change it from VPIRValue -> VPValue, as several usecases require it.
>From 8fbee39fa5d876a040e16d8cf97ca9fdf3df0717 Mon Sep 17 00:00:00 2001
From: Ramkumar Ramachandra <artagnon at tenstorrent.com>
Date: Mon, 29 Jun 2026 12:20:47 +0100
Subject: [PATCH] [VPlan] Relax type of DerivedIV start value (NFC)
Change it from VPIRValue -> VPValue, as several usecases require it.
---
llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h | 2 +-
llvm/lib/Transforms/Vectorize/VPlan.h | 8 ++++----
llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h b/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
index b39ffdebf6179..f2d8ca09fd94e 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
@@ -408,7 +408,7 @@ class VPBuilder {
/// induction with \p Start and \p Step values, using \p Start + \p Current *
/// \p Step.
VPDerivedIVRecipe *createDerivedIV(InductionDescriptor::InductionKind Kind,
- FPMathOperator *FPBinOp, VPIRValue *Start,
+ FPMathOperator *FPBinOp, VPValue *Start,
VPValue *Current, VPValue *Step) {
return tryInsertInstruction(
new VPDerivedIVRecipe(Kind, FPBinOp, Start, Current, Step));
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index c043be05c6bd1..3f5149d95875b 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -4180,7 +4180,7 @@ class VPDerivedIVRecipe : public VPSingleDefRecipe {
const FPMathOperator *FPBinOp;
public:
- VPDerivedIVRecipe(const InductionDescriptor &IndDesc, VPIRValue *Start,
+ VPDerivedIVRecipe(const InductionDescriptor &IndDesc, VPValue *Start,
VPValue *CanonicalIV, VPValue *Step)
: VPDerivedIVRecipe(
IndDesc.getKind(),
@@ -4188,8 +4188,8 @@ class VPDerivedIVRecipe : public VPSingleDefRecipe {
Start, CanonicalIV, Step) {}
VPDerivedIVRecipe(InductionDescriptor::InductionKind Kind,
- const FPMathOperator *FPBinOp, VPIRValue *Start,
- VPValue *IV, VPValue *Step)
+ const FPMathOperator *FPBinOp, VPValue *Start, VPValue *IV,
+ VPValue *Step)
: VPSingleDefRecipe(VPRecipeBase::VPDerivedIVSC, {Start, IV, Step},
Start->getScalarType(), nullptr),
Kind(Kind), FPBinOp(FPBinOp) {}
@@ -4211,7 +4211,7 @@ class VPDerivedIVRecipe : public VPSingleDefRecipe {
InstructionCost computeCost(ElementCount VF,
VPCostContext &Ctx) const override;
- VPIRValue *getStartValue() const { return cast<VPIRValue>(getOperand(0)); }
+ VPValue *getStartValue() const { return getOperand(0); }
VPValue *getIndex() const { return getOperand(1); }
VPValue *getStepValue() const { return getOperand(2); }
const FPMathOperator *getFPBinOp() const { return FPBinOp; }
diff --git a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
index 1a10da2f1d3bf..0fcd5205bd1e6 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
@@ -3993,7 +3993,7 @@ static void expandVPWidenPointerInduction(VPWidenPointerInductionRecipe *R) {
/// Expand a VPDerivedIVRecipe into executable recipes.
static void expandVPDerivedIV(VPDerivedIVRecipe *R) {
VPBuilder Builder(R);
- VPIRValue *Start = R->getStartValue();
+ VPValue *Start = R->getStartValue();
VPValue *Step = R->getStepValue();
VPValue *Index = R->getIndex();
Type *StepTy = Step->getScalarType();
More information about the llvm-commits
mailing list