blob: f1e7be3df40fb62b4edb208337761274faa5bd93 [file] [log] [blame]
John Criswell69d903d2003-09-12 15:46:24 +00001<html>
Chris Lattner08a04fd2003-10-07 20:12:05 +00002<title>LLVM: llc tool</title>
John Criswell69d903d2003-09-12 15:46:24 +00003
Chris Lattner08a04fd2003-10-07 20:12:05 +00004<body bgcolor=white>
John Criswell69d903d2003-09-12 15:46:24 +00005
Chris Lattner08a04fd2003-10-07 20:12:05 +00006<center><h1>LLVM: <tt>llc</tt> tool</h1></center>
John Criswell69d903d2003-09-12 15:46:24 +00007<HR>
8
Chris Lattner08a04fd2003-10-07 20:12:05 +00009<h3>NAME</h3>
10<tt>llc</tt>
John Criswell69d903d2003-09-12 15:46:24 +000011
Chris Lattner08a04fd2003-10-07 20:12:05 +000012<h3>SYNOPSIS</h3>
13<tt>llc [options] [filename]</tt>
John Criswell69d903d2003-09-12 15:46:24 +000014
Chris Lattner08a04fd2003-10-07 20:12:05 +000015<h3>DESCRIPTION</h3>
John Criswell69d903d2003-09-12 15:46:24 +000016
Chris Lattner08a04fd2003-10-07 20:12:05 +000017The <tt>llc</tt> command compiles LLVM bytecode into assembly language for a
18specified architecture. The assembly language output can then be passed through
19a native assembler and linker to generate native code.
John Criswell511a4912003-09-29 20:10:08 +000020<p>
21The choice of architecture for the output assembly code is determined as
22follows:
23
24<ul>
25 <li>
26 If the user has specified an architecture with the -m option, use that
27 architecture.
28 <p>
29
30 <li>
31 Examine the input LLVM bytecode file:
32 <ul>
33 <li>
34 If it specifies little endian and a pointer size of 32 bits, select the
35 x86 architecture.
36 <p>
37
38 <li>
39 If it specifies big endian and a pointer size of 64 bit pointers,
40 select the SparcV9 architecture.
41 </ul>
42 <p>
43
44 <li>
Chris Lattner08a04fd2003-10-07 20:12:05 +000045 If <tt>llc</tt> was compiled on an architecture for which it can
46 generate code, select the architecture upon which <tt>llc</tt> was
47 compiled.
John Criswell511a4912003-09-29 20:10:08 +000048 <p>
49
50 <li>
51 Print a message to the user asking him or her to specify the output
52 architecture explicitly.
53</ul>
54
55<p>
56
Chris Lattner08a04fd2003-10-07 20:12:05 +000057If filename is not specified, or if filename is -, <tt>llc</tt> reads its input
58from standard input. Otherwise, it will read its input from filename.
John Criswell511a4912003-09-29 20:10:08 +000059<p>
60
Chris Lattner08a04fd2003-10-07 20:12:05 +000061If the -o option is left unspecified, then <tt>llc</tt> will send its output to standard
John Criswell511a4912003-09-29 20:10:08 +000062output if the input is from standard input. If the -o option specifies -, then
63the output will also be sent to standard output.
64<p>
65
66If no -o option is specified and an input file other than - is specified, then
Chris Lattner08a04fd2003-10-07 20:12:05 +000067<tt>llc</tt> creates the output filename as follows:
John Criswell511a4912003-09-29 20:10:08 +000068
69<ul>
70 <li>
71 If the file ends in .bc, then the .bc suffix is removed, and the .s suffix
72 is appended.
73 <p>
74 <li>
75 Otherwise, the .s suffix is appended to the input filename.
76</ul>
John Criswell69d903d2003-09-12 15:46:24 +000077
78<h3>
79OPTIONS
80</h3>
John Criswell69d903d2003-09-12 15:46:24 +000081<ul>
John Criswell69d903d2003-09-12 15:46:24 +000082 <li>-f
83 <br>
84 Overwrite output files
85 <p>
86
John Criswell69d903d2003-09-12 15:46:24 +000087 <li>-m&lt;arch&gt;
88 <br>
89 Specify the architecture for which to generate assembly. Valid
John Criswell69d903d2003-09-12 15:46:24 +000090 architectures are:
91
92 <dl compact>
Alkis Evlogimenos89157a22004-03-02 03:36:10 +000093 <dt> x86 </dt>
Alkis Evlogimenoseed462b2003-10-02 06:13:19 +000094 <dd>IA-32 (Pentium and above)</dd>
John Criswell69d903d2003-09-12 15:46:24 +000095
Alkis Evlogimenos89157a22004-03-02 03:36:10 +000096 <dt> sparc </dt>
Alkis Evlogimenoseed462b2003-10-02 06:13:19 +000097 <dd>SPARC V9</dd>
Chris Lattner15a29862004-02-18 23:30:02 +000098
Alkis Evlogimenos89157a22004-03-02 03:36:10 +000099 <dt> c </dt>
Chris Lattner15a29862004-02-18 23:30:02 +0000100 <dd>Emit C code</dd>
John Criswell69d903d2003-09-12 15:46:24 +0000101 </dl>
102 <p>
103
104 <li>-o &lt;filename&gt;
105 <br>
John Criswell511a4912003-09-29 20:10:08 +0000106 Specify the output filename.
John Criswell69d903d2003-09-12 15:46:24 +0000107 <p>
108
John Criswell69d903d2003-09-12 15:46:24 +0000109 <li> -help
110 <br>
111 Print a summary of command line options.
112 <p>
113
114 <li> -stats
115 <br>
116 Print statistics.
117 <p>
118
119 <li> -time-passes
120 <br>
121 Record the amount of time needed for each pass and print it to standard
122 error.
123 <p>
Chris Lattner7a59bc82003-10-07 19:42:50 +0000124
John Criswell69d903d2003-09-12 15:46:24 +0000125</ul>
Chris Lattner7a59bc82003-10-07 19:42:50 +0000126<h4>X86 Specific Options</h4>
127<ul>
128 <li>-disable-fp-elim
129 <br>
130 Disable frame pointer elimination optimization.
131 <p>
132
133 <li>-disable-pattern-isel
134 <br>
135 Use the 'simple' X86 instruction selector (the default).
136 <p>
137
138 <li>-print-machineinstrs
139 <br>
140 Print generated machine code.
141 <p>
142
143 <li>-regalloc=&lt;ra&gt;
144 <br>
145 Specify the register allocator to use. The default is <i>simple</i>.
146 Valid register allocators are:
Alkis Evlogimenos89157a22004-03-02 03:36:10 +0000147 <p>
Chris Lattner7a59bc82003-10-07 19:42:50 +0000148 <dl compact>
Alkis Evlogimenos89157a22004-03-02 03:36:10 +0000149 <dt> simple </dt>
Chris Lattner7a59bc82003-10-07 19:42:50 +0000150 <dd>Very simple register allocator</dd>
151
Alkis Evlogimenos89157a22004-03-02 03:36:10 +0000152 <dt> local </dt>
Chris Lattner7a59bc82003-10-07 19:42:50 +0000153 <dd>Local register allocator</dd>
Alkis Evlogimenosdd420e02004-03-01 23:18:15 +0000154
Alkis Evlogimenos89157a22004-03-02 03:36:10 +0000155 <dt> linearscan </dt>
Alkis Evlogimenosdd420e02004-03-01 23:18:15 +0000156 <dd>Linear scan global register allocator (experimental)</dd>
Alkis Evlogimenos89157a22004-03-02 03:36:10 +0000157 </dl>
Alkis Evlogimenosdd420e02004-03-01 23:18:15 +0000158
159 <li>-spiller=&lt;sp&gt;
160 <br>
161 Specify the spiller to use for register allocators that support it.
162 Currently this option is used by the linear scan register
163 allocator. The default is <i>local</i>.
164 Valid spillers are:
Alkis Evlogimenos89157a22004-03-02 03:36:10 +0000165 <p>
Alkis Evlogimenosdd420e02004-03-01 23:18:15 +0000166 <dl compact>
Alkis Evlogimenos89157a22004-03-02 03:36:10 +0000167 <dt> local </dt>
Alkis Evlogimenosdd420e02004-03-01 23:18:15 +0000168 <dd>Local spiller</dd>
Chris Lattner7a59bc82003-10-07 19:42:50 +0000169 </dl>
Chris Lattner7a59bc82003-10-07 19:42:50 +0000170
171</ul>
172
173<h4>Sparc Specific Options</h4>
174<ul>
175 <li>-disable-peephole
176 <br>
177 Disable peephole optimization pass.
178 <p>
179
Chris Lattner7a59bc82003-10-07 19:42:50 +0000180 <li>-disable-sched
181 <br>
182 Disable local scheduling pass.
183 <p>
184
185 <li>-disable-strip
186 <br>
187 Do not strip the LLVM bytecode included in executable.
188 <p>
189
190 <li>-enable-maps
191 <br>
192 Emit LLVM-to-MachineCode mapping info to assembly.
193 <p>
194</ul>
195
John Criswell69d903d2003-09-12 15:46:24 +0000196
Chris Lattner08a04fd2003-10-07 20:12:05 +0000197<h3>EXIT STATUS</h3>
John Criswell69d903d2003-09-12 15:46:24 +0000198
Chris Lattner08a04fd2003-10-07 20:12:05 +0000199If <tt>llc</tt> succeeds, it will exit with 0. Otherwise, if an error occurs,
200it will exit with a non-zero value.
John Criswell69d903d2003-09-12 15:46:24 +0000201
202<h3>
203SEE ALSO
204</h3>
Chris Lattner08a04fd2003-10-07 20:12:05 +0000205<a href="lli.html"><tt>lli</tt></a>
John Criswell69d903d2003-09-12 15:46:24 +0000206
207<HR>
Chris Lattner08a04fd2003-10-07 20:12:05 +0000208Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.
John Criswell69d903d2003-09-12 15:46:24 +0000209</body>
210</html>
211