[cfe-dev] RFC: To add __attribute__((regmask("preserve/clobbered list here"))) in clang

vivek pandya via cfe-dev cfe-dev at lists.llvm.org
Fri Jul 15 11:33:45 PDT 2016


Sorry I forget to add clang mailing list.

-Vivek

On Fri, Jul 15, 2016 at 11:57 PM, vivek pandya <vivekvpandya at gmail.com>
wrote:

> Hello Clang and LLVM Devs,
>
> I have been working to add support for an attribute in clang and LLVM that
> helps
> user to guide interprocedural register allocation. But the use case I am
> having
> is very limited and thus I belieave it is good to have discussion on this
> before
> sending a patch.
>
> So for IPRA we have a situation where a function is calling a function
> which is
> written in assembly and it is not defined in current module. IPRA's scope
> is
> limited to a module so for such externally defined function it uses default
> calling convention but here as the function is written in assembly user can
> provide exact register usage detials. So we dicided to mark declration of
> such
> function with __attribute__((regmask("clobbered list here"))) so LLVM can
> construct regmask out of it and use it with IPRA to improve register
> allocation.
>
> For this purpose I added support for this attribute in clang and clang
> codegen
> this attribute as target dependent attribute and add to declaration. Then
> IPRA
> constructs regmask from this and use during the optimization.
>
> How ever after disussion on IRC with Joerg Sonnenberger and jroelofs we
> think
> that this may effect other areas too. So it would be better to discuss
> this and
> implement this as we all agree upon it.
>
> Sincerely,
> Vivek
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160716/08619168/attachment.html>


More information about the cfe-dev mailing list