Skip to content

Commit

Permalink
[DebugInfo][InstrRef] Place variable-values PHI using LLVM utilities
Browse files Browse the repository at this point in the history
This patch is very similar to D110173 / a3936a6, but for variable
values rather than machine values. This is for the second instr-ref
problem, calculating the correct variable value on entry to each block.
The previous lattice based implementation was broken; we now use LLVMs
existing PHI placement utilities to work out where values need to merge,
then eliminate un-necessary ones through value propagation.

Most of the deletions here happen in vlocJoin: it was trying to pick a
location for PHIs to happen in, badly, leading to an infinite loop in the
MIR test added, where it would repeatedly switch between register
locations. The new approach is simpler: either PHIs can be eliminated, or
they can't, and the location of the value is a different problem.

Various bits and pieces move to the header so that they can be tested in
the unit tests. The DbgValue class grows a "VPHI" kind to represent
variable value PHIS that haven't been eliminated yet.

Differential Revision: https://reviews.llvm.org/D110630
  • Loading branch information
jmorse committed Oct 14, 2021
1 parent 743e263 commit b5426ce
Show file tree
Hide file tree
Showing 4 changed files with 2,382 additions and 625 deletions.
Loading

0 comments on commit b5426ce

Please sign in to comment.