[PATCH] D133900: [AArch64][SME] Set up a lazy-save/restore around calls.

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 14 14:35:15 PDT 2022


sdesmalen created this revision.
sdesmalen added reviewers: aemerson, efriedma, paulwalker-arm, david-arm, shruthiashwath.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: All.
sdesmalen requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Setting up a lazy-save mechanism around calls is done during SelectionDAG
because calls to intrinsics may be expanded into an actual function call
(e.g. calls to @llvm.cos()), and maintaining an allowed-list in the SMEABI
pass is not feasible.

The approach for conditionally restoring the lazy-save based on the runtime
value of TPIDR2_EL0 is similar to how we handle conditional smstart/smstop.
We create a pseudo-node which gets expanded into a conditional branch and
expands to a call to __arm_tpidr2_restore(%tpidr2_object_ptr).

The lazy-save buffer and TPIDR2 block are only allocated once at the start
of the function. For each call, the TPIDR2 block is initialised, and at
the end of the call, a pseudo node (RestoreZA) is planted.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D133900

Files:
  llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
  llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
  llvm/lib/Target/AArch64/AArch64ISelLowering.h
  llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h
  llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp
  llvm/lib/Target/AArch64/AArch64RegisterInfo.h
  llvm/lib/Target/AArch64/AArch64SMEInstrInfo.td
  llvm/test/CodeGen/AArch64/sme-lazy-save-call.ll
  llvm/test/CodeGen/AArch64/sme-shared-za-interface.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133900.460236.patch
Type: text/x-patch
Size: 22489 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220914/adaf1fcc/attachment.bin>


More information about the llvm-commits mailing list