[llvm] [VPlan] Strip secondary SIVSteps constructor (NFC) (PR #207193)
Ramkumar Ramachandra via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 2 07:24:29 PDT 2026
https://github.com/artagnon created https://github.com/llvm/llvm-project/pull/207193
Migrate the only use-site in unit-test to use the canonical constructor.
>From 0b2f97772865bc53e89c912b5d7a73bef48e6d9b Mon Sep 17 00:00:00 2001
From: Ramkumar Ramachandra <artagnon at tenstorrent.com>
Date: Thu, 2 Jul 2026 15:12:06 +0100
Subject: [PATCH] [VPlan] Strip secondary SIVSteps constructor (NFC)
Migrate the only use-site in unit-test to use the canonical constructor.
---
llvm/lib/Transforms/Vectorize/VPlan.h | 14 ++------------
llvm/unittests/Transforms/Vectorize/VPlanTest.cpp | 3 +--
2 files changed, 3 insertions(+), 14 deletions(-)
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index eaf9d1433aff7..3e7be2d67733a 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -4237,22 +4237,12 @@ class LLVM_ABI_FOR_TEST VPScalarIVStepsRecipe : public VPRecipeWithIRFlags {
public:
VPScalarIVStepsRecipe(VPValue *IV, VPValue *Step, VPValue *VF,
- Instruction::BinaryOps Opcode, FastMathFlags FMFs,
- DebugLoc DL)
+ Instruction::BinaryOps Opcode, FastMathFlags FMFs = {},
+ DebugLoc DL = DebugLoc::getUnknown())
: VPRecipeWithIRFlags(VPRecipeBase::VPScalarIVStepsSC, {IV, Step, VF},
IV->getScalarType(), FMFs, DL),
InductionOpcode(Opcode) {}
- VPScalarIVStepsRecipe(const InductionDescriptor &IndDesc, VPValue *IV,
- VPValue *Step, VPValue *VF,
- DebugLoc DL = DebugLoc::getUnknown())
- : VPScalarIVStepsRecipe(
- IV, Step, VF, IndDesc.getInductionOpcode(),
- dyn_cast_or_null<FPMathOperator>(IndDesc.getInductionBinOp())
- ? IndDesc.getInductionBinOp()->getFastMathFlags()
- : FastMathFlags(),
- DL) {}
-
~VPScalarIVStepsRecipe() override = default;
VPScalarIVStepsRecipe *clone() override {
diff --git a/llvm/unittests/Transforms/Vectorize/VPlanTest.cpp b/llvm/unittests/Transforms/Vectorize/VPlanTest.cpp
index 2deb7c6c864b0..7a457392a1eef 100644
--- a/llvm/unittests/Transforms/Vectorize/VPlanTest.cpp
+++ b/llvm/unittests/Transforms/Vectorize/VPlanTest.cpp
@@ -1490,8 +1490,7 @@ TEST_F(VPRecipeTest, MayHaveSideEffectsAndMayReadWriteMemory) {
{
VPValue *Op1 = Plan.getOrAddLiveIn(ConstantInt::get(Int32, 1));
VPValue *Op2 = Plan.getOrAddLiveIn(ConstantInt::get(Int32, 2));
- InductionDescriptor IndDesc;
- VPScalarIVStepsRecipe Recipe(IndDesc, Op1, Op2, Op2);
+ VPScalarIVStepsRecipe Recipe(Op1, Op2, Op2, Instruction::BinaryOpsEnd);
EXPECT_FALSE(Recipe.mayHaveSideEffects());
EXPECT_FALSE(Recipe.mayReadFromMemory());
EXPECT_FALSE(Recipe.mayWriteToMemory());
More information about the llvm-commits
mailing list