LinuxCommandLibrary

opt

TLDR

Optimize LLVM bitcode

$ opt [input.bc] -o [output.bc]
copy
Run specific pass
$ opt -mem2reg [input.bc] -o [output.bc]
copy
Enable all optimizations
$ opt -O3 [input.bc] -o [output.bc]
copy
Print pass statistics
$ opt -stats [input.bc] -o [output.bc]
copy
List available passes
$ opt --print-passes
copy

SYNOPSIS

opt [options] [input]

DESCRIPTION

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

PARAMETERS

INPUT

LLVM bitcode file.
-o OUTPUT
Output file.
-OLEVEL
Optimization level (0-3).
--print-passes
List passes.
-stats
Print statistics.
--help
Display help information.

CAVEATS

Part of LLVM. Works with bitcode only. Pass names version-specific.

HISTORY

opt was developed as part of the LLVM compiler infrastructure project.

SEE ALSO

llvm-as(1), llc(1), clang(1)

Copied to clipboard