1 llc - LLVM static compiler
2 ==========================
9 **llc** [*options*] [*filename*]
16 The **llc** command compiles LLVM source inputs into assembly language for a
17 specified architecture. The assembly language output can then be passed through
18 a native assembler and linker to generate a native executable.
20 The choice of architecture for the output assembly code is automatically
21 determined from the input file, unless the **-march** option is used to override
29 If *filename* is - or omitted, **llc** reads from standard input. Otherwise, it
30 will from *filename*. Inputs can be in either the LLVM assembly language
31 format (.ll) or the LLVM bitcode format (.bc).
33 If the **-o** option is omitted, then **llc** will send its output to standard
34 output if the input is from standard input. If the **-o** option specifies -,
35 then the output will also be sent to standard output.
37 If no **-o** option is specified and an input file other than - is specified,
38 then **llc** creates the output filename by taking the input filename,
39 removing any existing *.bc* extension, and adding a *.s* suffix.
41 Other **llc** options are as follows:
50 Print a summary of command line options.
56 Generate code at different optimization levels. These correspond to the *-O0*,
57 *-O1*, *-O2*, and *-O3* optimization levels used by **llvm-gcc** and
62 **-mtriple**\ =\ *target triple*
64 Override the target triple specified in the input file with the specified
71 Specify the architecture for which to generate assembly, overriding the target
72 encoded in the input file. See the output of **llc -help** for a list of
73 valid architectures. By default this is inferred from the target triple or
74 autodetected to the current architecture.
78 **-mcpu**\ =\ *cpuname*
80 Specify a specific chip in the current architecture to generate code for.
81 By default this is inferred from the target triple and autodetected to
82 the current architecture. For a list of available CPUs, use:
83 **llvm-as < /dev/null | llc -march=xyz -mcpu=help**
87 **-mattr**\ =\ *a1,+a2,-a3,...*
89 Override or control specific attributes of the target, such as whether SIMD
90 operations are enabled or not. The default set of attributes is set by the
91 current CPU. For a list of available attributes, use:
92 **llvm-as < /dev/null | llc -march=xyz -mattr=help**
98 Disable frame pointer elimination optimization.
102 **--disable-excess-fp-precision**
104 Disable optimizations that may produce excess precision for floating point.
105 Note that this option can dramatically slow down code on some systems
110 **--enable-no-infs-fp-math**
112 Enable optimizations that assume no Inf values.
116 **--enable-no-nans-fp-math**
118 Enable optimizations that assume no NAN values.
122 **--enable-unsafe-fp-math**
124 Enable optimizations that make unsafe assumptions about IEEE math (e.g. that
125 addition is associative) or may not work for all input ranges. These
126 optimizations allow the code generator to make use of some instructions which
127 would otherwise not be usable (such as fsin on X86).
131 **--enable-correct-eh-support**
133 Instruct the **lowerinvoke** pass to insert code for correct exception handling
134 support. This is expensive and is by default omitted for efficiency.
140 Print statistics recorded by code-generation passes.
146 Record the amount of time needed for each pass and print a report to standard
151 **--load**\ =\ *dso_path*
153 Dynamically load *dso_path* (a path to a dynamically shared object) that
154 implements an LLVM target. This will permit the target name to be used with the
155 **-march** option so that code can be generated for that target.
160 Tuning/Configuration Options
161 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
165 **--print-machineinstrs**
167 Print generated machine code between compilation phases (useful for debugging).
171 **--regalloc**\ =\ *allocator*
173 Specify the register allocator to use. The default *allocator* is *local*.
174 Valid register allocators are:
179 Very simple "always spill" register allocator
185 Local register allocator
191 Linear scan global register allocator
197 Iterative scan global register allocator
203 **--spiller**\ =\ *spiller*
205 Specify the spiller to use for register allocators that support it. Currently
206 this option is used only by the linear scan register allocator. The default
207 *spiller* is *local*. Valid spillers are:
225 Intel IA-32-specific Options
226 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
230 **--x86-asm-syntax=att|intel**
232 Specify whether to emit assembly code in AT&T syntax (the default) or intel
243 If **llc** succeeds, it will exit with 0. Otherwise, if an error occurs,
244 it will exit with a non-zero value.