← 返回命令列表

Linux command

opt 命令

文本

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

常用示例

Optimize LLVM bitcode

opt [input.bc] -o [output.bc]

Run specific pass

opt -mem2reg [input.bc] -o [output.bc]

Enable all optimizations

opt -O3 [input.bc] -o [output.bc]

Print pass statistics

opt -stats [input.bc] -o [output.bc]

List available passes

opt --print-passes

说明

opt is the LLVM optimizer. Runs optimization passes on bitcode. The tool transforms LLVM intermediate representation. Part of LLVM toolchain.

参数

-o _OUTPUT_
Output file.
-O_LEVEL_
Optimization level (0-3).
--print-passes
List passes.
-stats
Print statistics.
--help
Display help information.

FAQ

What is the opt command used for?

opt is the LLVM optimizer. Runs optimization passes on bitcode. The tool transforms LLVM intermediate representation. Part of LLVM toolchain.

How do I run a basic opt example?

Run `opt [input.bc] -o [output.bc]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -o _OUTPUT_ do in opt?

Output file.