aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
diff options
context:
space:
mode:
authorHaohaiWen <haohai.wen@intel.com>2024-01-11 22:10:56 +0800
committerGitHub <noreply@github.com>2024-01-11 22:10:56 +0800
commit52613396a6837e5c8b8334821022cad70fe8e917 (patch)
tree521b258d91d38927a38611e11605008857907342 /llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
parentf892cc36fda6d25d4f7cbf68e95b17ba0af040b8 (diff)
downloadllvm-52613396a6837e5c8b8334821022cad70fe8e917.zip
llvm-52613396a6837e5c8b8334821022cad70fe8e917.tar.gz
llvm-52613396a6837e5c8b8334821022cad70fe8e917.tar.bz2
[InstrRef] Add debug hint for not reachable blocks from entry (#77725)
Those not reachable blocks was not analyzed by LiveDebugValues and may raise out of bound access to VarLocs as case in #77441.
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
index 9037f75..cfc8c28 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
+++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
@@ -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.