]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/clang/llc/llc.1
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / usr.bin / clang / llc / llc.1
1 .\" $FreeBSD$
2 .\" Man page generated from reStructuredText.
3 .
4 .TH "LLC" "1" "2020-06-26" "10" "LLVM"
5 .SH NAME
6 llc \- LLVM static compiler
7 .
8 .nr rst2man-indent-level 0
9 .
10 .de1 rstReportMargin
11 \\$1 \\n[an-margin]
12 level \\n[rst2man-indent-level]
13 level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
14 -
15 \\n[rst2man-indent0]
16 \\n[rst2man-indent1]
17 \\n[rst2man-indent2]
18 ..
19 .de1 INDENT
20 .\" .rstReportMargin pre:
21 . RS \\$1
22 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
23 . nr rst2man-indent-level +1
24 .\" .rstReportMargin post:
25 ..
26 .de UNINDENT
27 . RE
28 .\" indent \\n[an-margin]
29 .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
30 .nr rst2man-indent-level -1
31 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
32 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
33 ..
34 .SH SYNOPSIS
35 .sp
36 \fBllc\fP [\fIoptions\fP] [\fIfilename\fP]
37 .SH DESCRIPTION
38 .sp
39 The \fBllc\fP command compiles LLVM source inputs into assembly language
40 for a specified architecture.  The assembly language output can then be passed
41 through a native assembler and linker to generate a native executable.
42 .sp
43 The choice of architecture for the output assembly code is automatically
44 determined from the input file, unless the \fI\%\-march\fP option is used to
45 override the default.
46 .SH OPTIONS
47 .sp
48 If \fBfilename\fP is "\fB\-\fP" or omitted, \fBllc\fP reads from standard input.
49 Otherwise, it will from \fBfilename\fP\&.  Inputs can be in either the LLVM assembly
50 language format (\fB\&.ll\fP) or the LLVM bitcode format (\fB\&.bc\fP).
51 .sp
52 If the \fI\%\-o\fP option is omitted, then \fBllc\fP will send its output
53 to standard output if the input is from standard input.  If the \fI\%\-o\fP
54 option specifies "\fB\-\fP", then the output will also be sent to standard output.
55 .sp
56 If no \fI\%\-o\fP option is specified and an input file other than "\fB\-\fP" is
57 specified, then \fBllc\fP creates the output filename by taking the input
58 filename, removing any existing \fB\&.bc\fP extension, and adding a \fB\&.s\fP suffix.
59 .sp
60 Other \fBllc\fP options are described below.
61 .SS End\-user Options
62 .INDENT 0.0
63 .TP
64 .B \-help
65 Print a summary of command line options.
66 .UNINDENT
67 .INDENT 0.0
68 .TP
69 .B \-o <filename>
70 Use \fB<filename>\fP as the output filename. See the summary above for more
71 details.
72 .UNINDENT
73 .INDENT 0.0
74 .TP
75 .B \-O=uint
76 Generate code at different optimization levels.  These correspond to the
77 \fB\-O0\fP, \fB\-O1\fP, \fB\-O2\fP, and \fB\-O3\fP optimization levels used by
78 \fBclang\fP\&.
79 .UNINDENT
80 .INDENT 0.0
81 .TP
82 .B \-mtriple=<target triple>
83 Override the target triple specified in the input file with the specified
84 string.
85 .UNINDENT
86 .INDENT 0.0
87 .TP
88 .B \-march=<arch>
89 Specify the architecture for which to generate assembly, overriding the target
90 encoded in the input file.  See the output of \fBllc \-help\fP for a list of
91 valid architectures.  By default this is inferred from the target triple or
92 autodetected to the current architecture.
93 .UNINDENT
94 .INDENT 0.0
95 .TP
96 .B \-mcpu=<cpuname>
97 Specify a specific chip in the current architecture to generate code for.
98 By default this is inferred from the target triple and autodetected to
99 the current architecture.  For a list of available CPUs, use:
100 .INDENT 7.0
101 .INDENT 3.5
102 .sp
103 .nf
104 .ft C
105 llvm\-as < /dev/null | llc \-march=xyz \-mcpu=help
106 .ft P
107 .fi
108 .UNINDENT
109 .UNINDENT
110 .UNINDENT
111 .INDENT 0.0
112 .TP
113 .B \-filetype=<output file type>
114 Specify what kind of output \fBllc\fP should generated.  Options are: \fBasm\fP
115 for textual assembly ( \fB\(aq.s\(aq\fP), \fBobj\fP for native object files (\fB\(aq.o\(aq\fP)
116 and \fBnull\fP for not emitting anything (for performance testing).
117 .sp
118 Note that not all targets support all options.
119 .UNINDENT
120 .INDENT 0.0
121 .TP
122 .B \-mattr=a1,+a2,\-a3,...
123 Override or control specific attributes of the target, such as whether SIMD
124 operations are enabled or not.  The default set of attributes is set by the
125 current CPU.  For a list of available attributes, use:
126 .INDENT 7.0
127 .INDENT 3.5
128 .sp
129 .nf
130 .ft C
131 llvm\-as < /dev/null | llc \-march=xyz \-mattr=help
132 .ft P
133 .fi
134 .UNINDENT
135 .UNINDENT
136 .UNINDENT
137 .INDENT 0.0
138 .TP
139 .B \-\-frame\-pointer
140 Specify effect of frame pointer elimination optimization (all,non\-leaf,none).
141 .UNINDENT
142 .INDENT 0.0
143 .TP
144 .B \-\-disable\-excess\-fp\-precision
145 Disable optimizations that may produce excess precision for floating point.
146 Note that this option can dramatically slow down code on some systems
147 (e.g. X86).
148 .UNINDENT
149 .INDENT 0.0
150 .TP
151 .B \-\-enable\-no\-infs\-fp\-math
152 Enable optimizations that assume no Inf values.
153 .UNINDENT
154 .INDENT 0.0
155 .TP
156 .B \-\-enable\-no\-nans\-fp\-math
157 Enable optimizations that assume no NAN values.
158 .UNINDENT
159 .INDENT 0.0
160 .TP
161 .B \-\-enable\-unsafe\-fp\-math
162 Enable optimizations that make unsafe assumptions about IEEE math (e.g. that
163 addition is associative) or may not work for all input ranges.  These
164 optimizations allow the code generator to make use of some instructions which
165 would otherwise not be usable (such as \fBfsin\fP on X86).
166 .UNINDENT
167 .INDENT 0.0
168 .TP
169 .B \-\-stats
170 Print statistics recorded by code\-generation passes.
171 .UNINDENT
172 .INDENT 0.0
173 .TP
174 .B \-\-time\-passes
175 Record the amount of time needed for each pass and print a report to standard
176 error.
177 .UNINDENT
178 .INDENT 0.0
179 .TP
180 .B \-\-load=<dso_path>
181 Dynamically load \fBdso_path\fP (a path to a dynamically shared object) that
182 implements an LLVM target.  This will permit the target name to be used with
183 the \fI\%\-march\fP option so that code can be generated for that target.
184 .UNINDENT
185 .INDENT 0.0
186 .TP
187 .B \-meabi=[default|gnu|4|5]
188 Specify which EABI version should conform to.  Valid EABI versions are \fIgnu\fP,
189 \fI4\fP and \fI5\fP\&.  Default value (\fIdefault\fP) depends on the triple.
190 .UNINDENT
191 .INDENT 0.0
192 .TP
193 .B \-stack\-size\-section
194 Emit the .stack_sizes section which contains stack size metadata. The section
195 contains an array of pairs of function symbol values (pointer size) and stack
196 sizes (unsigned LEB128). The stack size values only include the space allocated
197 in the function prologue. Functions with dynamic stack allocations are not
198 included.
199 .UNINDENT
200 .INDENT 0.0
201 .TP
202 .B \-remarks\-section
203 Emit the __remarks (MachO) section which contains metadata about remark
204 diagnostics.
205 .UNINDENT
206 .SS Tuning/Configuration Options
207 .INDENT 0.0
208 .TP
209 .B \-\-print\-machineinstrs
210 Print generated machine code between compilation phases (useful for debugging).
211 .UNINDENT
212 .INDENT 0.0
213 .TP
214 .B \-\-regalloc=<allocator>
215 Specify the register allocator to use.
216 Valid register allocators are:
217 .sp
218 \fIbasic\fP
219 .INDENT 7.0
220 .INDENT 3.5
221 Basic register allocator.
222 .UNINDENT
223 .UNINDENT
224 .sp
225 \fIfast\fP
226 .INDENT 7.0
227 .INDENT 3.5
228 Fast register allocator. It is the default for unoptimized code.
229 .UNINDENT
230 .UNINDENT
231 .sp
232 \fIgreedy\fP
233 .INDENT 7.0
234 .INDENT 3.5
235 Greedy register allocator. It is the default for optimized code.
236 .UNINDENT
237 .UNINDENT
238 .sp
239 \fIpbqp\fP
240 .INDENT 7.0
241 .INDENT 3.5
242 Register allocator based on \(aqPartitioned Boolean Quadratic Programming\(aq.
243 .UNINDENT
244 .UNINDENT
245 .UNINDENT
246 .INDENT 0.0
247 .TP
248 .B \-\-spiller=<spiller>
249 Specify the spiller to use for register allocators that support it.  Currently
250 this option is used only by the linear scan register allocator.  The default
251 \fBspiller\fP is \fIlocal\fP\&.  Valid spillers are:
252 .sp
253 \fIsimple\fP
254 .INDENT 7.0
255 .INDENT 3.5
256 Simple spiller
257 .UNINDENT
258 .UNINDENT
259 .sp
260 \fIlocal\fP
261 .INDENT 7.0
262 .INDENT 3.5
263 Local spiller
264 .UNINDENT
265 .UNINDENT
266 .UNINDENT
267 .SS Intel IA\-32\-specific Options
268 .INDENT 0.0
269 .TP
270 .B \-\-x86\-asm\-syntax=[att|intel]
271 Specify whether to emit assembly code in AT&T syntax (the default) or Intel
272 syntax.
273 .UNINDENT
274 .SH EXIT STATUS
275 .sp
276 If \fBllc\fP succeeds, it will exit with 0.  Otherwise, if an error
277 occurs, it will exit with a non\-zero value.
278 .SH SEE ALSO
279 .sp
280 \fBlli(1)\fP
281 .SH AUTHOR
282 Maintained by the LLVM Team (https://llvm.org/).
283 .SH COPYRIGHT
284 2003-2020, LLVM Project
285 .\" Generated by docutils manpage writer.
286 .