LLC(1)
π LLC(1) β the LLVM static compiler, bestie edition β¨
okay so real talk, this is the manual page for llc, aka the LLVM static compiler β and yes she's part of the whole LLVM situation. grab a boba, we're doing this π§
πΈ NAME πΈ
llc β the LLVM static compiler. that's it, that's the vibe. π
π SYNOPSIS π
llc [options] [filename]
β¨ DESCRIPTION β¨
so what does llc actually do? literally this: it takes LLVM source inputs and compiles them into assembly language for whatever architecture you point it at. then you can take that assembly output, run it through a native assembler and a linker, and boom π₯ β you've got yourself a native executable. main character energy fr.
and how does it pick which architecture to spit out assembly for? it just... knows. it figures it out automatically from the input file β¨ unless you use the -march option to override the default, in which case you're the boss. π«Ά
π OPTIONS π
k so first, the input tea β: if filename is - or it's just straight-up omitted, llc reads from standard input. otherwise it reads from filename. and your inputs can be either the LLVM assembly language format (.ll) or the LLVM bitcode format (.bc). both slay.
now for output: if the -o option is omitted, then llc sends its output to standard output β but only if the input is from standard input, ok? and if -o specifies -, then the output also goes to standard output.
and if no -o option is specified and you gave an input file that isn't -, then llc comes up with the output filename itself by taking your input filename, removing any existing .bc extension, and adding a .s suffix. cute little naming convention, no notes. π
other llc options are down below π
π End-user Options π
-helpβ prints a summary of all the command line options. your little map πΊοΈ-o <filename>β use<filename>as the output filename. peep the summary above for the deets.-O=uintβ generates code at different optimization levels. these correspond exactly to 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 the string you give it. rude but effective.-march=<arch>β specifies the architecture to generate assembly for, overriding the target encoded in the input file. for a list of valid architectures, go look at the output ofllc -help. by default this gets inferred from the target triple, or autodetected to the current architecture. iykyk π¦-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 (this one's for performance testing). β οΈ note that not all targets support all options β so don't come for me if your target's picky.-mattr=a1,+a2,-a3,...β overrides or controls 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 (all,non-leaf,none). pick one π«‘--disable-excess-fp-precisionβ disables optimizations that may produce excess precision for floating point. but heads up bestie: this option can dramatically slow down code on some systems (e.g. X86). so, like, use with intention π--enable-no-infs-fp-mathβ enables optimizations that assume there are no Inf values. living dangerously β¨--enable-no-nans-fp-mathβ enables optimizations that assume there are no NAN values. bold.--enable-no-signed-zeros-fp-mathβ enables FP math optimizations that assume the sign of0is insignificant. zero? irrelevant.--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 unusable (such asfsinon X86). it's giving "i can fix him" but with floats π--statsβ prints statistics recorded by code-generation passes. numbers!! π--time-passesβ records the amount of time each pass takes and prints a report to standard error. clock it β±οΈ--load=<dso_path>β dynamically loadsdso_path(a path to a dynamically shared object) that implements an LLVM target. this lets you use that target name with the-marchoption so code can be generated for that target. plug in and slay π-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. it's giving "it depends" and honestly same.-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. sorry to those functions π-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. valid register allocators are:basicβ basic register allocator. does what it says on the tin.fastβ fast register allocator. it's the default for unoptimized code.greedyβ greedy register allocator. it's the default for optimized code. greedy but make it fashion πpbqpβ register allocator based on 'Partitioned Boolean Quadratic Programming'. say that five times fast π iconic name ngl
--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 aesthetic π
π₯ EXIT STATUS π₯
if llc succeeds, it exits with 0. π otherwise, if an error occurs, it exits with a non-zero value. π that's the whole thing, no hidden lore.
π SEE ALSO π
lli(1) β go say hi, she's right there π«Ά
π AUTHOR π
maintained by the LLVM Team (https://llvm.org/). absolute legends, no cap.
π COPYRIGHT π
2003-2023, LLVM Project
and that's the whole page bestie π this was page 15, dated 2023-01-14, and yeah β it's LLC(1) and she ate. periodt. πΈπ¦β¨
π¦ where this page comes from
- opensuse-leap 16.0: llvm15 15.0.7-160000.3.1 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- opensuse-leap 16.0: llvm15 15.0.7-160000.3.1 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- opensuse-leap 16.0: llvm15 15.0.7-160000.3.1 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- opensuse-leap 16.0: llvm15 15.0.7-160000.3.1 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms