[LLVMdev] [RFC] Attributes Rewrite (Final)

Chris Lattner clattner at apple.com
Sun Feb 3 21:00:08 PST 2013


On Feb 3, 2013, at 12:55 PM, Bill Wending <isanbard at gmail.com> wrote:
>>> The 'align' and "cpu" attributes both have a value associated with them. The 'attr' attribute in '#1' has multiple values associated with it. (The BNF is below in the 'IR Changes' section.) Attribute groups with the same attributes in them, but in a different order, are identical. So '@bar' and '@qux' have the same attributes in this example:
>> 
>> What is the use case for the multi-value attribute?  Perhaps obvious, but it makes sense to stage this out to add one thing at a time.  Also, your BNF doesn't make it clear what is allowed for <value>: I would assume it is a set of hardcoded keywords (like align, sspreq, etc) plus the string form.  If so, how does "val1" fit into that?
>> 
> I added it because I wanted to limit possible future changes to the IR. But that may be premature. It would essentially act like the '-mattr' command line option works today. Of course the -mattr functionality is covered by this proposal. I will omit that part and leave it for a future expansions if necessary. It won't be a major change to the IR at that point.

Ok, I'd prefer that you not implement this yet.  When/if a need comes up, we can consider it then, and taking into consideration the specific use case.

> My first thoughts about what <value> can be is something that can be represented by a Constant object. So a keyword, string, or numerical value. I expect string values to be used mainly for target-dependent attributes. The other two forms would be used for target-independent attributes defined in the LangRef.

Ok, seems reasonable.  I assume you don't mean ConstantData, ConstantFP, ... though, right?

-Chris




More information about the llvm-dev mailing list