blob: 7a7bbcac9c5895e45410c11829e11f30acc99afc [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
13The B<llc> command compiles LLVM bitcode into assembly language for a
14specified 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
18determined from the input bitcode file, unless the B<-march> option is used to
19override the default.
20
21=head1 OPTIONS
22
23If I<filename> is - or omitted, B<llc> reads LLVM bitcode from standard input.
24Otherwise, it will read LLVM bitcode from I<filename>.
25
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
36=head2 End-user Options
37
38=over
39
40=item B<--help>
41
42Print a summary of command line options.
43
Bill Wendling58ed5d22009-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
Dan Gohmanf17a25c2007-07-18 16:29:46 +000050=item B<-f>
51
Dan Gohman87489cf2009-08-25 15:54:01 +000052Enable binary output on terminals. Normally, B<llvm-extract> will refuse to
53write raw bitcode output if the output stream is a terminal. With this option,
54B<llvm-extract> will write raw bitcode regardless of the output device.
Dan Gohmanf17a25c2007-07-18 16:29:46 +000055
56=item B<-mtriple>=I<target triple>
57
58Override the target triple specified in the input bitcode file with the
59specified string.
60
61=item B<-march>=I<arch>
62
63Specify the architecture for which to generate assembly, overriding the target
64encoded in the bitcode file. See the output of B<llc --help> for a list of
65valid architectures. By default this is inferred from the target triple or
66autodetected to the current architecture.
67
68=item B<-mcpu>=I<cpuname>
69
70Specify a specific chip in the current architecture to generate code for.
71By default this is inferred from the target triple and autodetected to
72the current architecture. For a list of available CPUs, use:
73B<llvm-as E<lt> /dev/null | llc -march=xyz -mcpu=help>
74
75=item B<-mattr>=I<a1,+a2,-a3,...>
76
77Override or control specific attributes of the target, such as whether SIMD
78operations are enabled or not. The default set of attributes is set by the
79current CPU. For a list of available attributes, use:
80B<llvm-as E<lt> /dev/null | llc -march=xyz -mattr=help>
81
82=item B<--disable-fp-elim>
83
84Disable frame pointer elimination optimization.
85
86=item B<--disable-excess-fp-precision>
87
88Disable optimizations that may produce excess precision for floating point.
89Note that this option can dramatically slow down code on some systems
90(e.g. X86).
91
92=item B<--enable-unsafe-fp-math>
93
94Enable optimizations that make unsafe assumptions about IEEE math (e.g. that
95addition is associative) or may not work for all input ranges. These
96optimizations allow the code generator to make use of some instructions which
97would otherwise not be usable (such as fsin on X86).
98
99=item B<--enable-correct-eh-support>
100
101Instruct the B<lowerinvoke> pass to insert code for correct exception handling
102support. This is expensive and is by default omitted for efficiency.
103
104=item B<--stats>
105
106Print statistics recorded by code-generation passes.
107
108=item B<--time-passes>
109
110Record the amount of time needed for each pass and print a report to standard
111error.
112
113=item B<--load>=F<dso_path>
114
115Dynamically load F<dso_path> (a path to a dynamically shared object) that
116implements an LLVM target. This will permit the target name to be used with the
117B<-march> option so that code can be generated for that target.
118
119=back
120
121=head2 Tuning/Configuration Options
122
123=over
124
125=item B<--print-machineinstrs>
126
127Print generated machine code between compilation phases (useful for debugging).
128
129=item B<--regalloc>=I<allocator>
130
131Specify the register allocator to use. The default I<allocator> is I<local>.
132Valid register allocators are:
133
134=over
135
136=item I<simple>
137
138Very simple "always spill" register allocator
139
140=item I<local>
141
142Local register allocator
143
144=item I<linearscan>
145
146Linear scan global register allocator
147
148=item I<iterativescan>
149
150Iterative scan global register allocator
151
152=back
153
154=item B<--spiller>=I<spiller>
155
156Specify the spiller to use for register allocators that support it. Currently
157this option is used only by the linear scan register allocator. The default
158I<spiller> is I<local>. Valid spillers are:
159
160=over
161
162=item I<simple>
163
164Simple spiller
165
166=item I<local>
167
168Local spiller
169
170=back
171
172=back
173
174=head2 Intel IA-32-specific Options
175
176=over
177
178=item B<--x86-asm-syntax=att|intel>
179
180Specify whether to emit assembly code in AT&T syntax (the default) or intel
181syntax.
182
183=back
184
185=head1 EXIT STATUS
186
187If B<llc> succeeds, it will exit with 0. Otherwise, if an error occurs,
188it will exit with a non-zero value.
189
190=head1 SEE ALSO
191
192L<lli|lli>
193
194=head1 AUTHORS
195
196Maintained by the LLVM Team (L<http://llvm.org>).
197
198=cut