PreSelection isn't optional and so there's no way to turn it off.
[oota-llvm.git] / docs / CommandGuide / llc.html
1 <html>
2 <title>LLVM: llc tool</title>
3
4 <body bgcolor=white>
5
6 <center><h1>LLVM: <tt>llc</tt> tool</h1></center>
7 <HR>
8
9 <h3>NAME</h3>
10 <tt>llc</tt>
11
12 <h3>SYNOPSIS</h3>
13 <tt>llc [options] [filename]</tt>
14
15 <h3>DESCRIPTION</h3>
16
17 The <tt>llc</tt> command compiles LLVM bytecode into assembly language for a
18 specified architecture.  The assembly language output can then be passed through
19 a native assembler and linker to generate native code.
20 <p>
21 The choice of architecture for the output assembly code is determined as
22 follows:
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>
45         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.
48         <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
57 If filename is not specified, or if filename is -, <tt>llc</tt> reads its input
58 from standard input.  Otherwise, it will read its input from filename.
59 <p>
60
61 If the -o option is left unspecified, then <tt>llc</tt> will send its output to standard
62 output if the input is from standard input.  If the -o option specifies -, then
63 the output will also be sent to standard output.
64 <p>
65
66 If no -o option is specified and an input file other than - is specified, then
67 <tt>llc</tt> creates the output filename as follows:
68
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>
77
78 <h3>
79 OPTIONS
80 </h3>
81 <ul>
82         <li>-f                   
83         <br>
84         Overwrite output files
85         <p>
86
87         <li>-m&lt;arch&gt;
88         <br>
89         Specify the architecture for which to generate assembly.  Valid
90         architectures are:
91
92         <dl compact>
93                 <di> x86
94                 <dd>IA-32 (Pentium and above)</dd>
95
96                 <di> sparc
97                 <dd>SPARC V9</dd>
98         </dl>
99         <p>
100
101         <li>-o &lt;filename&gt;
102         <br>
103         Specify the output filename.
104         <p>
105
106         <li> -help
107         <br>
108         Print a summary of command line options.
109         <p>
110
111         <li> -stats
112         <br>
113         Print statistics.
114         <p>
115
116         <li> -time-passes
117         <br>
118         Record the amount of time needed for each pass and print it to standard
119         error.
120         <p>
121
122 </ul>
123 <h4>X86 Specific Options</h4>
124 <ul>
125         <li>-disable-fp-elim
126         <br>
127         Disable frame pointer elimination optimization.
128         <p>
129
130         <li>-disable-pattern-isel
131         <br>
132         Use the 'simple' X86 instruction selector (the default).
133         <p>
134
135         <li>-print-machineinstrs
136         <br>
137         Print generated machine code.
138         <p>
139
140         <li>-regalloc=&lt;ra&gt;
141         <br>
142         Specify the register allocator to use. The default is <i>simple</i>.
143         Valid register allocators are:
144         <dl compact>
145                 <di> simple
146                 <dd>Very simple register allocator</dd>
147
148                 <di> local
149                 <dd>Local register allocator</dd>
150         </dl>
151         <p>
152
153 </ul>
154
155 <h4>Sparc Specific Options</h4>
156 <ul>
157         <li>-disable-peephole
158         <br>
159         Disable peephole optimization pass.
160         <p>
161
162         <li>-disable-sched
163         <br>
164         Disable local scheduling pass.
165         <p>
166
167         <li>-disable-strip
168         <br>
169         Do not strip the LLVM bytecode included in executable.
170         <p>
171
172         <li>-enable-maps
173         <br>
174         Emit LLVM-to-MachineCode mapping info to assembly.
175         <p>
176 </ul>
177
178
179 <h3>EXIT STATUS</h3>
180
181 If <tt>llc</tt> succeeds, it will exit with 0.  Otherwise, if an error occurs,
182 it will exit with a non-zero value.
183
184 <h3>
185 SEE ALSO
186 </h3>
187 <a href="lli.html"><tt>lli</tt></a>
188
189 <HR>
190 Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.
191 </body>
192 </html>
193