1 .\" Man page generated from reStructuredText.
4 .nr rst2man-indent-level 0
8 level \\n[rst2man-indent-level]
9 level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
16 .\" .rstReportMargin pre:
18 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
19 . nr rst2man-indent-level +1
20 .\" .rstReportMargin post:
24 .\" indent \\n[an-margin]
25 .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
26 .nr rst2man-indent-level -1
27 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
28 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
30 .TH "OPT" "1" "2023-05-24" "16" "LLVM"
35 \fBopt\fP [\fIoptions\fP] [\fIfilename\fP]
38 The \fBopt\fP command is the modular LLVM optimizer and analyzer. It takes
39 LLVM source files as input, runs the specified optimizations or analyses on it,
40 and then outputs the optimized file. The optimizations available via
41 \fBopt\fP depend upon what libraries were linked into it as well as any
42 additional libraries that have been loaded with the \fI\%\-load\fP option. Use
43 the \fI\%\-help\fP option to determine what optimizations you can use.
45 If \fBfilename\fP is omitted from the command line or is \(dq\fB\-\fP\(dq, \fBopt\fP
46 reads its input from standard input. Inputs can be in either the LLVM assembly
47 language format (\fB\&.ll\fP) or the LLVM bitcode format (\fB\&.bc\fP).
49 If an output filename is not specified with the \fI\%\-o\fP option,
50 \fBopt\fP writes its output to the standard output.
55 Enable binary output on terminals. Normally, \fBopt\fP will refuse to
56 write raw bitcode output if the output stream is a terminal. With this option,
57 \fBopt\fP will write raw bitcode regardless of the output device.
62 Print a summary of command line options.
67 Specify the output filename.
72 Write output in LLVM intermediate language (instead of bitcode).
77 \fBopt\fP provides the ability to run any of LLVM\(aqs optimization or
78 analysis passes in any order. The \fI\%\-help\fP option lists all the passes
79 available. The order in which the options occur on the command line are the
80 order in which they are executed (within pass constraints).
85 This option causes opt to strip debug information from the module before
86 applying other optimizations. It is essentially the same as \fI\-strip\fP
87 but it ensures that stripping of debug information is done first.
92 This option causes opt to add a verify pass after every pass otherwise
93 specified on the command line (including \fI\-verify\fP). This is useful
94 for cases where it is suspected that a pass is creating an invalid module but
95 it is not clear which pass is doing it.
105 Record the amount of time needed for each pass and print it to standard
111 If this is a debug build, this option will enable debug printouts from passes
112 which use the \fBLLVM_DEBUG()\fP macro. See the \fI\%LLVM Programmer\(aqs Manual\fP, section \fB#DEBUG\fP for more information.
117 Load the dynamic object \fBplugin\fP\&. This object should register new
118 optimization or analysis passes. Once loaded, the object will add new command
119 line options to enable various optimizations or analyses. To see the new
120 complete list of optimizations, use the \fI\%\-help\fP and \fI\%\-load\fP
121 options together. For example:
127 opt \-load=plugin.so \-help
136 Print all available passes and exit.
140 If \fBopt\fP succeeds, it will exit with 0. Otherwise, if an error
141 occurs, it will exit with a non\-zero value.
143 Maintained by the LLVM Team (https://llvm.org/).
145 2003-2023, LLVM Project
146 .\" Generated by docutils manpage writer.