[PATCH] D114362: [DebugInfo][4/N] Adjust x86 location-list tests for instruction referencing
Orlando Cazalet-Hyams via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 24 04:19:07 PST 2021
Orlando accepted this revision.
Orlando added a comment.
This revision is now accepted and ready to land.
Ok, LGTM with the duplicated test and folded-in limitation remark. Thanks!
================
Comment at: llvm/test/DebugInfo/COFF/register-variables.ll:48
; ASM: #DEBUG_VALUE: f:p <- $esi
-; ASM: #DEBUG_VALUE: c <- $eax
+; ASM: #DEBUG_VALUE: c <- undef
; ASM: movl %eax, %ecx
----------------
jmorse wrote:
> Orlando wrote:
> > Non-blocking question: why do we get `c <- undef` here? The non-instr-ref location `c <- $eax` looks correct AFAICT.
> Looking at the IR, there's some tail-folding happening, where two instances of:
>
> dbg.value
> tail call void @putint(
>
> on either side of a branch get merged together. In DBG_VALUE mode, I believe this works by coincidence: the tails get merged, debug instructions ignored, and the variable location preserved because one code sequence is spliced into the common tail. If there was only a dbg.value on one side, we'd end up with a false location.
>
> With instruction referencing there's still one DBG_INSTR_REF preserved, but LiveDebugValues can tell that it isn't dominated by the definition it's referring to, so drops the location.
>
> IMO this is a good demonstration that instruction referencing soundly drops questionable locations; exactly how to fix it is a wider question, and probably needs a little more instrumentation. I'll fold a note in remarking on the limitation.
Aha, that is quite interesting. Thanks for the explanation.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114362/new/
https://reviews.llvm.org/D114362
More information about the llvm-commits
mailing list