[all-commits] [llvm/llvm-project] 010108: [DebugInstrRef][3/3] Follow DBG_PHI instructions t...

Jeremy Morse via All-commits all-commits at lists.llvm.org
Tue Jun 29 06:45:40 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 010108bb2c88511f7bb4f432b9c365e6aef81468
      https://github.com/llvm/llvm-project/commit/010108bb2c88511f7bb4f432b9c365e6aef81468
  Author: Jeremy Morse <jeremy.morse at sony.com>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
    A llvm/test/DebugInfo/MIR/InstrRef/dbg-phis-in-ldv.mir
    A llvm/test/DebugInfo/MIR/InstrRef/dbg-phis-merging-in-ldv.mir
    A llvm/test/DebugInfo/MIR/InstrRef/dbg-phis-with-loops.mir

  Log Message:
  -----------
  [DebugInstrRef][3/3] Follow DBG_PHI instructions through LiveDebugValues

This patch reads machine value numbers from DBG_PHI instructions (marking
where SSA PHIs used to be), and matches them up with DBG_INSTR_REF
instructions that refer to them. Essentially they are two separate parts of
a DBG_VALUE: the place to read the value (register and program position),
and where the variable is assigned that value.

Sometimes these DBG_PHIs can be duplicated, usually by tail duplication.
This corresponds to the SSA structure of the program being destroyed, and
the original PHI being split. When this happens: run LLVMs standard
SSAUpdater utility, to work out what values should appear in which blocks.
The majority of this patch is boilerplate to make use of SSAUpdater.

If there are any additional PHIs on the path between multiple DBG_PHIs and
their using DBG_INSTR_REF, their existance is validated, just in case a
value gets clobbered along the way (see dbg-phis-with-loops.mir for
several examples).

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




More information about the All-commits mailing list