[LLVMdev] [RFC] NoBuiltin Attribute

Krzysztof Parzyszek kparzysz at codeaurora.org
Wed Feb 20 08:32:56 PST 2013


On 2/20/2013 10:19 AM, David Blaikie wrote:
>
> I'm still not understanding a few things in this thread, including one
> here: if you annotate only the calls to print (say) then how do you
> handle the indirect calls that the back end might yet optimize down to a
> constant & then attempt to simplify? Would all indirect calls be
> annotated with all the unsimplifiable function names?

Something like that.  Indirect calls could be conservatively marked as 
"no-builtin-everything", to limit the amount of data attached to them. 
Metadata could be used to indicate exactly which target functions were 
of interest, but it could be ignored without violating the original options.


> I'm not quite sure what you mean by 'can be placed on calls from the
> beginning'. One of the core issues here is LTO where two bit code files
> were compiled with different options and then linked together - then one
> function from one bitcode is inclined into a function from the other -
> in this case there was no opportunity to have marked the latter with the
> right attribute ahead of time.

I don't think it should be marked with anything.  Maybe this is the root 
cause of this ongoing misunderstanding.  If the user compiles one 
function with no-builtin-printf, then only the calls to printf that were 
originally in this function should be subjected to this restriction.  If 
this function is then inlined into another function that didn't have any 
no-builtin attributes, then calls to printf originating from that other 
functions are not restricted.  This way you can end up with two calls to 
printf in the same function, one of them restricted, the other one 
unrestricted.

-Krzysztof


-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by The Linux Foundation



More information about the llvm-dev mailing list