Skip to content

Commit acabfba

Browse files
committed
!fixup, Get debugloc directly.
1 parent dc5c061 commit acabfba

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9575,9 +9575,9 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
95759575
if (CM.blockNeedsPredicationForAnyReason(BB))
95769576
CondOp = RecipeBuilder.getBlockInMask(BB);
95779577

9578-
VPReductionRecipe *RedRecipe =
9579-
new VPReductionRecipe(RdxDesc, CurrentLinkI, PreviousLink, VecOp,
9580-
CondOp, CM.useOrderedReductions(RdxDesc));
9578+
VPReductionRecipe *RedRecipe = new VPReductionRecipe(
9579+
RdxDesc, CurrentLinkI, PreviousLink, VecOp, CondOp,
9580+
CM.useOrderedReductions(RdxDesc), CurrentLinkI->getDebugLoc());
95819581
// Append the recipe to the end of the VPBasicBlock because we need to
95829582
// ensure that it comes after all of it's inputs, including CondOp.
95839583
// Note that this transformation may leave over dead recipes (including

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2312,9 +2312,8 @@ class VPWidenPHIRecipe : public VPSingleDefRecipe {
23122312

23132313
public:
23142314
/// Create a new VPWidenPHIRecipe for \p Phi with start value \p Start.
2315-
VPWidenPHIRecipe(PHINode *Phi, VPValue *Start = nullptr)
2316-
: VPSingleDefRecipe(VPDef::VPWidenPHISC, ArrayRef<VPValue *>(), Phi,
2317-
Phi->getDebugLoc()) {
2315+
VPWidenPHIRecipe(PHINode *Phi, VPValue *Start = nullptr, DebugLoc DL = {})
2316+
: VPSingleDefRecipe(VPDef::VPWidenPHISC, ArrayRef<VPValue *>(), Phi, DL) {
23182317
if (Start)
23192318
addOperand(Start);
23202319
}
@@ -2615,8 +2614,8 @@ class VPReductionRecipe : public VPSingleDefRecipe {
26152614
protected:
26162615
VPReductionRecipe(const unsigned char SC, const RecurrenceDescriptor &R,
26172616
Instruction *I, ArrayRef<VPValue *> Operands,
2618-
VPValue *CondOp, bool IsOrdered)
2619-
: VPSingleDefRecipe(SC, Operands, I, I->getDebugLoc()), RdxDesc(R),
2617+
VPValue *CondOp, bool IsOrdered, DebugLoc DL)
2618+
: VPSingleDefRecipe(SC, Operands, I, DL), RdxDesc(R),
26202619
IsOrdered(IsOrdered) {
26212620
if (CondOp) {
26222621
IsConditional = true;
@@ -2627,16 +2626,17 @@ class VPReductionRecipe : public VPSingleDefRecipe {
26272626
public:
26282627
VPReductionRecipe(const RecurrenceDescriptor &R, Instruction *I,
26292628
VPValue *ChainOp, VPValue *VecOp, VPValue *CondOp,
2630-
bool IsOrdered)
2629+
bool IsOrdered, DebugLoc DL = {})
26312630
: VPReductionRecipe(VPDef::VPReductionSC, R, I,
26322631
ArrayRef<VPValue *>({ChainOp, VecOp}), CondOp,
2633-
IsOrdered) {}
2632+
IsOrdered, DL) {}
26342633

26352634
~VPReductionRecipe() override = default;
26362635

26372636
VPReductionRecipe *clone() override {
26382637
return new VPReductionRecipe(RdxDesc, getUnderlyingInstr(), getChainOp(),
2639-
getVecOp(), getCondOp(), IsOrdered);
2638+
getVecOp(), getCondOp(), IsOrdered,
2639+
getDebugLoc());
26402640
}
26412641

26422642
static inline bool classof(const VPRecipeBase *R) {
@@ -2691,7 +2691,7 @@ class VPReductionEVLRecipe : public VPReductionRecipe {
26912691
VPDef::VPReductionEVLSC, R.getRecurrenceDescriptor(),
26922692
cast_or_null<Instruction>(R.getUnderlyingValue()),
26932693
ArrayRef<VPValue *>({R.getChainOp(), R.getVecOp(), &EVL}), CondOp,
2694-
R.isOrdered()) {}
2694+
R.isOrdered(), R.getDebugLoc()) {}
26952695

26962696
~VPReductionEVLRecipe() override = default;
26972697

llvm/lib/Transforms/Vectorize/VPlanHCFGBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ void PlainCFGBuilder::createVPInstructionsForVPBB(VPBasicBlock *VPBB,
308308
// Phi node's operands may have not been visited at this point. We create
309309
// an empty VPInstruction that we will fix once the whole plain CFG has
310310
// been built.
311-
NewVPV = new VPWidenPHIRecipe(Phi);
311+
NewVPV = new VPWidenPHIRecipe(Phi, nullptr, Phi->getDebugLoc());
312312
VPBB->appendRecipe(cast<VPWidenPHIRecipe>(NewVPV));
313313
PhisToFix.push_back(Phi);
314314
} else {

0 commit comments

Comments
 (0)