[llvm-dev] RFC: To add __attribute__((regmask("preserve/clobbered list here"))) in clang
vivek pandya via llvm-dev
llvm-dev at lists.llvm.org
Fri Jul 15 11:27:35 PDT 2016
Hello Clang and LLVM Devs,
I have been working to add support for an attribute in clang and LLVM that
user to guide interprocedural register allocation. But the use case I am
is very limited and thus I belieave it is good to have discussion on this
sending a patch.
So for IPRA we have a situation where a function is calling a function
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
function with __attribute__((regmask("clobbered list here"))) so LLVM can
construct regmask out of it and use it with IPRA to improve register
For this purpose I added support for this attribute in clang and clang
this attribute as target dependent attribute and add to declaration. Then
constructs regmask from this and use during the optimization.
How ever after disussion on IRC with Joerg Sonnenberger and jroelofs we
that this may effect other areas too. So it would be better to discuss this
implement this as we all agree upon it.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev