January 31, 2022
On Monday, 31 January 2022 at 08:54:16 UTC, Patrick Schluter wrote:
> -O3 often chooses longer code and unrollsmore agressively inducing higher miss rates in the instruction caches.
> -O2 can beat -O3 in some cases when code size is important.

That is generally true.  My point is that GCC and Clang make different tradeoffs when told '-O2'; Clang is more aggressive than GCC at -O2.  I don't know if that still holds at -O3 (I expect probably not).
January 31, 2022

On Monday, 31 January 2022 at 08:54:16 UTC, Patrick Schluter wrote:

>

-O3 often chooses longer code and unrollsmore agressively inducing higher miss rates in the instruction caches.
-O2 can beat -O3 in some cases when code size is important.

One of the historical reasons for favoring -O2 optimization level over -O3 was the necessity for Linux distributions to fit on a CD or DVD. Also if everyone is using -O2 optimizations, then -O3 optimizations get a lot less testing coverage and are more likely to have compiler bugs. This makes -O2 even more attractive for those, who prefer safety and stability...

I think that it's a good thing that LDC is breaking out of this -O2 vs. -O3 dilemma by just mapping "-O" option to -O3 ("aggressive optimizations"):

Setting the optimization level:
  -O                                   - Equivalent to -O3
  --O0                                  - No optimizations (default)
  --O1                                  - Simple optimizations
  --O2                                  - Good optimizations
  --O3                                  - Aggressive optimizations
  --O4                                  - Equivalent to -O3
  --O5                                  - Equivalent to -O3
  --Os                                  - Like -O2 with extra optimizations for size
  --Oz                                  - Like -Os but reduces code size further

I wonder if GDC can do the same?

March 09, 2022

On Monday, 31 January 2022 at 10:33:49 UTC, Siarhei Siamashka wrote:

>

I wonder if GDC can do the same?

GDC as a front-end doesn't dictate what the optimization passes are doing, nor does it have any real control what each level means. It is only ensured that semantic doesn't break because of an optimization pass.

March 11, 2022
On Tuesday, 25 January 2022 at 20:04:04 UTC, Adam D Ruppe wrote:
> Not surprising at all: gdc is excellent and underrated in the community.

The performance metrics are just a bonus.  Gdc is the main reason I can get my worksite to take D seriously since we're a traditional unix shop (solaris -> linux).  The gcd crew are doing a *huge* service for the community.


1 2 3 4 5
Next ›   Last »