[PATCH] D156358: [AArch64] Do not unnecessarily spill LR because of @llvm.returnaddress
Anatoly Trosinenko via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 26 12:26:28 PDT 2023
atrosinenko created this revision.
atrosinenko added reviewers: ab, kristof.beyls, apazos, pcc, psmith, t.p.northover.
Herald added a subscriber: hiraditya.
Herald added a project: All.
atrosinenko published this revision for review.
atrosinenko added a comment.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
While most features of https://github.com/apple/llvm-project/commit/7924c7d75ae0015a9fd9786a580b10b2190bccc6 are already implemented in mainline, `@llvm.returnaddress` still tends to be lowered like
xpaci x30
mov dest, x30
instead of
mov dest, x30
xpaci dest
This patch forces the return address to be copied out of LR first, if FEAT_PAuth is avaialble (at the instruction selection phase).
When lowering @llvm.returnaddress with FEAT_PAuth, move possibly signed
return address out of LR first, to prevent XPACI from clobbering the LR
when it would not be spilled otherwise.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D156358
Files:
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
llvm/test/CodeGen/AArch64/aarch64-signedreturnaddress.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156358.544467.patch
Type: text/x-patch
Size: 6158 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230726/860bce73/attachment.bin>
More information about the llvm-commits
mailing list