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 filename is - or just... omitted entirely, llc reads 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 -o option is omitted, then llc sends its output to standard output β€” but only if the input is from standard input.
  • if the -o option specifies -, then the output will also be sent to standard output.
  • if no -o option is specified and an input file other than - is specified, then llc creates the output filename by taking the input filename, removing any existing .bc extension, and adding a .s suffix. 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 -M option of llvm-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 -O3 optimization levels used by clang. 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 of llc -help for 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 output llc should generated. options are: asm for textual assembly ('.s'), obj for native object files ('.o') and null for 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 loads dso_path (a path to a dynamically shared object) that implements an LLVM target. this will permit the target name to be used with the -march option so that code can be generated for that target.
  • -meabi=[default|gnu|4|5] β€” specifies which EABI version should conform to. valid EABI versions are gnu, 4 and 5. the default value (default) depends on the triple.
  • -stack-size-section β€” emits the .stack_sizes section 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 is local. 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 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.


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