Optimization passes

Is there a succinct way I can get the full list of which optimization passes are applied, and in what order, for standard clang -O1, -O2, -O3?

$ clang -O3 -mllvm -debug-pass=Structure -x c - < /dev/null

lists the function passes, module passes and codegen passes that clang runs at -O3.


Try adding the flags -mllvm --debug-pass=Structure when compiling a file with clang at the desired optimization level.

Yes, that's exactly the kind of thing I was hoping for, thanks so much.