1LLC(1) LLVM LLC(1)
2
3
4
6 llc - LLVM static compiler
7
9 llc [options] [filename]
10
12 The llc command compiles LLVM source inputs into assembly language for
13 a specified architecture. The assembly language output can then be
14 passed through a native assembler and linker to generate a native exe‐
15 cutable.
16
17 The choice of architecture for the output assembly code is automati‐
18 cally determined from the input file, unless the -march option is used
19 to override the default.
20
22 If filename is "-" or omitted, llc reads from standard input. Other‐
23 wise, it will from filename. Inputs can be in either the LLVM assembly
24 language format (.ll) or the LLVM bitcode format (.bc).
25
26 If the -o option is omitted, then llc will send its output to standard
27 output if the input is from standard input. If the -o option specifies
28 "-", then the output will also be sent to standard output.
29
30 If no -o option is specified and an input file other than "-" is speci‐
31 fied, then llc creates the output filename by taking the input file‐
32 name, removing any existing .bc extension, and adding a .s suffix.
33
34 Other llc options are described below.
35
36 End-user Options
37 -help Print a summary of command line options.
38
39 -o <filename>
40 Use <filename> as the output filename. See the summary above for
41 more details.
42
43 -O=uint
44 Generate code at different optimization levels. These corre‐
45 spond to the -O0, -O1, -O2, and -O3 optimization levels used by
46 clang.
47
48 -mtriple=<target triple>
49 Override the target triple specified in the input file with the
50 specified string.
51
52 -march=<arch>
53 Specify the architecture for which to generate assembly, over‐
54 riding the target encoded in the input file. See the output of
55 llc -help for a list of valid architectures. By default this is
56 inferred from the target triple or autodetected to the current
57 architecture.
58
59 -mcpu=<cpuname>
60 Specify a specific chip in the current architecture to generate
61 code for. By default this is inferred from the target triple
62 and autodetected to the current architecture. For a list of
63 available CPUs, use:
64
65 llvm-as < /dev/null | llc -march=xyz -mcpu=help
66
67 -filetype=<output file type>
68 Specify what kind of output llc should generated. Options are:
69 asm for textual assembly ( '.s'), obj for native object files
70 ('.o') and null for not emitting anything (for performance test‐
71 ing).
72
73 Note that not all targets support all options.
74
75 -mattr=a1,+a2,-a3,...
76 Override or control specific attributes of the target, such as
77 whether SIMD operations are enabled or not. The default set of
78 attributes is set by the current CPU. For a list of available
79 attributes, use:
80
81 llvm-as < /dev/null | llc -march=xyz -mattr=help
82
83 --frame-pointer
84 Specify effect of frame pointer elimination optimization
85 (all,non-leaf,none).
86
87 --disable-excess-fp-precision
88 Disable optimizations that may produce excess precision for
89 floating point. Note that this option can dramatically slow
90 down code on some systems (e.g. X86).
91
92 --enable-no-infs-fp-math
93 Enable optimizations that assume no Inf values.
94
95 --enable-no-nans-fp-math
96 Enable optimizations that assume no NAN values.
97
98 --enable-no-signed-zeros-fp-math
99 Enable FP math optimizations that assume the sign of 0 is in‐
100 significant.
101
102 --enable-no-trapping-fp-math
103 Enable setting the FP exceptions build attribute not to use ex‐
104 ceptions.
105
106 --enable-unsafe-fp-math
107 Enable optimizations that make unsafe assumptions about IEEE
108 math (e.g. that addition is associative) or may not work for all
109 input ranges. These optimizations allow the code generator to
110 make use of some instructions which would otherwise not be us‐
111 able (such as fsin on X86).
112
113 --stats
114 Print statistics recorded by code-generation passes.
115
116 --time-passes
117 Record the amount of time needed for each pass and print a re‐
118 port to standard error.
119
120 --load=<dso_path>
121 Dynamically load dso_path (a path to a dynamically shared ob‐
122 ject) that implements an LLVM target. This will permit the tar‐
123 get name to be used with the -march option so that code can be
124 generated for that target.
125
126 -meabi=[default|gnu|4|5]
127 Specify which EABI version should conform to. Valid EABI ver‐
128 sions are gnu, 4 and 5. Default value (default) depends on the
129 triple.
130
131 -stack-size-section
132 Emit the .stack_sizes section which contains stack size meta‐
133 data. The section contains an array of pairs of function symbol
134 values (pointer size) and stack sizes (unsigned LEB128). The
135 stack size values only include the space allocated in the func‐
136 tion prologue. Functions with dynamic stack allocations are not
137 included.
138
139 -remarks-section
140 Emit the __remarks (MachO) section which contains metadata about
141 remark diagnostics.
142
143 Tuning/Configuration Options
144 --print-after-isel
145 Print generated machine code after instruction selection (useful
146 for debugging).
147
148 --regalloc=<allocator>
149 Specify the register allocator to use. Valid register alloca‐
150 tors are:
151
152 basic
153 Basic register allocator.
154
155 fast
156 Fast register allocator. It is the default for unoptimized
157 code.
158
159 greedy
160 Greedy register allocator. It is the default for optimized
161 code.
162
163 pbqp
164 Register allocator based on 'Partitioned Boolean Quadratic
165 Programming'.
166
167 --spiller=<spiller>
168 Specify the spiller to use for register allocators that support
169 it. Currently this option is used only by the linear scan reg‐
170 ister allocator. The default spiller is local. Valid spillers
171 are:
172
173 simple
174 Simple spiller
175
176 local
177 Local spiller
178
179 Intel IA-32-specific Options
180 --x86-asm-syntax=[att|intel]
181 Specify whether to emit assembly code in AT&T syntax (the de‐
182 fault) or Intel syntax.
183
185 If llc succeeds, it will exit with 0. Otherwise, if an error occurs,
186 it will exit with a non-zero value.
187
189 lli(1)
190
192 Maintained by the LLVM Team (https://llvm.org/).
193
195 2003-2021, LLVM Project
196
197
198
199
20012 2021-07-22 LLC(1)