[PATCH] D109005: [DebugInfo][InstrRef] Accept landingpad block arguments

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 31 10:05:13 PDT 2021


jmorse created this revision.
jmorse added reviewers: TWeaver, Orlando, StephenTozer.
Herald added a subscriber: hiraditya.
jmorse requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This patch makes instruction-referencing accepts an additional scenario where values can be read from physical registers at the start of blocks. As far as I was aware, this only happened:

- With arguments in the entry block,
- With constant physical registers,

To which this patch adds a third case:

- With exception-handling landing-pad blocks.

Observe the llvm-ir in the attached test: the operand of the dbg.value traces back to the "landingpad" instruction, which becomes some copies from physregs. Right now, that's deemed unacceptable, and the assertion fires.

The fix is to just accept this scenario; this is a case where the value in question is defined by a register and a position, not by an instruction that defines it. Reading it with a DBG_PHI is the correct behaviour, there isn't a non-copy instruction that we can refer to.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109005

Files:
  llvm/lib/CodeGen/MachineFunction.cpp
  llvm/test/DebugInfo/X86/instr-ref-eh-landing-pad.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109005.369725.patch
Type: text/x-patch
Size: 5323 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210831/3b558353/attachment.bin>


More information about the llvm-commits mailing list