跳转至

llc option

Bash
llc sum.bc -o sum.s
llc sum.ll -o sum.s
llc sum.bc -filetype=obj -o sum.o
llc sum.bc -march=mips -filetype=obj -o sum.o

debug option

-print-after-all

Print IR after each pass

Bash
llc -debug -print-after-all 32.ll > llc.log

-debug

https://www.cnblogs.com/NBSTAR/archive/2012/12/20/2827288.html Enablu debug output, you will get the backend output

Bash
llc clang_O3.ll -debug > llc.log 2>&1
clang 17.c -c  -mllvm -debug > 17.log 2>&1

-O level

Bash
https://llvm.org/docs/CommandGuide/llc.html
Bash
Optimization level. [-O0, -O1, -O2, or -O3] (default = '-O2')
-O=uint

    Generate code at different optimization levels. These correspond to the -O0, -O1, -O2, and -O3 optimization levels used by clang.

Bitcode

llvm-as

Bash
llvm-as -o hello.bc hello.ll

llc sum.bc -o sum.s
llc sum.bc -filetype=obj -o sum.o
llc sum.bc -march=mips -filetype=obj -o sum.o

llvm-dis

Bash
llvm-dis hello.bc -o hello.ll

lli 直接运行LLVM的二进制文件

Bash
lli hello.bc

Llvm-diff对方ll文件和二进制文件

Bash
llvm-diff output.bc output.ll