LLC(1)
π LLC(1) β the LLVM static compiler, bestie edition π
okay so welcome to llc, aka the LLVM static compiler, living in section 1 of your man pages (that's the "user commands" section, iykyk). this is the girl that takes your LLVM source and turns it into assembly. she's iconic, she's fast, she's literally the moment. let's get into it β¨
π SYNOPSIS π
llc [options] [filename]
that's it. that's the whole vibe. options and maybe a filename. slay.
πΈ DESCRIPTION πΈ
so the llc command compiles LLVM source inputs into assembly language for a specified architecture. then you take that assembly output and pass it through a native assembler and linker to generate a native executable. pipeline queen π
the choice of architecture for the output assembly code is automatically determined from the input file β unless you use the -march option to override the default. she'll figure it out herself, but you can tell her what to do. main character energy either way π
β¨ OPTIONS β¨
okay bestie, ground rules first π«Ά
- if
filenameis-or just... omitted entirely,llcreads from standard input. - otherwise, it reads from
filename. - inputs can be in either the LLVM assembly language format (
.ll) or the LLVM bitcode format (.bc). both are valid, both are welcome π
now, about where the output goes:
- if the
-ooption is omitted, thenllcsends its output to standard output β but only if the input is from standard input. - if the
-ooption specifies-, then the output will also be sent to standard output. - if no
-ooption is specified and an input file other than-is specified, thenllccreates the output filename by taking the input filename, removing any existing.bcextension, and adding a.ssuffix. she's doing the naming for you, you're welcome π
other llc options are described below. yes, all of them. we're going through every single one, no skipping, periodt.
π¦ End-user Options π¦
-helpβ prints a summary of command line options. your little map when you're lost πΊοΈ-Mβ passes target-specific InstPrinter options. go refer to the-Moption ofllvm-objdump(1) <llvm-objdump.html>for the deets.-o <filename>β use<filename>as the output filename. see the summary above for more details. β¬οΈ-O=uintβ generates code at different optimization levels. these correspond to the-O0,-O1,-O2, and-O3optimization levels used byclang. pick your fighter πͺ-mtriple=<target triple>β overrides the target triple specified in the input file with the specified string.-march=<arch>β specifies the architecture for which to generate assembly, overriding the target encoded in the input file. see the output ofllc -helpfor a list of valid architectures. by default this is inferred from the target triple or autodetected to the current architecture.-mcpu=<cpuname>β specifies a specific chip in the current architecture to generate code for. by default this is inferred from the target triple and autodetected to the current architecture. for a list of available CPUs, use:
llvm-as < /dev/null | llc -march=xyz -mcpu=help
-filetype=<output file type>β specifies what kind of outputllcshould generated. options are:asmfor textual assembly ('.s'),objfor native object files ('.o') andnullfor not emitting anything (for performance testing).
heads up bestie: not all targets support all options. π
-mattr=a1,+a2,-a3,...β overrides or controls specific attributes of the target, such as whether SIMD operations are enabled or not. the default set of attributes is set by the current CPU. for a list of available attributes, use:
llvm-as < /dev/null | llc -march=xyz -mattr=help
--frame-pointerβ specifies effect of frame pointer elimination optimization (all,non-leaf,none).--disable-excess-fp-precisionβ disables optimizations that may produce excess precision for floating point.
ngl, this option can dramatically slow down code on some systems (e.g. X86). be careful, bestie π
--enable-no-infs-fp-mathβ enables optimizations that assume no Inf values.--enable-no-nans-fp-mathβ enables optimizations that assume no NAN values.--enable-no-signed-zeros-fp-mathβ enables FP math optimizations that assume the sign of 0 is insignificant.--enable-no-trapping-fp-mathβ enables setting the FP exceptions build attribute not to use exceptions.--statsβ prints statistics recorded by code-generation passes. numbers!! π--save-stats,--save-stats=cwd,--save-stats=objβ saves LLVM statistics to a file in the current directory (--save-stats/--save-stats=cwd) or the directory of the output file (--save-stats=obj) in JSON format. very demure, very JSON π--time-passesβ records the amount of time needed for each pass and prints a report to standard error. β±οΈ--load=<dso_path>β dynamically loadsdso_path(a path to a dynamically shared object) that implements an LLVM target. this will permit the target name to be used with the-marchoption so that code can be generated for that target.-meabi=[default|gnu|4|5]β specifies which EABI version should conform to. valid EABI versions aregnu,4and5. the default value (default) depends on the triple.-stack-size-sectionβ emits the.stack_sizessection which contains stack size metadata. the section contains an array of pairs of function symbol values (pointer size) and stack sizes (unsigned LEB128). the stack size values only include the space allocated in the function prologue. functions with dynamic stack allocations are not included. π«-remarks-sectionβ emits the__remarks(MachO) section which contains metadata about remark diagnostics.
π Tuning/Configuration Options π
--print-after-iselβ prints generated machine code after instruction selection (useful for debugging). peek behind the curtain π--regalloc=<allocator>β specifies the register allocator to use. valid register allocators are:basicβ basic register allocator.fastβ fast register allocator. it is the default for unoptimized code.greedyβ greedy register allocator. it is the default for optimized code.pbqpβ register allocator based on 'Partitioned Boolean Quadratic Programming'.
--spiller=<spiller>β specifies the spiller to use for register allocators that support it. currently this option is used only by the linear scan register allocator. the default spiller islocal. valid spillers are:simpleβ simple spillerlocalβ local spiller
π§ Intel IA-32-specific Options π§
--x86-asm-syntax=[att|intel]β specifies whether to emit assembly code in AT&T syntax (the default) or Intel syntax. choose your flavor, both are cute π
β EXIT STATUS β
if llc succeeds, it will exit with 0. otherwise, if an error occurs, it will exit with a non-zero value. she'll tell you how it went, no cap π
π₯ SEE ALSO π₯
lli(1) <lli.html>
π Author π
maintained by the LLVM Team (https://llvm.org/). absolute icons, fr fr.
π Copyright π
2003-2026, LLVM Project
and that's the whole page bestie!! this was LLC(1) from the LLVM manual collection, and it was last touched on 2026-07-16 (page 22 of that section, if you're keeping receipts). now go compile something and slay π β¨π¦
π¦ where this page comes from
- fedora 44: llvm 22.1.8-4.fc44 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- fedora 44: llvm 22.1.8-4.fc44 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms