[llvm-dev] -O1 with clang and gcc

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

[llvm-dev] -O1 with clang and gcc

U.Mutlu via llvm-dev
Hi,

The binary gotten via clang's `-O1` runs much slower (3x) than that gotten via GCC's `-O1`.

Reproducible with:


We are seeing this difference between gcc and clang at other places as well.

The `-O0` and `-O2` times are comparable, however.   Are there some compile time flags one could add to make the `-O1` times comparable?  

Apologies if this has been discussed somewhere already.

Thank you,
Mmanu

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] -O1 with clang and gcc

U.Mutlu via llvm-dev
What are you trying to achieve? If faster runs is the goal, why not
compile with -O2?

Michael


2018-05-31 16:27 GMT-05:00 M. Chaturvedi via llvm-dev <[hidden email]>:

> Hi,
>
> The binary gotten via clang's `-O1` runs much slower (3x) than that gotten
> via GCC's `-O1`.
>
> Reproducible with:
>
> https://github.com/m-chaturvedi/test_valgrind_slowdown
>
> We are seeing this difference between gcc and clang at other places as well.
>
> The `-O0` and `-O2` times are comparable, however.   Are there some compile
> time flags one could add to make the `-O1` times comparable?
>
> Apologies if this has been discussed somewhere already.
>
> Thank you,
> Mmanu
>
> _______________________________________________
> LLVM Developers mailing list
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] -O1 with clang and gcc

U.Mutlu via llvm-dev
Thanks for the quick reply.

`-O0` is too slow with Valgrind and `-O2` is not recommended.  We use `-O1` in Valgrind runs.

> Use of -O2 and above is not recommended as Memcheck occasionally reports uninitialised-value errors which don't really exist.
http://valgrind.org/docs/manual/quick-start.html



On Thu, May 31, 2018 at 5:34 PM, Michael Kruse <[hidden email]> wrote:
What are you trying to achieve? If faster runs is the goal, why not
compile with -O2?

Michael


2018-05-31 16:27 GMT-05:00 M. Chaturvedi via llvm-dev <[hidden email]>:
> Hi,
>
> The binary gotten via clang's `-O1` runs much slower (3x) than that gotten
> via GCC's `-O1`.
>
> Reproducible with:
>
> https://github.com/m-chaturvedi/test_valgrind_slowdown
>
> We are seeing this difference between gcc and clang at other places as well.
>
> The `-O0` and `-O2` times are comparable, however.   Are there some compile
> time flags one could add to make the `-O1` times comparable?
>
> Apologies if this has been discussed somewhere already.
>
> Thank you,
> Mmanu
>
> _______________________________________________
> LLVM Developers mailing list
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] -O1 with clang and gcc

U.Mutlu via llvm-dev
I recommend using -fsanitize=address / -fsanitize=memory which should
be faster and more accurate than valgrind.

Michael


2018-05-31 16:39 GMT-05:00 M. Chaturvedi <[hidden email]>:

> Thanks for the quick reply.
>
> `-O0` is too slow with Valgrind and `-O2` is not recommended.  We use `-O1`
> in Valgrind runs.
>
>> Use of -O2 and above is not recommended as Memcheck occasionally reports
>> uninitialised-value errors which don't really exist.
> http://valgrind.org/docs/manual/quick-start.html
>
>
>
> On Thu, May 31, 2018 at 5:34 PM, Michael Kruse <[hidden email]>
> wrote:
>>
>> What are you trying to achieve? If faster runs is the goal, why not
>> compile with -O2?
>>
>> Michael
>>
>>
>> 2018-05-31 16:27 GMT-05:00 M. Chaturvedi via llvm-dev
>> <[hidden email]>:
>> > Hi,
>> >
>> > The binary gotten via clang's `-O1` runs much slower (3x) than that
>> > gotten
>> > via GCC's `-O1`.
>> >
>> > Reproducible with:
>> >
>> > https://github.com/m-chaturvedi/test_valgrind_slowdown
>> >
>> > We are seeing this difference between gcc and clang at other places as
>> > well.
>> >
>> > The `-O0` and `-O2` times are comparable, however.   Are there some
>> > compile
>> > time flags one could add to make the `-O1` times comparable?
>> >
>> > Apologies if this has been discussed somewhere already.
>> >
>> > Thank you,
>> > Mmanu
>> >
>> > _______________________________________________
>> > LLVM Developers mailing list
>> > [hidden email]
>> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>> >
>
>
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev