Linux command
opt 命令
文本
Copy it and replace filenames, paths, or keywords as needed.
命令示例
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.