Skip to content

Commit

Permalink
[DebugInstrRef][3/3] Follow DBG_PHI instructions through LiveDebugValues
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jmorse committed Jun 29, 2021
1 parent c85175c commit 010108b
Show file tree
Hide file tree
Showing 4 changed files with 1,076 additions and 12 deletions.
Loading

0 comments on commit 010108b

Please sign in to comment.