[all-commits] [llvm/llvm-project] b5426c: [DebugInfo][InstrRef] Place variable-values PHI us...

Jeremy Morse via All-commits all-commits at lists.llvm.org
Thu Oct 14 06:44:00 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b5426ced71280c340b005acc661e0778541800a5
      https://github.com/llvm/llvm-project/commit/b5426ced71280c340b005acc661e0778541800a5
  Author: Jeremy Morse <jeremy.morse at sony.com>
  Date:   2021-10-14 (Thu, 14 Oct 2021)

  Changed paths:
    M llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
    M llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
    A llvm/test/DebugInfo/MIR/InstrRef/pick-vphi-in-shifting-loop.mir
    M llvm/unittests/CodeGen/InstrRefLDVTest.cpp

  Log Message:
  -----------
  [DebugInfo][InstrRef] Place variable-values PHI using LLVM utilities

This patch is very similar to D110173 / a3936a6c19c, 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




More information about the All-commits mailing list