[PATCH] D105280: [2/2][RemoveRedundantDebugValues] Introduce a MIR pass that removes redundant DBG_VALUEs
Stephen Tozer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 8 04:02:01 PDT 2021
StephenTozer added inline comments.
================
Comment at: llvm/lib/CodeGen/RemoveRedundantDebugValues.cpp:112
+ }
+
+ if (MI.isMetaInstruction())
----------------
This LGTM with this edit, unless I've made a mistake in believing it necessary. I believe this will be necessary to prevent incorrect debug info from being caused in the following case:
```
1 DBG_VALUE $rax, "x", DIExpression()
...
2 DBG_VALUE_LIST "x", DIExpression(...), $rax, $rbx
...
3 DBG_VALUE $rax, "x", DIExpression()
```
Currently we would ignore the `DBG_VALUE_LIST` entirely, and so 3 would falsely appear to be redundant due to being a repeat of 1. Killing any existing mapping for the variable of a `DBG_VALUE_LIST` is the simplest way to ensure this doesn't happen, without needing a full implementation for list debug values.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D105280/new/
https://reviews.llvm.org/D105280
More information about the llvm-commits
mailing list