OPT(1)
π opt β the LLVM optimizer, but make it a group chat
okay so real quick, this is the man page for opt from the LLVM manual set (that's OPT(1), bestie, and yes the whole thing is about LLVM) π
π NAME π
opt β the modular LLVM optimizer and analyzer. that's it. that's the whole name. iconic.
β¨ SYNOPSIS β¨
opt [options] [filename]
π¦ DESCRIPTION π¦
okay so picture this: opt is the modular LLVM optimizer and analyzer β it does both, main character energy fr. you hand it LLVM source files as input, it runs whatever optimizations or analyses you told it to, and then it outputs the optimized file. slay.
but here's the tea π« β the optimizations you actually get via opt depend on what libraries were linked into it, plus any extra libraries you loaded with the -load option. so like, your opt and my opt might be different girlies. use the -help option to find out what optimizations you can use. iykyk.
if filename is omitted from the command line, or if it's literally just -, then opt reads its input from standard input. no cap. and the inputs can be in either the LLVM assembly language format (.ll) or the LLVM bitcode format (.bc) β either one works, we're flexible πββοΈ
and if you don't specify an output filename with the -o option, opt writes its output to standard output. default behavior, no drama.
πΈ OPTIONS πΈ
-fβ enable binary output on terminals. normallyoptwill refuse to write raw bitcode output if the output stream is a terminal (she's got boundaries β). with this option,optwill write raw bitcode regardless of the output device. it's giving "i do what i want."-helpβ print a summary of command line options. your bestie when you're lost π«Ά-ofilename β specify the output filename. that's it, that's the vibe.-Sβ write output in LLVM intermediate language instead of bitcode. uppercaseS, very demure, very mindful.-{passname}β okay this one's the moment π₯optgives you the ability to run any of LLVM's optimization or analysis passes, in any order. the-helpoption lists all the passes available. and the order in which the options occur on the command line is the order in which they're executed (within pass constraints β she has rules). so like, order matters, bestie. don't come for me.-strip-debugβ this option makesoptstrip debug information from the module before applying other optimizations. it's essentially the same as-strip, but it ensures that stripping of debug information happens first. priority queen π-verify-eachβ this causesoptto add a verify pass after every pass otherwise specified on the command line (including-verify). super useful when you suspect a pass is creating an invalid module but you literally cannot tell which pass is doing it π it's the "who among us" option, fr.-statsβ print statistics. numbers! data! she's analyzing π-time-passesβ record the amount of time needed for each pass and print it to standard error. basically a screen time report for your passes π-debugβ if this is a debug build, this option enables debug printouts from passes which use theLLVM_DEBUG()macro. see the LLVM Programmer's Manual, section#DEBUGfor more info. only works on debug builds, so don't come crying to me if it does nothing ngl.-load=plugin β load the dynamic object plugin. this object should register new optimization or analysis passes. once loaded, the object adds 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 meal right there π
-print-passesβ print all available passes and exit. no notes, she said what she said.
π EXIT STATUS π
if opt succeeds, it will exit with 0. π otherwise, if an error occurs, it will exit with a non-zero value. so like, check your exit codes, bestie. 0 = we ate. non-zero = something's up.
π§ AUTHOR π§
maintained by the LLVM Team (https://llvm.org/). we stan a whole team keeping it alive π
π COPYRIGHT π
2003-2023, LLVM Project β that's a two-decade run, literally legendary behavior.
okay that's the whole page, you're welcome, go optimize something and text me how it goes π
sign-off gossip: this page is number 17 in the man set, dated 2023-12-01, and it belongs to OPT(1). catch you on the next one, bestie π
π¦ where this page comes from
- opensuse-leap 16.0: llvm17 17.0.6-160000.3.1 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- opensuse-leap 16.0: llvm17 17.0.6-160000.3.1 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- opensuse-leap 16.0: llvm17 17.0.6-160000.3.1 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- opensuse-leap 16.0: llvm17 17.0.6-160000.3.1 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms