Skip to content

Commit

Permalink
[InstrRef] Add debug hint for not reachable blocks from entry (llvm#7…
Browse files Browse the repository at this point in the history
…7725)

Those not reachable blocks was not analyzed by LiveDebugValues and may
raise out of bound access to VarLocs as case in llvm#77441.
  • Loading branch information
HaohaiWen authored Jan 11, 2024
1 parent f892cc3 commit 5261339
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2403,8 +2403,15 @@ bool InstrRefBasedLDV::mlocJoin(
llvm::sort(BlockOrders, Cmp);

// Skip entry block.
if (BlockOrders.size() == 0)
if (BlockOrders.size() == 0) {
// FIXME: We don't use assert here to prevent instr-ref-unreachable.mir
// failing.
LLVM_DEBUG(if (!MBB.isEntryBlock()) dbgs()
<< "Found not reachable block " << MBB.getFullName()
<< " from entry which may lead out of "
"bound access to VarLocs\n");
return false;
}

// Step through all machine locations, look at each predecessor and test
// whether we can eliminate redundant PHIs.
Expand Down

0 comments on commit 5261339

Please sign in to comment.