[LLVMdev] [RFC] NoBuiltin Attribute

Krzysztof Parzyszek kparzysz at codeaurora.org
Tue Feb 19 07:46:55 PST 2013


On 2/19/2013 12:31 AM, Bill Wendling wrote:
>
> Yeah, that was in the one that I committed. I basically want something like this:
>
>    define void @foo() "no-builtin" {
>      call void @printf()
>    }
>
> And then the `call' to printf would check for the "no-builtin" attribute on `@foo' to determine if it can convert it to `puts'. Having the attribute on the declaration of `printf' doesn't help us here. And I'm not sure if having it on the call would be beneficial either.

Having the attribute on the prototype of printf would tell us that calls 
to printf cannot be converted to calls to anything else.  Isn't that 
what you want?

If you want to prevent the optimizations on foo that take advantage of 
the knowledge about certain known functions, then we should use a 
different attribute for that, or else things can get really confusing.

-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