aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
diff options
context:
space:
mode:
authorShubham Sandeep Rastogi <srastogi22@apple.com>2023-05-03 08:45:14 -0700
committerShubham Sandeep Rastogi <srastogi22@apple.com>2023-05-03 14:19:20 -0700
commitee58f49a786d5d0823eb840df87eafc6aa01f7d1 (patch)
tree912a24f3d7f7efefc5ac5335d7549c611d21aadd /llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
parentcc4703745ffa398b66f985b483cb8b61eb2ed425 (diff)
downloadllvm-ee58f49a786d5d0823eb840df87eafc6aa01f7d1.zip
llvm-ee58f49a786d5d0823eb840df87eafc6aa01f7d1.tar.gz
llvm-ee58f49a786d5d0823eb840df87eafc6aa01f7d1.tar.bz2
Change if() continue; to an assert if a DBG_VALUE or DBG_VALUE_LIST returns a null DILocalVariable
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. Differential revision: https://reviews.llvm.org/D149762
Diffstat (limited to 'llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp b/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
index fd24f2a..94212b6 100644
--- a/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
+++ b/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
@@ -2798,10 +2798,9 @@ ARMPreAllocLoadStoreOpt::RescheduleLoadStoreInstrs(MachineBasicBlock *MBB) {
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,