[all-commits] [llvm/llvm-project] b8f68a: [DebugInfo][InstrRef] Avoid crash when values opti...

Jeremy Morse via All-commits all-commits at lists.llvm.org
Wed Nov 24 02:35:20 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b8f68ad9cdb11d585acc6c38ad124b32efb6178a
      https://github.com/llvm/llvm-project/commit/b8f68ad9cdb11d585acc6c38ad124b32efb6178a
  Author: Jeremy Morse <jeremy.morse at sony.com>
  Date:   2021-11-24 (Wed, 24 Nov 2021)

  Changed paths:
    M llvm/lib/CodeGen/MachineFunction.cpp
    A llvm/test/DebugInfo/X86/instr-ref-sdag-empty-vreg.ll

  Log Message:
  -----------
  [DebugInfo][InstrRef] Avoid crash when values optimised out late in sdag

It appears that we can emit all the instructions for a function, including
debug instructions, and then optimise some of the values out late.
Specifically, in the attached test case, an argument gets optimised out
after DBG_VALUE / DBG_INSTR_REFs are created. This confuses
MachineFunction::finalizeDebugInstrRefs, which expects to be able to find a
defining instruction, and crashes instead.

Fix this by identifying when there's no defining instruction, and
translating that instead into a DBG_VALUE $noreg.

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




More information about the All-commits mailing list