[PATCH] D57511: [DebugInfo] Stop changing labels for register-described parameter DBG_VALUEs

David Stenberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 7 08:49:28 PST 2019


dstenb updated this revision to Diff 185780.
dstenb retitled this revision from "[DebugInfo] Stop changing labels for parameter DBG_VALUEs" to "[DebugInfo] Stop changing labels for register-described parameter DBG_VALUEs".
dstenb edited the summary of this revision.
dstenb added a comment.

I have changed the patch so that it still changes the labels for non-register debug values. This is done to reduce the regressions. I have not been able to find a C program where moving a constant-described value results in false positives. I will write a PR about getting `SelectionDAG` to emit debug values for constant arguments directly at the start of the function, which hopefully should make it possible to remove the rest of `beginFunction()` without as many regressions.

I have spent some time looking at regressions on 32- and 64-bits x86 for register-described values with this patch. The one type of regression I have found yet is due to https://bugs.llvm.org/show_bug.cgi?id=40638. The lexical-scope trimming that `LiveDebugVariables` does move debug values down, and we can then land in situations where we schedule up an instruction with a debug location above the moved debug value, effectively ending the prologue before the parameter is described. I started looking into stopping (or at least limiting) the trimming for non-inlined parameters, so that we keep the debug values directly at the start of the function, but I don't have a patch for that yet. However, in a majority of the cases where we were left with uncovered instructions after the prologue, it would have been incorrect to move the label, so it seems to me that this patch is worth getting in, even without a patch for PR40638.

Most of the cases I looked at where we moved the debug value above the defining instructions seems to be for constant parameters that we currently can't emit as constant debug values, e.g. GlobalValues, and various constant expressions, which we instead rely on lowered values somewhere down in the function.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57511/new/

https://reviews.llvm.org/D57511

Files:
  lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
  test/CodeGen/AMDGPU/llvm.dbg.value.ll
  test/DebugInfo/AArch64/asan-stack-vars.mir
  test/DebugInfo/ARM/partial-subreg.ll
  test/DebugInfo/COFF/fp-stack.ll
  test/DebugInfo/COFF/fpo-stack-protect.ll
  test/DebugInfo/COFF/pieces.ll
  test/DebugInfo/MIR/AArch64/clobber-sp.mir
  test/DebugInfo/NVPTX/debug-info.ll
  test/DebugInfo/X86/debug-loc-asan.mir
  test/DebugInfo/X86/debug-loc-offset.mir
  test/DebugInfo/X86/dw_op_minus_direct.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57511.185780.patch
Type: text/x-patch
Size: 10027 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190207/96f4e15e/attachment.bin>


More information about the llvm-commits mailing list