Skip to content

Commit 4b67c53

Browse files
committed
[VPlan] Use recipe debug loc instead of instr DLs in more cases (NFC)
Update both VPInterleaveRecipe and VPReplicateRecipe codegen to use debug location directly from the recipe, not the underlying instruction. This removes another dependency on underlying instructions.
1 parent a1b0b49 commit 4b67c53

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2385,7 +2385,7 @@ void InnerLoopVectorizer::scalarizeInstruction(const Instruction *Instr,
23852385

23862386
RepRecipe->setFlags(Cloned);
23872387

2388-
if (auto DL = Instr->getDebugLoc())
2388+
if (auto DL = RepRecipe->getDebugLoc())
23892389
State.setDebugLocFrom(DL);
23902390

23912391
// Replace the operands of the cloned instructions with their scalar

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2190,8 +2190,9 @@ class VPInterleaveRecipe : public VPRecipeBase {
21902190
VPInterleaveRecipe(const InterleaveGroup<Instruction> *IG, VPValue *Addr,
21912191
ArrayRef<VPValue *> StoredValues, VPValue *Mask,
21922192
bool NeedsMaskForGaps)
2193-
: VPRecipeBase(VPDef::VPInterleaveSC, {Addr}), IG(IG),
2194-
NeedsMaskForGaps(NeedsMaskForGaps) {
2193+
: VPRecipeBase(VPDef::VPInterleaveSC, {Addr},
2194+
IG->getInsertPos()->getDebugLoc()),
2195+
IG(IG), NeedsMaskForGaps(NeedsMaskForGaps) {
21952196
for (unsigned i = 0; i < IG->getFactor(); ++i)
21962197
if (Instruction *I = IG->getMember(i)) {
21972198
if (I->getType()->isVoidTy())

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3110,7 +3110,7 @@ void VPInterleaveRecipe::execute(VPTransformState &State) {
31103110
ResAddr = State.Builder.CreateGEP(ScalarTy, ResAddr, Index, "", InBounds);
31113111
}
31123112

3113-
State.setDebugLocFrom(Instr->getDebugLoc());
3113+
State.setDebugLocFrom(getDebugLoc());
31143114
Value *PoisonVec = PoisonValue::get(VecTy);
31153115

31163116
auto CreateGroupMask = [&BlockInMask, &State,

0 commit comments

Comments
 (0)