Skip to content

Commit dca0d4b

Browse files
committed
!fixup unify constructors, use helper
1 parent 5d0c744 commit dca0d4b

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8307,7 +8307,7 @@ VPRecipeBase *VPRecipeBuilder::tryToCreateWidenRecipe(VPSingleDefRecipe *R,
83078307
unsigned ScaleFactor =
83088308
getScalingForReduction(RdxDesc.getLoopExitInstr()).value_or(1);
83098309
PhiRecipe = new VPReductionPHIRecipe(
8310-
Phi, RdxDesc, *StartV, CM.isInLoopReduction(Phi),
8310+
Phi, RdxDesc.getRecurrenceKind(), *StartV, CM.isInLoopReduction(Phi),
83118311
CM.useOrderedReductions(RdxDesc), ScaleFactor);
83128312
} else {
83138313
// TODO: Currently fixed-order recurrences are modeled as chains of
@@ -9205,7 +9205,7 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
92059205
if (!PhiR)
92069206
continue;
92079207

9208-
const RecurrenceDescriptor &RdxDesc = Legal->getReductionVars().lookup(
9208+
const RecurrenceDescriptor &RdxDesc = Legal->getRecurrenceDescriptor(
92099209
cast<PHINode>(PhiR->getUnderlyingInstr()));
92109210
Type *PhiTy = PhiR->getUnderlyingValue()->getType();
92119211
// If tail is folded by masking, introduce selects between the phi

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2206,15 +2206,7 @@ class VPReductionPHIRecipe : public VPHeaderPHIRecipe,
22062206

22072207
public:
22082208
/// Create a new VPReductionPHIRecipe for the reduction \p Phi described by \p
2209-
/// RdxDesc.
2210-
VPReductionPHIRecipe(PHINode *Phi, const RecurrenceDescriptor &RdxDesc,
2211-
VPValue &Start, bool IsInLoop = false,
2212-
bool IsOrdered = false, unsigned VFScaleFactor = 1)
2213-
: VPHeaderPHIRecipe(VPDef::VPReductionPHISC, Phi, &Start),
2214-
Kind(RdxDesc.getRecurrenceKind()), IsInLoop(IsInLoop),
2215-
IsOrdered(IsOrdered), VFScaleFactor(VFScaleFactor) {
2216-
assert((!IsOrdered || IsInLoop) && "IsOrdered requires IsInLoop");
2217-
}
2209+
/// Kind.
22182210
VPReductionPHIRecipe(PHINode *Phi, RecurKind Kind, VPValue &Start,
22192211
bool IsInLoop = false, bool IsOrdered = false,
22202212
unsigned VFScaleFactor = 1)

0 commit comments

Comments
 (0)