OPT(1)
π opt(1) β the LLVM optimizer, but make it a group chat π
okay bestie, welcome to opt, aka the LLVM optimizer, straight out of the LLVM family. this is the manual page for section 1, and yes we are doing this properly. sit down, hydrate, let's go π«Ά
β¨ NAME β¨
opt β the LLVM optimizer. that's the whole vibe. she optimizes. she analyzes. she slays π
πΈ SYNOPSIS πΈ
opt [options] [filename]
that's it. that's the whole incantation. options and a filename, iconic behavior honestly β¨
π¦ DESCRIPTION π¦
so. the opt command is the modular LLVM optimizer and analyzer. no cap. she takes LLVM source files as input, runs whatever optimizations or analyses you told her to run on them, and then outputs the optimized file. main character energy fr fr π
the optimizations you actually get depend on what libraries were linked into her as well as any additional libraries that have been loaded with the -load option. so if you're like "why isn't this pass here" β bestie it's a linking thing. use the -help option to figure out which optimizations you can actually use. it's giving "check the menu before you order" π
if filename is omitted from the command line, or if it's literally just "-", then opt reads its input from standard input. love that for her. inputs can be in either:
- the LLVM assembly language format, which is
.ll - the LLVM bitcode format, which is
.bc
and if you don't specify an output filename with the -o option, opt writes her output straight to standard output. classic π
π OPTIONS π
here we go, the good part. every single one, no skipping, no summarizing, we are NOT that girl π
-fβ enable binary output on terminals. normally,optwill refuse to write raw bitcode output if the output stream is a terminal. with this option,optwill write raw bitcode regardless of the output device. so basically she stops protecting you from yourself. use with intention bestie π«Ά-helpβ print a summary of command line options. the "girl help" of flags, except she actually delivers π-o<filename> β specify the output filename. that's it, that's the whole job π«-Sβ write output in LLVM intermediate language instead of bitcode. the human-readable option. the "let me see what's going on" option. we love her for it β¨-passes=<string>β a textual (comma-separated) description of the pass pipeline. for example,-passes="sroa,instcombine". see invoking opt <../NewPassManager.html#invoking-opt> for more details on the pass pipeline syntax. this is where you tell her exactly which passes to run, in which order, and she does it. periodt π-strip-debugβ this option causesoptto strip debug information from the module before applying other optimizations. it's essentially the same as-strip, but it ensures that the stripping of debug information is done first. order matters, bestie π§-verify-eachβ this option causesoptto add a verify pass after every pass otherwise specified on the command line, including-verify. this is useful for cases where it is suspected that a pass is creating an invalid module but it is not clear which pass is doing it. it's the "who made this mess" flag and honestly it's giving detective energy π-statsβ print statistics. numbers! for the nosy girlies π--save-stats,--save-stats=cwd,--save-stats=objβ save LLVM statistics to a file in the current directory (--save-stats/"--save-stats=cwd") or in the directory of the output file ("--save-stats=obj"), in JSON format. she's saving receipts, literally πΎ-time-passesβ record the amount of time needed for each pass and print it to standard error. the "who ate the most clock" report β±οΈ-debugβ if this is a debug build, this option will enable debug printouts from passes which use theLLVM_DEBUG()macro. see the LLVM Programmer's Manual <../ProgrammersManual.html>, section #DEBUG for more information. note the "if this is a debug build" part β that's a whole conditional, don't come for me π₯-load=<plugin>β load the dynamic object plugin. this object should register new optimization or analysis passes. once loaded, the object will add new command line options to enable various optimizations or analyses. to see the new complete list of optimizations, use the-helpand-loadoptions together. for example:
opt -load=plugin.so -help
that's the combo move right there. load then help. chef's kiss π
-print-passesβ print all available passes and exit. window shopping, no commitment ποΈ
π EXIT STATUS π
if opt succeeds, she will exit with 0. otherwise, if an error occurs, she will exit with a non-zero value. that's the whole contract. zero means we ate, non-zero means something went sideways π
π Author π
maintained by the LLVM Team (https://llvm.org/). they keep her fed and thriving π«Ά
π Copyright π
2003-2026, LLVM Project β that's the whole copyright line, no edits, no cap.
okay that's the whole page bestie, and here's your cute sign-off: this is opt(1) from the LLVM source, page 22, dated 2026-07-16. now go run some passes and be iconic with it π
β¨π¦πΈ
π¦ where this page comes from
- fedora 44: llvm 22.1.8-4.fc44 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- fedora 44: llvm 22.1.8-4.fc44 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms