Where can I find the sequence of optimizations used by clang according to -OX?
Asked
Active
Viewed 1.1k times
1 Answers
17
clang executes the precisely same sequence of passes as opt -ON. So, you can do something like
llvm-as < /dev/null | opt -O3 -disable-output -debug-pass=Arguments
to derive the "full" set of passes which are run at O3.

Anton Korobeynikov
- 9,074
- 25
- 28
-
1
-
1-O4 usually means link-time optimization, thus it cannot be performed via opt alone. The set of passes suitable for LTO can be found via opt -std-link-opts. – Anton Korobeynikov Oct 18 '11 at 17:07
-
Thanks! I parsed and posted the output for all optimization levels [here](http://stackoverflow.com/a/15548189/762488) for llvm 3.2 – Antoine Mar 21 '13 at 13:26