[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.
This commit is contained in:
Florian Hahn 2025-04-02 21:50:24 +01:00
parent a1b0b4997e
commit 4b67c53e20
No known key found for this signature in database
GPG Key ID: C8B0D7090F9127E6
3 changed files with 5 additions and 4 deletions

View File

@ -2385,7 +2385,7 @@ void InnerLoopVectorizer::scalarizeInstruction(const Instruction *Instr,
RepRecipe->setFlags(Cloned);
if (auto DL = Instr->getDebugLoc())
if (auto DL = RepRecipe->getDebugLoc())
State.setDebugLocFrom(DL);
// Replace the operands of the cloned instructions with their scalar

View File

@ -2190,8 +2190,9 @@ public:
VPInterleaveRecipe(const InterleaveGroup<Instruction> *IG, VPValue *Addr,
ArrayRef<VPValue *> StoredValues, VPValue *Mask,
bool NeedsMaskForGaps)
: VPRecipeBase(VPDef::VPInterleaveSC, {Addr}), IG(IG),
NeedsMaskForGaps(NeedsMaskForGaps) {
: VPRecipeBase(VPDef::VPInterleaveSC, {Addr},
IG->getInsertPos()->getDebugLoc()),
IG(IG), NeedsMaskForGaps(NeedsMaskForGaps) {
for (unsigned i = 0; i < IG->getFactor(); ++i)
if (Instruction *I = IG->getMember(i)) {
if (I->getType()->isVoidTy())

View File

@ -3110,7 +3110,7 @@ void VPInterleaveRecipe::execute(VPTransformState &State) {
ResAddr = State.Builder.CreateGEP(ScalarTy, ResAddr, Index, "", InBounds);
}
State.setDebugLocFrom(Instr->getDebugLoc());
State.setDebugLocFrom(getDebugLoc());
Value *PoisonVec = PoisonValue::get(VecTy);
auto CreateGroupMask = [&BlockInMask, &State,