Where to find the optimization sequence for clang -OX?
Asked Answered
L

1

9

Where can I find the sequence of optimizations used by clang according to -OX?

Laodicea answered 17/10, 2011 at 15:40 Comment(1)
Apart from the source code, that is?Stocks
N
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.

Nutter answered 18/10, 2011 at 12:24 Comment(3)
But I only see up to O3 in opt. Why clang has O4?Laodicea
-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.Nutter
Thanks! I parsed and posted the output for all optimization levels here for llvm 3.2Matlock

© 2022 - 2024 — McMap. All rights reserved.