[all-commits] [llvm/llvm-project] 231bf5: [InstrRef][FastISel] Support emitting DBG_INSTR_RE...

Jeremy Morse via All-commits all-commits at lists.llvm.org
Fri Jul 16 05:56:55 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 231bf52119ee09ed4b4977195d83dd7f42a2e13c
      https://github.com/llvm/llvm-project/commit/231bf52119ee09ed4b4977195d83dd7f42a2e13c
  Author: Jeremy Morse <jeremy.morse at sony.com>
  Date:   2021-07-16 (Fri, 16 Jul 2021)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
    M llvm/test/DebugInfo/X86/instr-ref-selectiondag.ll

  Log Message:
  -----------
  [InstrRef][FastISel] Support emitting DBG_INSTR_REF from fast-isel

If you attach __attribute__((optnone)) to a function when using
optimisations, that function will use fast-isel instead of the usual
SelectionDAG method. This is a problem for instruction referencing,
because it means DBG_VALUEs of virtual registers will be created,
triggering some safety assertions in LiveDebugVariables. Those assertions
exist to detect exactly this scenario, where an unexpected piece of code is
generating virtual register references in instruction referencing mode.

Fix this by transforming the DBG_VALUEs created by fast-isel into
half-formed DBG_INSTR_REFs, after which they get patched up in
finalizeDebugInstrRefs. The test modified adds a fast-isel mode to the
instruction referencing isel test.

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




More information about the All-commits mailing list