[PATCH] D33562: MachineLICM: Add new condition for hoisting of caller preserved registers

Kyle Butt via llvm-commits llvm-commits at lists.llvm.org
Tue May 30 09:17:58 PDT 2017


On Mon, May 29, 2017 at 4:38 AM, Nemanja Ivanovic via Phabricator <
reviews at reviews.llvm.org> wrote:

> nemanjai added a comment.
>
> > You talk about a call instruction? Is X2 saved and restored in the
> called function? Then it's just a CSR and should not be mentioned in the
> clobber list so no problem with my proposal above.
>
> But it is the caller that saves and restores it, not the callee. The
> sequence is essentially this (all in the caller of course):
>
> - Save X2 to it's stack slot
> - Update X2 prior to the call
> - Call the function through a pointer
> - Restore X2 immediately after the call
>
>
All of that is hidden in the linker and the call_nop instruction. As far as
llvm is concerned, it may as well be a callee saved register. The callee is
just the trampoline, whose last instruction replaces the NOP.


>
> https://reviews.llvm.org/D33562
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170530/a659f1ce/attachment.html>


More information about the llvm-commits mailing list