[LLVMdev] [RFC] NoBuiltin Attribute

Chris Lattner clattner at apple.com
Wed Feb 20 12:38:20 PST 2013


On Feb 19, 2013, at 11:36 PM, Bill Wendling <wendling at apple.com> wrote:
> On Feb 19, 2013, at 9:15 PM, Chris Lattner <clattner at apple.com> wrote:
> 
>>> There are two (old) bugs related to this: a PR and a radar. They both seem to be of low priority, though.
>>> 
>>> One thing that might help in this discussion is to note that attributes are *not* part of the function type (signature, whatever). So we cannot have a function declaration with 'nobuiltin' and another declaration without it.
>> 
>> You mean "So we *can* have a function declaration"...
>> 
> I'm confused.

Me too, sorry, I thought you were talking about two prototypes in different modules that get IR linked.  Nevermind.

> That's not something that works today. This doesn't assemble:
> 
> declare i32 @x() nounwind
> declare i32 @x() noinline

Note that this isn't valid IR even if the attributes match up.  The *asmparser* happens to eat it (as a really old hack that should be removed), but in the IR there is only one Function ever created. 

> Do you want this to change?

No.

>>> 
>> Sounds ok, but I think the attribute should be on compiled call sites instead of compiled function bodies.  If we're going to do this, might as well do it right.
>> 
> Alright, then the attribute will be applied to the call/invoke instructions and not the function definitions and declarations.

Makes sense to me, but please give the thread some time to settle out so that people are on the same page.  This topic is apparently a lot more confusing that it should be :)

-Chris



More information about the llvm-dev mailing list