mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-16 09:16:31 +00:00
[VPlan] Manage VPWidenPointerInduction debug location via recipe.
Update VPWidenPointerInduction to manage its debug location via recipe. This makes sure we emit a proper debug location for VPWidenPointerInductionRecipes.
This commit is contained in:
parent
6c98f70b30
commit
2067e604a4
@ -8466,7 +8466,8 @@ VPHeaderPHIRecipe *VPRecipeBuilder::tryToOptimizeInductionPHI(
|
||||
[&](ElementCount VF) {
|
||||
return CM.isScalarAfterVectorization(Phi, VF);
|
||||
},
|
||||
Range));
|
||||
Range),
|
||||
Phi->getDebugLoc());
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -2211,8 +2211,8 @@ public:
|
||||
/// Start.
|
||||
VPWidenPointerInductionRecipe(PHINode *Phi, VPValue *Start, VPValue *Step,
|
||||
const InductionDescriptor &IndDesc,
|
||||
bool IsScalarAfterVectorization)
|
||||
: VPHeaderPHIRecipe(VPDef::VPWidenPointerInductionSC, Phi),
|
||||
bool IsScalarAfterVectorization, DebugLoc DL)
|
||||
: VPHeaderPHIRecipe(VPDef::VPWidenPointerInductionSC, Phi, nullptr, DL),
|
||||
IndDesc(IndDesc),
|
||||
IsScalarAfterVectorization(IsScalarAfterVectorization) {
|
||||
addOperand(Start);
|
||||
@ -2224,7 +2224,7 @@ public:
|
||||
VPWidenPointerInductionRecipe *clone() override {
|
||||
return new VPWidenPointerInductionRecipe(
|
||||
cast<PHINode>(getUnderlyingInstr()), getOperand(0), getOperand(1),
|
||||
IndDesc, IsScalarAfterVectorization);
|
||||
IndDesc, IsScalarAfterVectorization, getDebugLoc());
|
||||
}
|
||||
|
||||
VP_CLASSOF_IMPL(VPDef::VPWidenPointerInductionSC)
|
||||
|
@ -3182,6 +3182,7 @@ void VPWidenPointerInductionRecipe::execute(VPTransformState &State) {
|
||||
NewPointerPhi = PHINode::Create(ScStValueType, 2, "pointer.phi",
|
||||
CanonicalIV->getIterator());
|
||||
NewPointerPhi->addIncoming(ScalarStartValue, VectorPH);
|
||||
NewPointerPhi->setDebugLoc(getDebugLoc());
|
||||
} else {
|
||||
// The recipe has been unrolled. In that case, fetch the single pointer phi
|
||||
// shared among all unrolled parts of the recipe.
|
||||
|
@ -31,13 +31,15 @@ for.end: ; preds = %for.body
|
||||
ret void
|
||||
}
|
||||
|
||||
; FIXME: Missing debug location for pointer induction in vector loop
|
||||
define void @widen_ptr_induction_dbg(ptr %start, ptr %end) {
|
||||
; DEBUGLOC-LABEL: define void @widen_ptr_induction_dbg(
|
||||
; DEBUGLOC: vector.body:
|
||||
; DEBUGLOC-NOT: = phi ptr {{.+}}, !dbg
|
||||
; DEBUGLOC-NEXT: = phi ptr {{.+}}, !dbg ![[PTRIVLOC:[0-9]+]]
|
||||
; DEBUGLOC: = phi i64
|
||||
;
|
||||
; DEBUGLOC: loop:
|
||||
; DEBUGLOC-NEXT: = phi ptr {{.+}}, !dbg ![[PTRIVLOC]]
|
||||
;
|
||||
entry:
|
||||
br label %loop
|
||||
|
||||
@ -59,3 +61,4 @@ exit:
|
||||
; CHECK: !{!"llvm.loop.isvectorized", i32 1}
|
||||
|
||||
; DEBUGLOC: ![[RESUMELOC]] = !DILocation(line: 2
|
||||
; DEBUGLOC: ![[PTRIVLOC]] = !DILocation(line: 12
|
||||
|
Loading…
x
Reference in New Issue
Block a user