[cfe-dev] Clangs equivalent to GCCs -Og flag?

Robinson, Paul Paul_Robinson at playstation.sony.com
Fri Jul 31 15:28:45 PDT 2015


I remember using gcc's "tell me what optimizations you ran" flag, which does something like print out the list of –f switches you would need to use to get the same effect as the optimization flags you actually provided.  Comparing –O1 to –Og I saw only one difference. Hence my statement that gcc's –O1 and –Og are 99% equivalent.  It is a very black-box experiment but I think it's indicative. Or at least instructive.
--paulr

From: Xinliang David Li [mailto:xinliangli at gmail.com]
Sent: Friday, July 31, 2015 11:49 AM
To: Robinson, Paul
Cc: David Blaikie; Dan Walmsley; cfe-dev Developers
Subject: Re: [cfe-dev] Clangs equivalent to GCCs -Og flag?



On Fri, Jul 31, 2015 at 7:27 AM, Robinson, Paul <Paul_Robinson at playstation.sony.com<mailto:Paul_Robinson at playstation.sony.com>> wrote:
People ask about this from time to time, but we've never done anything about it.
One thing I noticed about GCC –Og is that it's 99% identical to their –O1.

Not really. The optimization level is set to 1, but the pass pipeline setup is very different between O1 and Og.

David


I'd be curious about people's experience using Clang –O1 –g and whether that experience is somewhere close to reasonable.
--paulr

From: cfe-dev-bounces at cs.uiuc.edu<mailto:cfe-dev-bounces at cs.uiuc.edu> [mailto:cfe-dev-bounces at cs.uiuc.edu<mailto:cfe-dev-bounces at cs.uiuc.edu>] On Behalf Of David Blaikie
Sent: Wednesday, July 29, 2015 10:13 AM
To: Dan Walmsley; cfe-dev Developers
Subject: Re: [cfe-dev] Clangs equivalent to GCCs -Og flag?



On Wed, Jul 29, 2015 at 8:42 AM, Dan Walmsley <dan at walms.co.uk<mailto:dan at walms.co.uk>> wrote:
Thanks,

    Perhaps there might be some documentation somewhere that would give me an idea of which optimizations to enable individually?

Not really - optimized debug info is still pretty lacking in Clang. Even the most common/basic optimizations (SROA, for example) are going to pretty heavily impact debuggability today.

- Dave


Dan
________________________________
Date: Wed, 29 Jul 2015 06:40:06 -0700
Subject: Re: [cfe-dev] Clangs equivalent to GCCs -Og flag?
From: dblaikie at gmail.com<mailto:dblaikie at gmail.com>
To: dan at walms.co.uk<mailto:dan at walms.co.uk>
CC: cfe-dev at cs.uiuc.edu<mailto:cfe-dev at cs.uiuc.edu>


On Jul 29, 2015 3:23 AM, "Dan Walmsley" <dan at walms.co.uk<mailto:dan at walms.co.uk>> wrote:
>
> GCC has a debug level flag of -Og which enables all optimizers that won't degrade the debugging experience greatly.
>
> Does clang have an equivalent?

No, clang had no equivalent at this time.

>
> Thanks in advance.
>
> Dan
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu<mailto:cfe-dev at cs.uiuc.edu>
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>


_______________________________________________
cfe-dev mailing list
cfe-dev at cs.uiuc.edu<mailto:cfe-dev at cs.uiuc.edu>
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150731/a64dfb08/attachment.html>


More information about the cfe-dev mailing list