[all-commits] [llvm/llvm-project] fbf269: [DebugInfo][InstrRef] Only calculate IDF for reg u...

Jeremy Morse via All-commits all-commits at lists.llvm.org
Wed Oct 13 08:08:39 PDT 2021


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

  Changed paths:
    M llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
    M llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h

  Log Message:
  -----------
  [DebugInfo][InstrRef] Only calculate IDF for reg units

In D110173 we start using the existing LLVM IDF calculator to place PHIs as
we reconstruct an SSA form of machine-code program. Sadly that's slower
than the old (but broken) way, this patch attempts to recover some of that
performance.

The key observation: every time we def a register, we also have to def it's
register units. If we def'd $rax, in the current implementation we
independently calculate PHI locations for {al, ah, ax, eax, hax, rax}, and
they will all have the same PHI positions. Instead of doing that, we can
calculate the PHI positions for {al, ah} and place PHIs for any aliasing
registers in the same positions. Any def of a super-register has to def
the unit, and vice versa, so this is sound. It cuts down the SSA placement
we need to do significantly.

This doesn't work for stack slots, or registers we only ever read, so place
PHIs normally for those. LiveDebugValues choses to ignore writes to SP at
calls, and now have to ignore writes to SP register units too.

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




More information about the All-commits mailing list