[PATCH] D104521: [InstrRef][AArch64][2/4] Recognise post-fe spills and restores

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 18 04:54:22 PDT 2021


jmorse created this revision.
jmorse added a reviewer: debug-info.
Herald added subscribers: danielkiss, hiraditya, kristof.beyls, qcolombet.
jmorse requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

An important feature of instruction-referencing LiveDebugValues is that it can track variable values that are both in registers and on the stack at the same time.  However, AArch64 doesn't benefit from this behaviour unless it is able to report when an instruction is a load or store from the stack. This patch implements two TargetInstrInfo hooks to collect this information.

These two functions are effectively copy-and-pastes of the pre-frame-elimination hooks, except that they recover the frame index of the stack slot accessed by examining the memory operand attached to the instruction. Instructions are recognised by being LDR* / STR* with constant offsets from the stack pointer.

The test added takes a Value, clobbers all registers with inlineasm to force the value onto the stack, then loads and returns it. LiveDebugValues should recognise this and:

- At the DBG_INST_REF mark the value as being on the stack with DBG_VALUE
- When the stack location is overwritten with the subsequent STRXui,    LiveDebugValue should recognise this and place the variable in $x0,    where it was loaded to.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104521

Files:
  llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
  llvm/lib/Target/AArch64/AArch64InstrInfo.h
  llvm/test/DebugInfo/MIR/AArch64/recognise-spill-restore.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104521.352975.patch
Type: text/x-patch
Size: 11990 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210618/b7e45e49/attachment.bin>


More information about the llvm-commits mailing list