aboutsummaryrefslogtreecommitdiffstats
path: root/docs/CommandGuide/llc.html
blob: 3a1efd1df114b2fcefdccdf009b2e40e1c971704 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<html>
<title>LLVM: llc tool</title>

<body bgcolor=white>

<center><h1>LLVM: <tt>llc</tt> tool</h1></center>
<HR>

<h3>NAME</h3>
<tt>llc</tt>

<h3>SYNOPSIS</h3>
<tt>llc [options] [filename]</tt>

<h3>DESCRIPTION</h3>

The <tt>llc</tt> command compiles LLVM bytecode into assembly language for a
specified architecture.  The assembly language output can then be passed through
a native assembler and linker to generate native code.
<p>
The choice of architecture for the output assembly code is determined as
follows:

<ul>
	<li>
	If the user has specified an architecture with the -m option, use that
	architecture.
	<p>

	<li>
	Examine the input LLVM bytecode file:
	<ul>
		<li>
		If it specifies little endian and a pointer size of 32 bits, select the
		x86 architecture.
		<p>
		
		<li>
		If it specifies big endian and a pointer size of 64 bit pointers,
		select the SparcV9 architecture.
	</ul>
	<p>

	<li>
	If <tt>llc</tt> was compiled on an architecture for which it can
	generate code, select the architecture upon which <tt>llc</tt> was
	compiled.
	<p>

	<li>
	Print a message to the user asking him or her to specify the output
	architecture explicitly.
</ul>

<p>

If filename is not specified, or if filename is -, <tt>llc</tt> reads its input
from standard input.  Otherwise, it will read its input from filename.
<p>

If the -o option is left unspecified, then <tt>llc</tt> will send its output to standard
output if the input is from standard input.  If the -o option specifies -, then
the output will also be sent to standard output.
<p>

If no -o option is specified and an input file other than - is specified, then
<tt>llc</tt> creates the output filename as follows:

<ul>
	<li>
	If the file ends in .bc, then the .bc suffix is removed, and the .s suffix
	is appended.
	<p>
	<li>
	Otherwise, the .s suffix is appended to the input filename.
</ul>

<h3>
OPTIONS
</h3>
<ul>
	<li>-f                   
	<br>
	Overwrite output files
	<p>

	<li>-m&lt;arch&gt;
	<br>
	Specify the architecture for which to generate assembly.  Valid
	architectures are:

	<dl compact>
		<dt> x86 </dt>
		<dd>IA-32 (Pentium and above)</dd>

		<dt> sparcv9 </dt>
		<dd>SPARC V9</dd>

		<dt> c </dt>
		<dd>Emit C code</dd>
	</dl>
	<p>

	<li>-o &lt;filename&gt;
	<br>
	Specify the output filename.
	<p>

	<li>-enable-correct-eh-support
	<br>
	Instruct the -lowerinvoke pass to insert code for correct exception handling
  support.  This is expensive and is by default omitted for efficiency.
	<p>

	<li> -help
	<br>
	Print a summary of command line options.
	<p>

	<li> -stats
	<br>
	Print statistics.
	<p>

	<li> -time-passes
	<br>
	Record the amount of time needed for each pass and print it to standard
	error.
	<p>

</ul>
<h4>X86 Specific Options</h4>
<ul>
	<li>-disable-fp-elim
	<br>
	Disable frame pointer elimination optimization.
	<p>

	<li>-disable-pattern-isel
	<br>
	Use the 'simple' X86 instruction selector (the default).
	<p>

	<li>-print-machineinstrs
	<br>
	Print generated machine code.
	<p>

	<li>-regalloc=&lt;ra&gt;
	<br>
        Specify the register allocator to use. The default is <i>local</i>.
        Valid register allocators are:
        <p>
	<dl compact>
		<dt> simple </dt>
		<dd>Very simple register allocator</dd>

		<dt> local </dt>
		<dd>Local register allocator</dd>

		<dt> linearscan </dt>
		<dd>Linear scan global register allocator (experimental)</dd>
        </dl>

	<li>-spiller=&lt;sp&gt;
	<br>
        Specify the spiller to use for register allocators that support it.
        Currently this option is used by the linear scan register
        allocator. The default is <i>local</i>.
        Valid spillers are:
        <p>
	<dl compact>
		<dt> simple </dt>
		<dd>Simple spiller</dd>

		<dt> local </dt>
		<dd>Local spiller</dd>
	</dl>

</ul>

<h4>Sparc Specific Options</h4>
<ul>
	<li>-disable-peephole
	<br>
	Disable peephole optimization pass.
	<p>

	<li>-disable-sched
	<br>
	Disable local scheduling pass.
	<p>

	<li>-disable-strip
	<br>
	Do not strip the LLVM bytecode included in executable.
	<p>

	<li>-enable-maps
	<br>
	Emit LLVM-to-MachineCode mapping info to assembly.
	<p>
</ul>


<h3>EXIT STATUS</h3>

If <tt>llc</tt> succeeds, it will exit with 0.  Otherwise, if an error occurs,
it will exit with a non-zero value.

<h3>
SEE ALSO
</h3>
<a href="lli.html"><tt>lli</tt></a>

<HR>
Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.
</body>
</html>