How to dump broken IR from LLVM backend?

My pass complains and gives up after spitting out:

Seems like “-mllvm -print-after-all” does the trick. Is there any switch that dumps the output to a file instead of console?

Just use Unix IO redirect? llc -mllvm -print-after-all &> a.txt

Yes, that definitely works. Wanted to know if there’s a switch for file output or not.

You can also -disable-verify -o <output-filename> which will disable the verify check.

Neither ‘-disable-verify’ nor ‘-mllvm -disable-verify’ seem to work with LLVM/Clang 3.8.0

Unfortunately, it depends on which tool you are running, e.g.:

$ bin/clang -cc1 --help | grep verifier
-disable-llvm-verifier Don’t run the LLVM IR verifier pass

$ bin/opt --help-list-hidden | grep disable-verify
-disable-verify - Do not run the verifier