[all-commits] [llvm/llvm-project] a97547: [DebugInfo][InstrRef] Describe value sizes when sp...

Jeremy Morse via All-commits all-commits at lists.llvm.org
Thu May 12 07:53:14 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a975472fa6972bced6a6075fe248bffedeecd96d
      https://github.com/llvm/llvm-project/commit/a975472fa6972bced6a6075fe248bffedeecd96d
  Author: Jeremy Morse <jeremy.morse at sony.com>
  Date:   2022-05-12 (Thu, 12 May 2022)

  Changed paths:
    M llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
    M llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
    A llvm/test/DebugInfo/MIR/InstrRef/deref-spills-with-size.mir
    A llvm/test/DebugInfo/MIR/InstrRef/follow-spill-of-indir-value.mir
    M llvm/test/DebugInfo/MIR/X86/live-debug-values-restore.mir
    M llvm/test/DebugInfo/MIR/X86/livedebugvalues_load_in_loop.mir

  Log Message:
  -----------
  [DebugInfo][InstrRef] Describe value sizes when spilt to stack

This is a re-apply of D123599, which was reverted in 4fe2ab5279408, now
with a more appropriate assertion. Original commit message follow:

InstrRefBasedLDV can track and describe variable values that are spilt to
the stack -- however it does not current describe the size of the value on
the stack. This can cause uninitialized bytes to be read from the stack if
a small register is spilt for a larger variable, or theoretically on
big-endian machines if a large value on the stack is used for a small
variable.

Fix this by using DW_OP_deref_size to specify the amount of data to load
from the stack, if there's any possibility for ambiguity. There are a few
scenarios where this can be omitted (such as when using DW_OP_piece and a
non-DW_OP_stack_value location), see deref-spills-with-size.mir for an
explicit table of inputs flavours and output expressions.

Differential Revision: https://reviews.llvm.org/D123599




More information about the All-commits mailing list