blob: eba7859e28827d2dff6176b004a8cce6295a209d [file] [log] [blame]
Brian Gaekee993d202004-05-14 19:50:33 +00001=pod
2
3=head1 NAME
4
5llc - LLVM static compiler
6
7=head1 SYNOPSIS
8
Misha Brukmanc08937a2004-07-02 16:06:19 +00009B<llc> [I<options>] [I<filename>]
Brian Gaekee993d202004-05-14 19:50:33 +000010
11=head1 DESCRIPTION
12
Gabor Greif3bd6e0d2007-07-09 11:24:05 +000013The B<llc> command compiles LLVM bitcode into assembly language for a
Brian Gaekee993d202004-05-14 19:50:33 +000014specified architecture. The assembly language output can then be passed through
Chris Lattner1e6df2e2005-05-13 20:01:11 +000015a native assembler and linker to generate a native executable.
Brian Gaekee993d202004-05-14 19:50:33 +000016
Chris Lattner1e6df2e2005-05-13 20:01:11 +000017The choice of architecture for the output assembly code is automatically
Gabor Greif3bd6e0d2007-07-09 11:24:05 +000018determined from the input bitcode file, unless the B<-march> option is used to
Chris Lattner1e6df2e2005-05-13 20:01:11 +000019override the default.
Brian Gaekee993d202004-05-14 19:50:33 +000020
21=head1 OPTIONS
22
Gabor Greif3bd6e0d2007-07-09 11:24:05 +000023If I<filename> is - or omitted, B<llc> reads LLVM bitcode from standard input.
24Otherwise, it will read LLVM bitcode from I<filename>.
Brian Gaekee993d202004-05-14 19:50:33 +000025
26If the B<-o> option is omitted, then B<llc> will send its output to standard
27output if the input is from standard input. If the B<-o> option specifies -,
28then the output will also be sent to standard output.
29
30If no B<-o> option is specified and an input file other than - is specified,
31then B<llc> creates the output filename by taking the input filename,
32removing any existing F<.bc> extension, and adding a F<.s> suffix.
33
34Other B<llc> options are as follows:
35
Chris Lattner1e6df2e2005-05-13 20:01:11 +000036=head2 End-user Options
37
Brian Gaekee993d202004-05-14 19:50:33 +000038=over
39
Chris Lattner1e6df2e2005-05-13 20:01:11 +000040=item B<--help>
41
42Print a summary of command line options.
43
Bill Wendlingbe8cc2a2009-04-29 00:15:41 +000044=item B<-O>=I<uint>
45
46Generate code at different optimization levels. These correspond to the I<-O0>,
47I<-O1>, I<-O2>, I<-O3>, and I<-O4> optimization levels used by B<llvm-gcc> and
48B<clang>.
49
Brian Gaekee993d202004-05-14 19:50:33 +000050=item B<-f>
51
52Overwrite output files. By default, B<llc> will refuse to overwrite
53an output file which already exists.
54
Chris Lattnerf4955362005-12-16 05:19:35 +000055=item B<-mtriple>=I<target triple>
Chris Lattner4f501bf2005-12-16 05:18:53 +000056
Gabor Greif3bd6e0d2007-07-09 11:24:05 +000057Override the target triple specified in the input bitcode file with the
Chris Lattner4f501bf2005-12-16 05:18:53 +000058specified string.
59
Brian Gaekee993d202004-05-14 19:50:33 +000060=item B<-march>=I<arch>
61
Chris Lattner1e6df2e2005-05-13 20:01:11 +000062Specify the architecture for which to generate assembly, overriding the target
Gabor Greif3bd6e0d2007-07-09 11:24:05 +000063encoded in the bitcode file. See the output of B<llc --help> for a list of
Chris Lattner4f501bf2005-12-16 05:18:53 +000064valid architectures. By default this is inferred from the target triple or
65autodetected to the current architecture.
66
67=item B<-mcpu>=I<cpuname>
68
69Specify a specific chip in the current architecture to generate code for.
70By default this is inferred from the target triple and autodetected to
71the current architecture. For a list of available CPUs, use:
72B<llvm-as E<lt> /dev/null | llc -march=xyz -mcpu=help>
73
74=item B<-mattr>=I<a1,+a2,-a3,...>
75
76Override or control specific attributes of the target, such as whether SIMD
77operations are enabled or not. The default set of attributes is set by the
78current CPU. For a list of available attributes, use:
79B<llvm-as E<lt> /dev/null | llc -march=xyz -mattr=help>
Brian Gaekee993d202004-05-14 19:50:33 +000080
Brian Gaekee993d202004-05-14 19:50:33 +000081=item B<--disable-fp-elim>
82
83Disable frame pointer elimination optimization.
84
Chris Lattner1e6df2e2005-05-13 20:01:11 +000085=item B<--disable-excess-fp-precision>
86
87Disable optimizations that may produce excess precision for floating point.
88Note that this option can dramatically slow down code on some systems
89(e.g. X86).
90
91=item B<--enable-unsafe-fp-math>
92
93Enable optimizations that make unsafe assumptions about IEEE math (e.g. that
94addition is associative) or may not work for all input ranges. These
95optimizations allow the code generator to make use of some instructions which
96would otherwise not be usable (such as fsin on X86).
97
Chris Lattner0c123df2004-12-09 21:16:40 +000098=item B<--enable-correct-eh-support>
Brian Gaekee993d202004-05-14 19:50:33 +000099
Chris Lattner0c123df2004-12-09 21:16:40 +0000100Instruct the B<lowerinvoke> pass to insert code for correct exception handling
101support. This is expensive and is by default omitted for efficiency.
102
Chris Lattner0c123df2004-12-09 21:16:40 +0000103=item B<--stats>
104
105Print statistics recorded by code-generation passes.
106
107=item B<--time-passes>
108
109Record the amount of time needed for each pass and print a report to standard
110error.
Brian Gaekee993d202004-05-14 19:50:33 +0000111
Chris Lattner1e6df2e2005-05-13 20:01:11 +0000112=item B<--load>=F<dso_path>
113
114Dynamically load F<dso_path> (a path to a dynamically shared object) that
115implements an LLVM target. This will permit the target name to be used with the
116B<-march> option so that code can be generated for that target.
117
118=back
119
120=head2 Tuning/Configuration Options
121
122=over
123
Brian Gaekee993d202004-05-14 19:50:33 +0000124=item B<--print-machineinstrs>
125
Chris Lattner0c123df2004-12-09 21:16:40 +0000126Print generated machine code between compilation phases (useful for debugging).
Brian Gaekee993d202004-05-14 19:50:33 +0000127
128=item B<--regalloc>=I<allocator>
129
130Specify the register allocator to use. The default I<allocator> is I<local>.
131Valid register allocators are:
132
133=over
134
135=item I<simple>
136
137Very simple "always spill" register allocator
138
139=item I<local>
140
141Local register allocator
142
143=item I<linearscan>
144
Alkis Evlogimenosc8dec2c2004-07-21 08:18:50 +0000145Linear scan global register allocator
Brian Gaekee993d202004-05-14 19:50:33 +0000146
Misha Brukman1e635c32004-07-21 12:53:14 +0000147=item I<iterativescan>
Alkis Evlogimenos910d0d62004-07-21 08:24:35 +0000148
149Iterative scan global register allocator
150
Brian Gaekee993d202004-05-14 19:50:33 +0000151=back
152
153=item B<--spiller>=I<spiller>
154
155Specify the spiller to use for register allocators that support it. Currently
156this option is used only by the linear scan register allocator. The default
157I<spiller> is I<local>. Valid spillers are:
158
159=over
160
161=item I<simple>
162
163Simple spiller
164
165=item I<local>
166
167Local spiller
168
169=back
170
171=back
172
Chris Lattner0c123df2004-12-09 21:16:40 +0000173=head2 Intel IA-32-specific Options
174
175=over
176
177=item B<--x86-asm-syntax=att|intel>
178
179Specify whether to emit assembly code in AT&T syntax (the default) or intel
180syntax.
181
182=back
183
Brian Gaekee993d202004-05-14 19:50:33 +0000184=head1 EXIT STATUS
185
186If B<llc> succeeds, it will exit with 0. Otherwise, if an error occurs,
187it will exit with a non-zero value.
188
189=head1 SEE ALSO
190
Misha Brukmanc08937a2004-07-02 16:06:19 +0000191L<lli|lli>
Brian Gaekee993d202004-05-14 19:50:33 +0000192
193=head1 AUTHORS
194
Reid Spencercd143fc2006-03-14 05:42:07 +0000195Maintained by the LLVM Team (L<http://llvm.org>).
Brian Gaekee993d202004-05-14 19:50:33 +0000196
197=cut