]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/clang/opt/opt.1
zfs: merge openzfs/zfs@03e9caaec
[FreeBSD/FreeBSD.git] / usr.bin / clang / opt / opt.1
1 .\" Man page generated from reStructuredText.
2 .
3 .
4 .nr rst2man-indent-level 0
5 .
6 .de1 rstReportMargin
7 \\$1 \\n[an-margin]
8 level \\n[rst2man-indent-level]
9 level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
10 -
11 \\n[rst2man-indent0]
12 \\n[rst2man-indent1]
13 \\n[rst2man-indent2]
14 ..
15 .de1 INDENT
16 .\" .rstReportMargin pre:
17 . RS \\$1
18 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
19 . nr rst2man-indent-level +1
20 .\" .rstReportMargin post:
21 ..
22 .de UNINDENT
23 . RE
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
29 ..
30 .TH "OPT" "1" "2023-05-24" "16" "LLVM"
31 .SH NAME
32 opt \- LLVM optimizer
33 .SH SYNOPSIS
34 .sp
35 \fBopt\fP [\fIoptions\fP] [\fIfilename\fP]
36 .SH DESCRIPTION
37 .sp
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.
44 .sp
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).
48 .sp
49 If an output filename is not specified with the \fI\%\-o\fP option,
50 \fBopt\fP writes its output to the standard output.
51 .SH OPTIONS
52 .INDENT 0.0
53 .TP
54 .B \-f
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.
58 .UNINDENT
59 .INDENT 0.0
60 .TP
61 .B \-help
62 Print a summary of command line options.
63 .UNINDENT
64 .INDENT 0.0
65 .TP
66 .B \-o <filename>
67 Specify the output filename.
68 .UNINDENT
69 .INDENT 0.0
70 .TP
71 .B \-S
72 Write output in LLVM intermediate language (instead of bitcode).
73 .UNINDENT
74 .INDENT 0.0
75 .TP
76 .B \-{passname}
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).
81 .UNINDENT
82 .INDENT 0.0
83 .TP
84 .B \-strip\-debug
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.
88 .UNINDENT
89 .INDENT 0.0
90 .TP
91 .B \-verify\-each
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.
96 .UNINDENT
97 .INDENT 0.0
98 .TP
99 .B \-stats
100 Print statistics.
101 .UNINDENT
102 .INDENT 0.0
103 .TP
104 .B \-time\-passes
105 Record the amount of time needed for each pass and print it to standard
106 error.
107 .UNINDENT
108 .INDENT 0.0
109 .TP
110 .B \-debug
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.
113 .UNINDENT
114 .INDENT 0.0
115 .TP
116 .B \-load=<plugin>
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:
122 .INDENT 7.0
123 .INDENT 3.5
124 .sp
125 .nf
126 .ft C
127 opt \-load=plugin.so \-help
128 .ft P
129 .fi
130 .UNINDENT
131 .UNINDENT
132 .UNINDENT
133 .INDENT 0.0
134 .TP
135 .B \-print\-passes
136 Print all available passes and exit.
137 .UNINDENT
138 .SH EXIT STATUS
139 .sp
140 If \fBopt\fP succeeds, it will exit with 0.  Otherwise, if an error
141 occurs, it will exit with a non\-zero value.
142 .SH AUTHOR
143 Maintained by the LLVM Team (https://llvm.org/).
144 .SH COPYRIGHT
145 2003-2023, LLVM Project
146 .\" Generated by docutils manpage writer.
147 .