blob: fd38abd08be4cd3456628a041db5b2064c064246 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001=pod
2
3=head1 NAME
4
5llc - LLVM static compiler
6
7=head1 SYNOPSIS
8
9B<llc> [I<options>] [I<filename>]
10
11=head1 DESCRIPTION
12
Daniel Dunbar0a2e0df2009-09-15 20:31:28 +000013The B<llc> command compiles LLVM source inputs into assembly language for a
Dan Gohmanf17a25c2007-07-18 16:29:46 +000014specified architecture. The assembly language output can then be passed through
15a native assembler and linker to generate a native executable.
16
17The choice of architecture for the output assembly code is automatically
Daniel Dunbar0a2e0df2009-09-15 20:31:28 +000018determined from the input file, unless the B<-march> option is used to override
19the default.
Dan Gohmanf17a25c2007-07-18 16:29:46 +000020
21=head1 OPTIONS
22
Daniel Dunbar0a2e0df2009-09-15 20:31:28 +000023If I<filename> is - or omitted, B<llc> reads from standard input. Otherwise, it
24will from I<filename>. Inputs can be in either the LLVM assembly language
25format (.ll) or the LLVM bitcode format (.bc).
Dan Gohmanf17a25c2007-07-18 16:29:46 +000026
27If the B<-o> option is omitted, then B<llc> will send its output to standard
28output if the input is from standard input. If the B<-o> option specifies -,
29then the output will also be sent to standard output.
30
31If no B<-o> option is specified and an input file other than - is specified,
32then B<llc> creates the output filename by taking the input filename,
33removing any existing F<.bc> extension, and adding a F<.s> suffix.
34
35Other B<llc> options are as follows:
36
37=head2 End-user Options
38
39=over
40
41=item B<--help>
42
43Print a summary of command line options.
44
Bill Wendling58ed5d22009-04-29 00:15:41 +000045=item B<-O>=I<uint>
46
47Generate code at different optimization levels. These correspond to the I<-O0>,
48I<-O1>, I<-O2>, I<-O3>, and I<-O4> optimization levels used by B<llvm-gcc> and
49B<clang>.
50
Dan Gohmanf17a25c2007-07-18 16:29:46 +000051=item B<-f>
52
Dan Gohman87489cf2009-08-25 15:54:01 +000053Enable binary output on terminals. Normally, B<llvm-extract> will refuse to
54write raw bitcode output if the output stream is a terminal. With this option,
55B<llvm-extract> will write raw bitcode regardless of the output device.
Dan Gohmanf17a25c2007-07-18 16:29:46 +000056
57=item B<-mtriple>=I<target triple>
58
Daniel Dunbar0a2e0df2009-09-15 20:31:28 +000059Override the target triple specified in the input file with the specified
60string.
Dan Gohmanf17a25c2007-07-18 16:29:46 +000061
62=item B<-march>=I<arch>
63
64Specify the architecture for which to generate assembly, overriding the target
Daniel Dunbar0a2e0df2009-09-15 20:31:28 +000065encoded in the input file. See the output of B<llc --help> for a list of
Dan Gohmanf17a25c2007-07-18 16:29:46 +000066valid architectures. By default this is inferred from the target triple or
67autodetected to the current architecture.
68
69=item B<-mcpu>=I<cpuname>
70
71Specify a specific chip in the current architecture to generate code for.
72By default this is inferred from the target triple and autodetected to
73the current architecture. For a list of available CPUs, use:
74B<llvm-as E<lt> /dev/null | llc -march=xyz -mcpu=help>
75
76=item B<-mattr>=I<a1,+a2,-a3,...>
77
78Override or control specific attributes of the target, such as whether SIMD
79operations are enabled or not. The default set of attributes is set by the
80current CPU. For a list of available attributes, use:
81B<llvm-as E<lt> /dev/null | llc -march=xyz -mattr=help>
82
83=item B<--disable-fp-elim>
84
85Disable frame pointer elimination optimization.
86
87=item B<--disable-excess-fp-precision>
88
89Disable optimizations that may produce excess precision for floating point.
90Note that this option can dramatically slow down code on some systems
91(e.g. X86).
92
93=item B<--enable-unsafe-fp-math>
94
95Enable optimizations that make unsafe assumptions about IEEE math (e.g. that
96addition is associative) or may not work for all input ranges. These
97optimizations allow the code generator to make use of some instructions which
98would otherwise not be usable (such as fsin on X86).
99
100=item B<--enable-correct-eh-support>
101
102Instruct the B<lowerinvoke> pass to insert code for correct exception handling
103support. This is expensive and is by default omitted for efficiency.
104
105=item B<--stats>
106
107Print statistics recorded by code-generation passes.
108
109=item B<--time-passes>
110
111Record the amount of time needed for each pass and print a report to standard
112error.
113
114=item B<--load>=F<dso_path>
115
116Dynamically load F<dso_path> (a path to a dynamically shared object) that
117implements an LLVM target. This will permit the target name to be used with the
118B<-march> option so that code can be generated for that target.
119
120=back
121
122=head2 Tuning/Configuration Options
123
124=over
125
126=item B<--print-machineinstrs>
127
128Print generated machine code between compilation phases (useful for debugging).
129
130=item B<--regalloc>=I<allocator>
131
132Specify the register allocator to use. The default I<allocator> is I<local>.
133Valid register allocators are:
134
135=over
136
137=item I<simple>
138
139Very simple "always spill" register allocator
140
141=item I<local>
142
143Local register allocator
144
145=item I<linearscan>
146
147Linear scan global register allocator
148
149=item I<iterativescan>
150
151Iterative scan global register allocator
152
153=back
154
155=item B<--spiller>=I<spiller>
156
157Specify the spiller to use for register allocators that support it. Currently
158this option is used only by the linear scan register allocator. The default
159I<spiller> is I<local>. Valid spillers are:
160
161=over
162
163=item I<simple>
164
165Simple spiller
166
167=item I<local>
168
169Local spiller
170
171=back
172
173=back
174
175=head2 Intel IA-32-specific Options
176
177=over
178
179=item B<--x86-asm-syntax=att|intel>
180
181Specify whether to emit assembly code in AT&T syntax (the default) or intel
182syntax.
183
184=back
185
186=head1 EXIT STATUS
187
188If B<llc> succeeds, it will exit with 0. Otherwise, if an error occurs,
189it will exit with a non-zero value.
190
191=head1 SEE ALSO
192
193L<lli|lli>
194
195=head1 AUTHORS
196
197Maintained by the LLVM Team (L<http://llvm.org>).
198
199=cut