subtle issue with soft-float and new attribute scheme (possibly an issue with other attributes)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

subtle issue with soft-float and new attribute scheme (possibly an issue with other attributes)

Reed Kotler
I can't say this is a bug it is changed behavior from before the new
attribute scheme.

This issue may appear with other attributes. (there are other attributes
that clang will now place
on each function)

If you run clang  as a single pass to create a .ll and don't say
-msoft-float, it puts the attribute use-soft-float=false on every
function. (It used to be that in that case -msoft-float had no effect
because those
attributes where not preserved in the IL. )

Then if you run llc and say -soft-float, what happens is that the code
generator will compile everything as soft-float, but the value of the
following will be false in XXXISelLowering
getTargetMachine().Options.UseSoftFloat

When the constructor for XXXISelLowering is called,
TM.Options.UseSoftFloat will be true.

What is interesting is that code for "make check" won't have any of the
new attributes there so
it will work as before.

I was seeing this behavior and could not figure out how my tests could
possibly pass if getTargetMachine().Options.UseSoftFloat was returning
the wrong result.






_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: subtle issue with soft-float and new attribute scheme (possibly an issue with other attributes)

Reed Kotler
Just to clarify...

The target independent part of the code generator knows from the command
line to use soft float when it legalizes.

However, any other code (target independent or dependent) which later
tries to find out if soft float is in effect is going to get the wrong
answer.

On 05/17/2013 03:04 AM, reed kotler wrote:

> I can't say this is a bug it is changed behavior from before the new
> attribute scheme.
>
> This issue may appear with other attributes. (there are other attributes
> that clang will now place
> on each function)
>
> If you run clang  as a single pass to create a .ll and don't say
> -msoft-float, it puts the attribute use-soft-float=false on every
> function. (It used to be that in that case -msoft-float had no effect
> because those
> attributes where not preserved in the IL. )
>
> Then if you run llc and say -soft-float, what happens is that the code
> generator will compile everything as soft-float, but the value of the
> following will be false in XXXISelLowering
> getTargetMachine().Options.UseSoftFloat
>
> When the constructor for XXXISelLowering is called,
> TM.Options.UseSoftFloat will be true.
>
> What is interesting is that code for "make check" won't have any of the
> new attributes there so
> it will work as before.
>
> I was seeing this behavior and could not figure out how my tests could
> possibly pass if getTargetMachine().Options.UseSoftFloat was returning
> the wrong result.


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: subtle issue with soft-float and new attribute scheme (possibly an issue with other attributes)

Rafael Espíndola
In reply to this post by Reed Kotler
My understanding is that with the new attribute system we should
deprecate and eventually remove the codegen command line options.

On 17 May 2013 06:04, reed kotler <[hidden email]> wrote:

> I can't say this is a bug it is changed behavior from before the new
> attribute scheme.
>
> This issue may appear with other attributes. (there are other attributes
> that clang will now place
> on each function)
>
> If you run clang  as a single pass to create a .ll and don't say
> -msoft-float, it puts the attribute use-soft-float=false on every function.
> (It used to be that in that case -msoft-float had no effect because those
> attributes where not preserved in the IL. )
>
> Then if you run llc and say -soft-float, what happens is that the code
> generator will compile everything as soft-float, but the value of the
> following will be false in XXXISelLowering
> getTargetMachine().Options.UseSoftFloat
>
> When the constructor for XXXISelLowering is called, TM.Options.UseSoftFloat
> will be true.
>
> What is interesting is that code for "make check" won't have any of the new
> attributes there so
> it will work as before.
>
> I was seeing this behavior and could not figure out how my tests could
> possibly pass if getTargetMachine().Options.UseSoftFloat was returning the
> wrong result.
>
>
>
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> [hidden email]         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: subtle issue with soft-float and new attribute scheme (possibly an issue with other attributes)

Reed Kotler
On 05/17/2013 08:08 PM, Rafael Espíndola wrote:
> My understanding is that with the new attribute system we should
> deprecate and eventually remove the codegen command line options.
How is that possible?


> On 17 May 2013 06:04, reed kotler <[hidden email]> wrote:
>> I can't say this is a bug it is changed behavior from before the new
>> attribute scheme.
>>
>> This issue may appear with other attributes. (there are other attributes
>> that clang will now place
>> on each function)
>>
>> If you run clang  as a single pass to create a .ll and don't say
>> -msoft-float, it puts the attribute use-soft-float=false on every function.
>> (It used to be that in that case -msoft-float had no effect because those
>> attributes where not preserved in the IL. )
>>
>> Then if you run llc and say -soft-float, what happens is that the code
>> generator will compile everything as soft-float, but the value of the
>> following will be false in XXXISelLowering
>> getTargetMachine().Options.UseSoftFloat
>>
>> When the constructor for XXXISelLowering is called, TM.Options.UseSoftFloat
>> will be true.
>>
>> What is interesting is that code for "make check" won't have any of the new
>> attributes there so
>> it will work as before.
>>
>> I was seeing this behavior and could not figure out how my tests could
>> possibly pass if getTargetMachine().Options.UseSoftFloat was returning the
>> wrong result.
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> [hidden email]         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: subtle issue with soft-float and new attribute scheme (possibly an issue with other attributes)

Rafael Espíndola
On 18 May 2013 00:15, reed kotler <[hidden email]> wrote:
> On 05/17/2013 08:08 PM, Rafael Espíndola wrote:
>>
>> My understanding is that with the new attribute system we should
>> deprecate and eventually remove the codegen command line options.
>
> How is that possible?

Because all the information will be available in the attributes. If,
for example, codegen can decide on hard float or soft float for a
function based on an attribute, clang can set it and the default when
the attribute is not present is mostly arbitrary (mostly because of
backwards compatibility considerations).

Cheers,
Rafael

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev