[cfe-dev] MRV on x86_64

Arushi Aggarwal arushi987 at gmail.com
Thu Mar 10 14:18:25 PST 2011


Hi,

Also, is there a specific flag that I can pass to clang, to make sure it
does optimizations like these, as I am passing the -disable-llvm-optzns
flag, in general, to disable any other optimizations.

Regards,
Arushi

On Thu, Mar 10, 2011 at 4:14 PM, Arushi Aggarwal <arushi987 at gmail.com>wrote:

>
>
> On Thu, Mar 10, 2011 at 3:40 PM, Eli Friedman <eli.friedman at gmail.com>wrote:
>
>> On Thu, Mar 10, 2011 at 1:09 PM, Arushi Aggarwal <arushi987 at gmail.com>
>> wrote:
>> > Hi,
>> >
>> > I am using clang on the following code,
>> >
>> > struct S {
>> >   float a,b,c;
>> > };
>> >
>> > void foo(struct S obj) {
>> >   obj.a = 1.2;
>> > }
>> >
>> > int main() {
>> >   struct S s;
>> >   s.a = 1.0;
>> >   s.b = 1.0;
>> >   s.c = 1.0;
>> >   foo(s);
>> >   return 0;
>> > }
>> >
>> > The generated code for foo, changes the type of the argument to foo to
>> be
>> > {double, double} .
>> >
>> > llvm-gcc was converting this to {double, float} which was an ABI
>> > requirement, as par an older
>> > discussion(
>> http://lists.cs.uiuc.edu/pipermail/llvmdev/2010-January/028870.html)
>> >
>> > Why does clang change it to a struct with a different size?
>>
>> clang uses different code written from scratch, so there are
>> differences in the output.  In this case, it's a missed optimization;
>> ideally, I think the signature of foo would be @_Z3foo1S(<2 x float>,
>> float).
>>
>
> Is this something that I should maybe file a bug for?
>
> Thanks!
> Arushi
>
>>
>> -Eli
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110310/c0388329/attachment.html>


More information about the cfe-dev mailing list