comment

vivek pandya via llvm-commits llvm-commits at lists.llvm.org
Tue May 1 09:20:19 PDT 2018


On Tue, May 1, 2018 at 5:52 PM, Jonas Paulsson <paulsson at linux.vnet.ibm.com>
wrote:

> Hi,
>
> I find the comment in TargetFrameLoweringImpl.cpp slightly confusing.
>
> My interpretation here is that generally IPRA reduces save/restore in
> callee whenever it can, and instead does this in caller. "Callee saved
> registers" is however also a set of specific registers, which makes me
> think of concerns about the allocation order.
>
CC++ register allocation gurus.
Just to clarify, I think expect noCSR opt IPRA does not try to influence
allocation order, but in case of noCSR opt it is expected that caller
function uses register that are caller saved as much as possible so that it
don't have spill/restore
around call site. If register allocation is not able to do that then we are
just shifting spill/restore to around the call site.
So I think that comment is correct in context of IPRA+noCSROpt.
-Vivek

>
> Am I understanding things correctly, and if so does this comment change
> look good?
>
> -  // When interprocedural register allocation is enabled caller saved
> registers
> -  // are preferred over callee saved registers.
> +  // When interprocedural register allocation is enabled it is preferred
> +  // to save/restore registers in caller instead of callee.
>    if (MF.getTarget().Options.EnableIPRA && isSafeForNoCSROpt(MF.getFuncti
> on()))
>      return;
>
> /Jonas
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180501/d54707f3/attachment.html>


More information about the llvm-commits mailing list