r176985 - Have these attriubtes set to 'true' or 'false'.

Bill Wendling isanbard at gmail.com
Wed Mar 13 15:42:23 PDT 2013


On Mar 13, 2013, at 3:31 PM, David Blaikie <dblaikie at gmail.com> wrote:

> On Wed, Mar 13, 2013 at 3:24 PM, Bill Wendling <isanbard at gmail.com> wrote:
>> Author: void
>> Date: Wed Mar 13 17:24:33 2013
>> New Revision: 176985
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=176985&view=rev
>> Log:
>> Have these attriubtes set to 'true' or 'false'.
>> 
>> The back-end cannot differentiate between functions that are from a .ll file and
>> those generated from the front-end. We cannot then take the non-precense of
>> these attributes as a "false" value. Have the front-end explicitly set the value
>> to 'true' or 'false' depending upon what is actually set.
> 
> I'm not sure I follow - are these tri-state values? (ie: the backend
> has 3 distinct behaviors: when the value is not present, when the
> value is present and 'true', and when the value is present and
> 'false') Otherwise I'd expect the frontend would only need to set the
> values whenever they're the non-default value (either true or false,
> whichever is appropriate for the particular parameter)
> 

Kind of tri-state. There are two use cases:

1. Generating code from a .ll file, that doesn't use the new 'attributes' syntax. Everything is derived from the command line. So the attributes won't be there. If the attributes are not there, use the "default" value. But the back-end doesn't know what the default value is. The back-end could assume that the value the variable already has is the default, but that won't necessarily be the case in the presence of LTO.

2. The front-end adds the attributes like this:

  define void @foo() #0 {}

  attributes #0 = { "use-soft-float" }

This is combined with a file that has this function:

  define void @bar() #1 {}

  attributes #1 = { "no-frame-pointer-elim" }

What should the value of "UseSoftFloat" be for "bar"? The default isn't known by the back-end. If we say that not having the "use-soft-float" attribute defined gives a "false", then that contradicts what (1) expects.

3. There is still the problem of merging two files, one of which doesn't use the new attributes syntax, and so it expects the 'default' values, but may not get them:

a.ll:

  define void @foo() #0 { }

  attributes #0 = { "use-soft-float"="true" }

b.ll:

  define void @bar() { }

What should the value of UseSoftFloat be for 'bar'?

-bw





More information about the cfe-commits mailing list