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-unsafe-fp-math
99 Enable optimizations that make unsafe assumptions about IEEE
100 math (e.g. that addition is associative) or may not work for all
101 input ranges. These optimizations allow the code generator to
102 make use of some instructions which would otherwise not be
103 usable (such as fsin on X86).
104
105 --stats
106 Print statistics recorded by code-generation passes.
107
108 --time-passes
109 Record the amount of time needed for each pass and print a
110 report to standard error.
111
112 --load=<dso_path>
113 Dynamically load dso_path (a path to a dynamically shared
114 object) that implements an LLVM target. This will permit the
115 target name to be used with the -march option so that code can
116 be generated for that target.
117
118 -meabi=[default|gnu|4|5]
119 Specify which EABI version should conform to. Valid EABI ver‐
120 sions are gnu, 4 and 5. Default value (default) depends on the
121 triple.
122
123 -stack-size-section
124 Emit the .stack_sizes section which contains stack size meta‐
125 data. The section contains an array of pairs of function symbol
126 values (pointer size) and stack sizes (unsigned LEB128). The
127 stack size values only include the space allocated in the func‐
128 tion prologue. Functions with dynamic stack allocations are not
129 included.
130
131 -remarks-section
132 Emit the .remarks (ELF) / __remarks (MachO) section which con‐
133 tains metadata about remark diagnostics.
134
135 Tuning/Configuration Options
136 --print-machineinstrs
137 Print generated machine code between compilation phases (useful
138 for debugging).
139
140 --regalloc=<allocator>
141 Specify the register allocator to use. Valid register alloca‐
142 tors are:
143
144 basic
145 Basic register allocator.
146
147 fast
148 Fast register allocator. It is the default for unoptimized
149 code.
150
151 greedy
152 Greedy register allocator. It is the default for optimized
153 code.
154
155 pbqp
156 Register allocator based on 'Partitioned Boolean Quadratic
157 Programming'.
158
159 --spiller=<spiller>
160 Specify the spiller to use for register allocators that support
161 it. Currently this option is used only by the linear scan reg‐
162 ister allocator. The default spiller is local. Valid spillers
163 are:
164
165 simple
166 Simple spiller
167
168 local
169 Local spiller
170
171 Intel IA-32-specific Options
172 --x86-asm-syntax=[att|intel]
173 Specify whether to emit assembly code in AT&T syntax (the
174 default) or Intel syntax.
175
177 If llc succeeds, it will exit with 0. Otherwise, if an error occurs,
178 it will exit with a non-zero value.
179
181 lli(1)
182
184 Maintained by the LLVM Team (https://llvm.org/).
185
187 2003-2019, LLVM Project
188
189
190
191
1929 2019-09-19 LLC(1)