title: Clang optimization levels
body: <p>For gcc, <a href="http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#Optimize-Options" rel="noreferrer">the manual</a> explains what <code>-O3</code>, <code>-Os</code>, etc. translate to in terms of specific optimisation arguments (<code>-funswitch-loops</code>, <code>-fcompare-elim</code>, etc.)</p>
  <p><em>I'm looking for the same info for clang</em>.</p>
  <p>I've looked <a href="http://clang.llvm.org/docs/UsersManual.html" rel="noreferrer">online</a> and in <code>man clang</code> which only gives general information (<code>-O2</code> optimises more aggressively than <code>-O1</code>, <code>-Os</code> optimises for size, ...) and also looked here on Stack Overflow and found <a href="https://stackoverflow.com/questions/13924136/what-optimization-passes-are-done-for-o4-in-clang">this</a>, but I haven't found anything relevant in the cited source files.</p>
  <p><strong>Edit:</strong> I found an answer but I'm <em>still interested</em> if anyone has a link to a user-manual documenting all optimisation passes and the passes selected by <code>-O<em>x</em></code>. Currently I just found <a href="http://llvm.org/docs/Passes.html" rel="noreferrer">this</a> list of passes, but nothing on optimisation levels.</p>