[llvm-commits] [llvm] r55638 - /llvm/trunk/include/llvm/Function.h

Devang Patel dpatel at apple.com
Mon Sep 22 11:17:40 PDT 2008


On Sep 21, 2008, at 8:40 PM, Chris Lattner wrote:

>>> Are we planning
>>> to drop "custom" notes? If yes - them now I'm just seeing  
>>> duplicating
>>> existing paramattrs functionality.
>>
>> paramattrs are associated with parameter, this is associated with the
>> definition. Some of the paramattrs can be used with call/invoke
>> instructions, e.g. nounwind. Where as notes are never associated with
>> call/invoke instruction.
>
> I guess that I don't understand what you're saying here.  Are you  
> saying that there should be two "namespaces", one for function  
> attributes and one for arg/retval attributes?

Yes. parameter attributes are associated with an arguments. Function  
note is associated with function definition.

> Are you saying that attributes are distinct from notes because  
> attributes are applied to call sites also?

yes, some of the attributes are (e.g. signext) are used in call  
instruction also. Function notes are never specified at call site.

> It seems that function attributes are strictly more general than  
> notes, why not just add these as attributes?

Attributes have to maintaing mapping with respective arguments. Some  
of the attributes are associated with a return vale. However, some of  
the attributes, e.g. readonly can easily be converted to a note. We  
should reserve attributes associated with argument zero as return  
value specific attributes. I think the two concepts are separate  
enough to distinguish them at IR level.

-
Devang



More information about the llvm-commits mailing list