← 返回命令列表

Linux command

lli 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Run LLVM bitcode

lli [program.bc]

Run LLVM IR

lli [program.ll]

With arguments

lli [program.bc] [arg1] [arg2]

Force JIT compilation

lli -force-interpreter=false [program.bc]

Use interpreter

lli -force-interpreter [program.bc]

Set JIT kind

lli -jit-kind=[orc] [program.bc]

说明

lli directly executes programs in LLVM bitcode (.bc) or LLVM assembly (.ll) format using a just-in-time (JIT) compiler. Rather than producing a standalone executable on disk, lli compiles the LLVM IR to native machine code in memory at runtime and immediately begins execution, making it a convenient tool for quickly testing and prototyping LLVM IR without a separate compilation and linking step. The tool supports two execution engines: the JIT compiler (default), which translates functions to native code on demand for near-native performance, and a slower interpreter mode enabled with `-force-interpreter`. The JIT backend can be selected between MCJIT and the newer ORC engine via the `-jit-kind` flag. Program arguments can be passed after the bitcode filename, allowing lli to run LLVM programs just like native executables.

参数

-force-interpreter
Use interpreter instead of JIT.
-jit-kind _KIND_
JIT engine type (mcjit, orc).
-entry-function _NAME_
Entry function name.
--help
Display help information.

FAQ

What is the lli command used for?

lli directly executes programs in LLVM bitcode (.bc) or LLVM assembly (.ll) format using a just-in-time (JIT) compiler. Rather than producing a standalone executable on disk, lli compiles the LLVM IR to native machine code in memory at runtime and immediately begins execution, making it a convenient tool for quickly testing and prototyping LLVM IR without a separate compilation and linking step. The tool supports two execution engines: the JIT compiler (default), which translates functions to native code on demand for near-native performance, and a slower interpreter mode enabled with `-force-interpreter`. The JIT backend can be selected between MCJIT and the newer ORC engine via the `-jit-kind` flag. Program arguments can be passed after the bitcode filename, allowing lli to run LLVM programs just like native executables.

How do I run a basic lli example?

Run `lli [program.bc]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -force-interpreter do in lli?

Use interpreter instead of JIT.