[PATCH] D105694: [InstrRef][FastISel] Emit DBG_INSTR_REF from fast-isel when using instruction-referencing

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 9 05:02:44 PDT 2021


jmorse created this revision.
jmorse added a reviewer: debug-info.
Herald added a subscriber: hiraditya.
jmorse requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D105694

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105694.357482.patch
Type: text/x-patch
Size: 6231 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210709/dda4d5c2/attachment.bin>


More information about the llvm-commits mailing list