blob: 910dfad450f594ced6970a73cac2bd23095eaffd [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
13The B<llc> command compiles LLVM bytecode into assembly language for a
14specified 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
18determined from the input bytecode file, unless the B<-march> option is used to
19override the default.
Brian Gaekee993d202004-05-14 19:50:33 +000020
21=head1 OPTIONS
22
23If I<filename> is - or omitted, B<llc> reads LLVM bytecode from standard input.
24Otherwise, it will read LLVM bytecode 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
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
Brian Gaekee993d202004-05-14 19:50:33 +000044=item B<-f>
45
46Overwrite output files. By default, B<llc> will refuse to overwrite
47an output file which already exists.
48
49=item B<-march>=I<arch>
50
Chris Lattner1e6df2e2005-05-13 20:01:11 +000051Specify the architecture for which to generate assembly, overriding the target
52encoded in the bytecode file. See the output of B<llc --help> for a list of
53valid architectures.
Brian Gaekee993d202004-05-14 19:50:33 +000054
Brian Gaekee993d202004-05-14 19:50:33 +000055=item B<--disable-fp-elim>
56
57Disable frame pointer elimination optimization.
58
Chris Lattner1e6df2e2005-05-13 20:01:11 +000059=item B<--disable-excess-fp-precision>
60
61Disable optimizations that may produce excess precision for floating point.
62Note that this option can dramatically slow down code on some systems
63(e.g. X86).
64
65=item B<--enable-unsafe-fp-math>
66
67Enable optimizations that make unsafe assumptions about IEEE math (e.g. that
68addition is associative) or may not work for all input ranges. These
69optimizations allow the code generator to make use of some instructions which
70would otherwise not be usable (such as fsin on X86).
71
Chris Lattner0c123df2004-12-09 21:16:40 +000072=item B<--enable-correct-eh-support>
Brian Gaekee993d202004-05-14 19:50:33 +000073
Chris Lattner0c123df2004-12-09 21:16:40 +000074Instruct the B<lowerinvoke> pass to insert code for correct exception handling
75support. This is expensive and is by default omitted for efficiency.
76
Chris Lattner0c123df2004-12-09 21:16:40 +000077=item B<--stats>
78
79Print statistics recorded by code-generation passes.
80
81=item B<--time-passes>
82
83Record the amount of time needed for each pass and print a report to standard
84error.
Brian Gaekee993d202004-05-14 19:50:33 +000085
Chris Lattner1e6df2e2005-05-13 20:01:11 +000086=item B<--load>=F<dso_path>
87
88Dynamically load F<dso_path> (a path to a dynamically shared object) that
89implements an LLVM target. This will permit the target name to be used with the
90B<-march> option so that code can be generated for that target.
91
92=back
93
94=head2 Tuning/Configuration Options
95
96=over
97
Brian Gaekee993d202004-05-14 19:50:33 +000098=item B<--print-machineinstrs>
99
Chris Lattner0c123df2004-12-09 21:16:40 +0000100Print generated machine code between compilation phases (useful for debugging).
Brian Gaekee993d202004-05-14 19:50:33 +0000101
102=item B<--regalloc>=I<allocator>
103
104Specify the register allocator to use. The default I<allocator> is I<local>.
105Valid register allocators are:
106
107=over
108
109=item I<simple>
110
111Very simple "always spill" register allocator
112
113=item I<local>
114
115Local register allocator
116
117=item I<linearscan>
118
Alkis Evlogimenosc8dec2c2004-07-21 08:18:50 +0000119Linear scan global register allocator
Brian Gaekee993d202004-05-14 19:50:33 +0000120
Misha Brukman1e635c32004-07-21 12:53:14 +0000121=item I<iterativescan>
Alkis Evlogimenos910d0d62004-07-21 08:24:35 +0000122
123Iterative scan global register allocator
124
Brian Gaekee993d202004-05-14 19:50:33 +0000125=back
126
127=item B<--spiller>=I<spiller>
128
129Specify the spiller to use for register allocators that support it. Currently
130this option is used only by the linear scan register allocator. The default
131I<spiller> is I<local>. Valid spillers are:
132
133=over
134
135=item I<simple>
136
137Simple spiller
138
139=item I<local>
140
141Local spiller
142
143=back
144
145=back
146
Chris Lattner0c123df2004-12-09 21:16:40 +0000147=head2 Intel IA-32-specific Options
148
149=over
150
151=item B<--x86-asm-syntax=att|intel>
152
153Specify whether to emit assembly code in AT&T syntax (the default) or intel
154syntax.
155
156=back
157
Brian Gaekee993d202004-05-14 19:50:33 +0000158=head2 SPARCV9-specific Options
159
160=over
161
162=item B<--disable-peephole>
163
164Disable peephole optimization pass.
165
166=item B<--disable-sched>
167
168Disable local scheduling pass.
169
Brian Gaekee993d202004-05-14 19:50:33 +0000170=back
171
172=head1 EXIT STATUS
173
174If B<llc> succeeds, it will exit with 0. Otherwise, if an error occurs,
175it will exit with a non-zero value.
176
177=head1 SEE ALSO
178
Misha Brukmanc08937a2004-07-02 16:06:19 +0000179L<lli|lli>
Brian Gaekee993d202004-05-14 19:50:33 +0000180
181=head1 AUTHORS
182
183Maintained by the LLVM Team (L<http://llvm.cs.uiuc.edu>).
184
185=cut