[PATCH] D149762: Change if() continue; to an assert if a DBG_VALUE or DBG_VALUE_LIST returns a null DILocalVariable
Shubham Sandeep Rastogi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 3 09:23:54 PDT 2023
rastogishubham created this revision.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: All.
rastogishubham requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
A DBG_VALUE or DBG_VALUE_LIST must always return a non-null DILocalVariable, the ARMLoadStoreOptimizer code that move’s DBG_VALUE and DBG_VALUE_LIST instructions if their corresponding loads have been moved, currently just continues if it finds a DBG_VALUE or DBG_VALUE_LIST with a null DILocalVariable, change that to an assert
https://reviews.llvm.org/D149762
Files:
llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
Index: llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
===================================================================
--- llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
+++ llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
@@ -2798,10 +2798,8 @@
if (MI.isDebugValue()) {
auto *DILocalVar = MI.getDebugVariable();
- // TODO: This should not happen, have to fix the MIR verifier to check for
- // such instances and fix them.
- if (!DILocalVar)
- continue;
+ assert(DILocalVar && "DBG_VALUE or DBG_VALUE_LIST must contain a DILocalVariable");
+
auto DbgVar = createDebugVariableFromMachineInstr(&MI);
// If the first operand is a register and it exists in the RegisterMap, we
// know this is a DBG_VALUE that uses the result of a load that was moved,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149762.519116.patch
Type: text/x-patch
Size: 817 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230503/021530d4/attachment.bin>
More information about the llvm-commits
mailing list