[all-commits] [llvm/llvm-project] ee3eee: [DebugInfo][InstrRef] Track values fused into stac...

Jeremy Morse via All-commits all-commits at lists.llvm.org
Mon Oct 25 07:15:36 PDT 2021


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

  Changed paths:
    M llvm/include/llvm/CodeGen/MachineFunction.h
    M llvm/lib/CodeGen/InlineSpiller.cpp
    M llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
    M llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
    M llvm/lib/CodeGen/MachineFunction.cpp
    A llvm/test/DebugInfo/MIR/InstrRef/memory-operand-folding-tieddef.mir
    A llvm/test/DebugInfo/MIR/InstrRef/memory-operand-folding.mir
    A llvm/test/DebugInfo/MIR/InstrRef/memory-operand-load-folding.mir
    A llvm/test/DebugInfo/MIR/InstrRef/memory-operand-tracking.mir

  Log Message:
  -----------
  [DebugInfo][InstrRef] Track values fused into stack spills

During register allocation, some instructions can have stack spills fused
into them. It means that when vregs are allocated on the stack we can
convert:

    SETCCr %0
    DBG_VALUE %0

to

    SETCCm %stack.0
    DBG_VALUE %stack.0

Unfortunately instruction referencing finds this harder: a store to the
stack doesn't have a specific operand number, therefore we don't substitute
the old operand for a new operand, and the location is dropped. This patch
implements a solution: just recognise the memory operand attached to an
instruction with a Special Number (TM), and record a substitution between
the old value and the new one.

This patch adds substitution code to InlineSpiller to record such fused
spills, and tracking in InstrRefBasedLDV to recognise such values, and
produce the value numbers for them. Everything to do with the movement of
stack-defined values is already handled in InstrRefBasedLDV.

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




More information about the All-commits mailing list