LLC(1)
π llc β the LLVM static compiler, bestie edition
okay so real talk: llc is the LLVM static compiler and she is, like, the main character of getting your code from LLVM-land into actual assembly. no cap. π
β¨ SYNOPSIS β¨
llc [options] [filename]
πΈ DESCRIPTION πΈ
so here's the vibe π β llc takes your LLVM source inputs and compiles them into assembly language for whatever architecture you point it at. then you can take that assembly, run it through a native assembler and linker, and boom π«Ά you got yourself a native executable. iconic behavior honestly.
and like, which architecture does it pick? it automatically figures that out from your input file β unless you use the -march option to override the default. she's smart but she also listens to you, yk? β
π OPTIONS π
so first, the file reading situation π§ β if filename is - or just... omitted entirely, llc reads from standard input. otherwise it reads from filename. and your inputs can be in either LLVM assembly language format (.ll) or LLVM bitcode format (.bc). both slay. π
then, the output situation β if you omit the -o option, llc sends its output to standard output if the input is from standard input. and if -o specifies -, the output also goes to standard output. same energy. β¨
but if there's no -o option and your input file is something other than -, then llc invents the output filename for you: it takes the input filename, strips any existing .bc extension, and slaps on a .s suffix. she's so thoughtful π
the rest of the llc options are down below, let's gooo π
π¦ End-user Options π¦
-helpβ prints a summary of all the command line options. your little map. πΊοΈ-Mβ passes through target-specific InstPrinter options. just go look at the-Moption ofllvm-objdump(1) <llvm-objdump.html>for the deets.-o <filename>β uses<filename>as your output filename. see the summary up above for the whole story. π-O=uintβ generates code at different optimization levels. these line up with the-O0,-O1,-O2, and-O3optimization levels that clang uses. pick your fighter β¨-mtriple=<target triple>β overrides the target triple that's specified in the input file with whatever string you hand her. π―-march=<arch>β specifies the architecture to generate assembly for, overriding the target encoded in the input file. wanna see the valid architectures? runllc -helpand look at the output. by default this gets inferred from the target triple, or autodetected to the current architecture. no manual labour required π-mcpu=<cpuname>β specifies a specific chip in the current architecture to generate code for. by default it's 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 generate. the options are:asmfor textual assembly ('.s'),objfor native object files ('.o'), andnullfor not emitting anything at all (for performance testing β yes, the void, she contains multitudes π).
heads up bestie: not all targets support all options. π«Ά
-mattr=a1,+a2,-a3,...β override or control specific attributes of the target, like 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 the effect of the frame pointer elimination optimization. values areall,non-leaf,none. π--disable-excess-fp-precisionβ disables optimizations that may produce excess precision for floating point.
β οΈ but like, seriously β this option can dramatically slow down code on some systems (e.g. X86). she's giving "worth it for correctness, tragic for speed" energy.
--enable-no-infs-fp-mathβ enables optimizations that assume there are no Inf values. π--enable-no-nans-fp-mathβ enables optimizations that assume there are no NAN values. π--enable-no-signed-zeros-fp-mathβ enables FP math optimizations that assume the sign of0is insignificant. (she said what she said about negative zero π )--enable-no-trapping-fp-mathβ enables setting the FP exceptions build attribute to not use exceptions.--enable-unsafe-fp-mathβ enables optimizations that make unsafe assumptions about IEEE math (e.g. that addition is associative) or that may not work for all input ranges.
π¨ these optimizations let the code generator use some instructions that would otherwise be off-limits (such as fsin on X86). "unsafe" is right there in the name, bestie, i'm just saying π
--statsβ prints stats recorded by code-generation passes. numbers go brrr π--time-passesβ records how much time each pass needs 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 lets that target name be used with the-marchoption so you can generate code for it. plug-in energy π-meabi=[default|gnu|4|5]β specifies which EABI version to 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 holds an array of pairs of function symbol values (pointer size) and stack sizes (unsigned LEB128). these 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 the generated machine code after instruction selection. super useful for debugging. π--regalloc=<allocator>β specifies the register allocator to use. the valid register allocators are:basicβ basic register allocator.fastβ fast register allocator. it's the default for unoptimized code. β‘greedyβ greedy register allocator. it's the default for optimized code. πpbqpβ register allocator based on 'Partitioned Boolean Quadratic Programming'. (yes that's the whole name, she's fancy like that π©)
--spiller=<spiller>β specifies the spiller to use for register allocators that support it. currently this option is only used by the linear scan register allocator. the default spiller islocal. valid spillers are:simpleβ simple spiller.localβ 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 aesthetic π
β EXIT STATUS β
if llc succeeds, she exits with 0 π otherwise, if an error happens, she exits with a non-zero value π (as she should, honestly).
πΈ SEE ALSO πΈ
lli(1) <lli.html> β go say hi π«Ά
π Author π
maintained by the LLVM Team (https://llvm.org/). love them for me π
π Copyright π
2003-2026, LLVM Project β protect her at all costs.
so yeah, that's the whole page babes β this was LLC(1), version 21, dated 2026-05-15, and honestly? she ate. go compile something iconic π
β¨πΈ
π¦ where this page comes from
- fedora 44: llvm21 21.1.8-5.fc44 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- fedora 44: llvm21 21.1.8-5.fc44 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms