[PATCH] D102342: [SPARC] Fix register reuse in leaf function remapping step
LemonBoy via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 12 11:05:36 PDT 2021
LemonBoy created this revision.
LemonBoy added reviewers: jrtc27, jyknight, dcederman, brad.
Herald added subscribers: fedor.sergeev, hiraditya.
LemonBoy requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Leaf functions allow the compiler to omit the setup and teardown of a frame pointer, therefore avoiding the exchange of the in/out register. According to the SPARC architecture manual every reference to `%i0-%i5` should be replaced with `%o0-o5`, if the target register is already in use a further remapping step to `%g1-%g7` is required to free the output register.
Add a simple check to make sure not to stomp on any output register that's already in use.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D102342
Files:
llvm/lib/Target/Sparc/SparcFrameLowering.cpp
llvm/lib/Target/Sparc/SparcFrameLowering.h
llvm/test/CodeGen/SPARC/leafproc.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102342.344873.patch
Type: text/x-patch
Size: 5143 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210512/4cbe2459/attachment.bin>
More information about the llvm-commits
mailing list