On gcc, the manual explains what -O3
, -Os
, etc. translate to in terms of specific optimisation arguments (-funswitch-loops
, -fcompare-elim
, etc.)
I'm looking for the same info for clang.
I've looked online and in man clang
which only gives general information (-O2
optimises more than -O1
, -Os
optimises for speed, …) and also looked here on Stack Overflow and found this, but I haven't found anything relevant in the cited source files.
Edit: I found an answer but I'm still interested if anyone has a link to a user-manual documenting all optimisation passes and the passes selected by -Ox
. Currently I just found this list of passes, but nothing on optimisation levels.