Is there a way to emit all intermediate invariants from IRTranslator to Instrution-Selection in a single instruction? It will be really handy. I mean something like ‘-save-temps’ in clang.
I'm not aware of a clang option to dump out IR between specific passes.
I think the one way to do it is to let clang generate llvm-ir, and feed that into llc, and let llc print out the IR after the pass you're interested in, e.g.:
clang t.c -o- -S -emit-llvm | llc -global-isel -print-after=irtranslator
If you want to see how the IR evolves after each pass, you can use the llc command line option -print-after-all.