[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
Tue Jul 6 08:32:43 PDT 2021


jmorse added reviewers: t.p.northover, david-arm, dmgreen.
jmorse added a comment.

Hi AArch64 developers (not sure who to add as reviewers), I'd like to implement the isStoreToStackSlotPostFE / isLoadFromStackSlotPostFE target hooks for AArch64, so that post-frame-elimination code can recognise spills and restores. This is important for debug-info, as we need help to track variable values as they move on and off the stack. The implementation is almost identical to the pre-frame-elimination target hooks, although instead of filtering for loads/stores that operate on frame-indexes, I've filtered for loads/stores that have stack memory operands and operate relative to the stack pointer.

There are no codegen changes in the tests -- all the test changes in this patch are the deletion of the word "Folded" from autogenerated tests, the assembly printer puts it in there if it doesn't recognise an instruction as a "proper" spill or restore.

In terms of potential codegen changes, nothing in llvm (other than debug-info) uses these hooks, except for the "getSpillSize" / "getRestoreSize" target hooks. There's a small chance that a machine-independent optimisation might behave differently as a result of this.



================
Comment at: llvm/lib/Target/AArch64/AArch64InstrInfo.h:66
 
+  unsigned isStoreToStackSlotPostFE(const MachineInstr &MI, int &FrameIndex) const override;
+  unsigned isLoadFromStackSlotPostFE(const MachineInstr &MI, int &FrameIndex) const override;
----------------
aprantl wrote:
> What does FE stand for? Maybe explain this in the doxygen comment unless this is well known to everyone working on the AArch64 backend?
Here it's "frame elimination", i.e. after the stack slots are allocated spaces. You're right that this is probably of interest to the aarch64 maintainers, who I'll now add as reviewers...,


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104521/new/

https://reviews.llvm.org/D104521



More information about the llvm-commits mailing list