title: Dump IR after each llvm optimization (each pass), both llvm ir passes and backend debugging
body: <p>I want to find some debugging options for clang/LLVM which work like gcc's <code>-fdump-tree-all-all</code> <code>-fdump-rtl-all-all</code> <code>-fdump-ipa-all-all</code>.</p>
  
  <p>Basically I want to have an LLVM IR dumps before and after each optimization pass, also it can be useful to have all dumps of AST from clang and all phases of code generation (backend phases, Selection DAG, ISEL-SDNode, register allocation, MCInsts).</p>
  
  <p>I was able to find only the clang's <code>-ccc-print-phases</code>, but it will only print high-level phases names, e.g. preprocess-compile-assemble-link; but no any dump of IR.</p>
  
  <p>Also there is <em><a href="http://architects.dzone.com/articles/life-instruction-llvm">Life of an instruction in LLVM</a></em> paper with <code>-cc1-ast-dump</code> option to dump clang ASTs, but I want more, especially for codegen.</p>