I found this related question.
To summarize, find out about compiler optimization runs:
llvm-as < /dev/null | opt -O3 -disable-output -debug-pass=Arguments
As stated in Jeff Nixon's answer (+1), clang additionally performs some higher level optimizations that we can get with:
echo 'int;' | clang -xc -O3 - -o /dev/null -\
Documentation of individual walkways is available here .
With version 3.8, the passes are as follows:
<h / ">
With version 3.7, passes follow (parsed command output above):
<h / ">
For version 3.6, the passes correspond to the document in the GYUNGMIN KIM message.
<h / ">
With version 3.5, the following actions will take place (parsed output from the command above):
<h / ">
With version 3.4, the following actions will take place (parsed output from the command above):
<h / ">
With version 3.2, passes follow (parsed output from the command above):
<h / ">
Edit [march 2014] Removed duplicates from lists.
Edit [April 2014] added documentation link + options for 3.4
Edit [September 2014] added options for 3.5
Edit [December 2015] added options for 3.7 and specify an existing answer for 3.6
Change [possibly 2016] added options for 3.8, for both opt and clang, and specify an existing answer for clang (versus opt)