1 use the cc1 for generating IR:
clang -cc1 -emit-llvm testfile.c -o testfile.ll
http://llvm.org/docs/LangRef.html
2 To convert LLVM IR in test.ll to bitcode format,
llvm-as test.ll –o test.bc
hexdump -C test.bc
http://llvm.org/docs/BitCodeFormat.html#abstract
3 Converting LLVM bitcode to target machine assembly
llc test.bc –o test.s
clang -S test.bc -o test.s –fomit-frame-pointer
https://github.com/facebook/chisel