Skip to content

Commit f7f49ee

Browse files
authored
[VPlan] Improve code around WidenPHI's constructor (NFC) (#162277)
1 parent 2f66bcc commit f7f49ee

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2263,8 +2263,7 @@ class LLVM_ABI_FOR_TEST VPWidenPHIRecipe : public VPSingleDefRecipe,
22632263
/// debug location \p DL.
22642264
VPWidenPHIRecipe(PHINode *Phi, VPValue *Start = nullptr,
22652265
DebugLoc DL = DebugLoc::getUnknown(), const Twine &Name = "")
2266-
: VPSingleDefRecipe(VPDef::VPWidenPHISC, ArrayRef<VPValue *>(), Phi, DL),
2267-
Name(Name.str()) {
2266+
: VPSingleDefRecipe(VPDef::VPWidenPHISC, {}, Phi, DL), Name(Name.str()) {
22682267
if (Start)
22692268
addOperand(Start);
22702269
}

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3180,9 +3180,8 @@ expandVPWidenIntOrFpInduction(VPWidenIntOrFpInductionRecipe *WidenIVR,
31803180
DebugLoc::getUnknown(), "induction");
31813181

31823182
// Create the widened phi of the vector IV.
3183-
auto *WidePHI = new VPWidenPHIRecipe(WidenIVR->getPHINode(), nullptr,
3183+
auto *WidePHI = new VPWidenPHIRecipe(WidenIVR->getPHINode(), Init,
31843184
WidenIVR->getDebugLoc(), "vec.ind");
3185-
WidePHI->addOperand(Init);
31863185
WidePHI->insertBefore(WidenIVR);
31873186

31883187
// Create the backedge value for the vector IV.

0 commit comments

Comments
 (0)