[all-commits] [llvm/llvm-project] 30cce5: [X86] Return src/dest register from stack spill/re...

Jeremy Morse via All-commits all-commits at lists.llvm.org
Fri Jul 9 10:12:58 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 30cce54dadfcf231654dfaf3a14c27aa07d61aea
      https://github.com/llvm/llvm-project/commit/30cce54dadfcf231654dfaf3a14c27aa07d61aea
  Author: Jeremy Morse <jeremy.morse at sony.com>
  Date:   2021-07-09 (Fri, 09 Jul 2021)

  Changed paths:
    M llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
    M llvm/lib/Target/X86/X86InstrInfo.cpp
    M llvm/test/CodeGen/AArch64/live-debugvalues-sve.mir
    A llvm/test/DebugInfo/MIR/InstrRef/follow-spill-of-live-value.mir

  Log Message:
  -----------
  [X86] Return src/dest register from stack spill/restore recogniser

LLVM provides target hooks to recognise stack spill and restore
instructions, such as isLoadFromStackSlot, and it also provides post frame
elimination versions such as isLoadFromStackSlotPostFE. These are supposed
to return the store-source and load-destination registers; unfortunately on
X86, the PostFE recognisers just return "1", apparently to signify "yes
it's a spill/load". This patch alters the hooks to correctly return the
store-source and load-destination registers:

This is really useful for debug-info as we it helps follow variable values
as they move on/off the stack. There should be no codegen changes: the only
other users of these PostFE target hooks are MachineInstr::getRestoreSize
and MachineInstr::getSpillSize, which don't attempt to interpret the
returned register location.

While we're here, delete the (InstrRef) LiveDebugValues heuristic that
tries to find the spill source register by looking for a killed reg -- we
should be able to rely on the target hooks for that. This involves
temporarily turning off a n InstrRef LivedDebugValues test on aarch64
(patch to re-enable it is in D104521).

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




More information about the All-commits mailing list