Skip to content

Commit a7efe06

Browse files
committed
[LV] Assert no DbgInfoIntrinsic calls are passed to widening (NFC).
When building a VPlan, BasicBlock::instructionsWithoutDebug() is used to iterate over the instructions in a block. This means that no recipes should be created for debug info intrinsics already and we can turn the early exit into an assertion. Reviewers: Ayal, gilr, rengolin, aprantl Reviewed By: aprantl Differential Revision: https://reviews.llvm.org/D77636
1 parent 6115150 commit a7efe06

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4362,11 +4362,8 @@ void InnerLoopVectorizer::widenInstruction(Instruction &I) {
43624362

43634363
void InnerLoopVectorizer::widenCallInstruction(CallInst &I, VPUser &ArgOperands,
43644364
VPTransformState &State) {
4365-
// Ignore dbg intrinsics.
4366-
// TODO: Debug intrinsics should be skipped/handled during VPlan construction
4367-
// rather than dropping them here.
4368-
if (isa<DbgInfoIntrinsic>(I))
4369-
return;
4365+
assert(!isa<DbgInfoIntrinsic>(I) &&
4366+
"DbgInfoIntrinsic should have been dropped during VPlan construction");
43704367
setDebugLocFromInst(Builder, &I);
43714368

43724369
Module *M = I.getParent()->getParent()->getParent();
@@ -7247,6 +7244,7 @@ VPlanPtr LoopVectorizationPlanner::buildVPlanWithVPRecipes(
72477244
Builder.setInsertPoint(VPBB);
72487245

72497246
// Introduce each ingredient into VPlan.
7247+
// TODO: Model and preserve debug instrinsics in VPlan.
72507248
for (Instruction &I : BB->instructionsWithoutDebug()) {
72517249
Instruction *Instr = &I;
72527250

0 commit comments

Comments
 (0)