Recent

Author Topic: optimization switches not working?  (Read 8256 times)

Selfmade.exe

  • New Member
  • *
  • Posts: 36
Re: optimization switches not working?
« Reply #15 on: June 23, 2018, 03:33:50 pm »
Why recompile everything when -O4 works (instead of the bunch of switches)? Can someone please clarify this whole thing with the optimizations?
« Last Edit: June 23, 2018, 03:37:33 pm by Selfmade.exe »

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: optimization switches not working?
« Reply #16 on: June 23, 2018, 06:09:06 pm »
Your program will link against - at minimum - the rtl.
The rtl is not optimzed beyond -O2 to facilitate debugging while maintaining safe optimizations, optimizations without side effects.
So if you want full optimization, you also need to optimize the rtl and all other packages that you use.

It is not rocket science and was already well explained to you....
« Last Edit: June 23, 2018, 06:15:01 pm by Thaddy »
Specialize a type, not a var.

Selfmade.exe

  • New Member
  • *
  • Posts: 36
Re: optimization switches not working?
« Reply #17 on: June 24, 2018, 04:36:46 pm »
Quote
Your program will link against - at minimum - the rtl.
The rtl is not optimzed beyond -O2 to facilitate debugging while maintaining safe optimizations, optimizations without side effects.
So if you want full optimization, you also need to optimize the rtl and all other packages that you use.

It is not rocket science and was already well explained to you....

Ok, read my whole post again and let me clarify:
1) I was happy with the speed gain when I used JUST the Optimization Level 4 in "Compilation and Linking".
2) I want to NOT use the Level 4, instead I want to use the what-makes-the-O4-switch bunch of switches (so I can play with optimizations).
3) The bunch was used in both Custom Options and Additions and Overrides.
4) It seems that the bunch not working, whereas if I use -O4 it's works just like when I was using Leve 4 in Optimization Level.

The -O4 is supposed to be a replacement for:

-OoPEEPHOLE
-OoREMOVEEMPTYPROCS
-OoREGVAR
-OoSTACKFRAME
-OoTAILREC
-OoCSE
-OoCONSTPROP
-OoDFA
-USELOADMODIFYSTORE //it gives error with his switch, like its not supported by my compiler version 3.0.0
-OoLOOPUNROLL
-OoORDERFIELDS
-OoDEADVALUES
-OoFASTMATH

(^this is the "bunch")
but it seems that  bunch != -O4.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: optimization switches not working?
« Reply #18 on: June 24, 2018, 06:00:10 pm »
2) I want to NOT use the Level 4, instead I want to use the what-makes-the-O4-switch bunch of switches (so I can play with optimizations).
grep for level4optimizerswitches in the source code, compiler directory.

Selfmade.exe

  • New Member
  • *
  • Posts: 36
Re: optimization switches not working?
« Reply #19 on: June 25, 2018, 04:15:18 pm »
I "greped" for this and result was globaltype.pas and cpuinfo.pas, both inconclusive.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: optimization switches not working?
« Reply #20 on: June 26, 2018, 10:40:27 am »
I "greped" for this and result was globaltype.pas and cpuinfo.pas, both inconclusive.
In one of those result, you should see a line listing cs_opt_*, those are included optimization switches in respective level. Search recursively for level 3 and below as level 4 includes all of them.

 

TinyPortal © 2005-2018