LLC(1)

πŸ“¦ version 23.1.3, in centos-stream 9

πŸ’… LLC(1) β€” the LLVM static compiler, bestie edition ✨

okay so welcome to llc, aka the LLVM static compiler β€” it lives in the LLVM family and it's genuinely that girl. let's get into it πŸŽ€

✨ NAME ✨

llc β€” the LLVM static compiler. that's the whole name. periodt. πŸ‘‘

🌸 SYNOPSIS 🌸

llc [options] [filename]

πŸ¦‹ DESCRIPTION πŸ¦‹

so what does llc do? bestie. it takes your LLVM source inputs and compiles them into assembly language for a specified architecture. that's the vibe. and then that assembly output can go through a native assembler and linker to make a native executable. iconic pipeline behavior πŸ’–

and which architecture does it pick? 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. main character energy from the input file, honestly. 🫢

πŸ”₯ OPTIONS πŸ”₯

first, the input tea: if filename is - or omitted, llc reads from standard input. otherwise it reads from filename. and your inputs can be in either the LLVM assembly language format (.ll) or the LLVM bitcode format (.bc). both slay. πŸ’œ

now the output tea: if the -o option is omitted, then llc sends its output to standard output if the input is from standard input. and if -o specifies -, then the output also goes to standard output. same energy. ✨

and 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. it's giving "i'll name it myself, don't worry." πŸ’…

other llc options are described below πŸ‘‡

πŸŽ€ End-user Options πŸŽ€

  • -help β€” print a summary of command line options. the classic "what are my choices" moment πŸ’«
  • -M β€” pass target-specific InstPrinter options. refer to the -M option of llvm-objdump(1). iykyk 🧚
  • -o <filename> β€” use <filename> as the output filename. see the summary above for more details. πŸ‘†
  • -O=uint β€” generate 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> β€” override the target triple specified in the input file with the specified string. respectfully, we're ignoring the input file's opinion now πŸ™ˆ
  • -march=<arch> β€” specify 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> β€” specify 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
  • -mtune=<cpuname> β€” specify a specific chip microarchitecture in the current architecture to tune code for. by default this is inferred from the target triple and autodetected to the current architecture. for a list of available tuning CPUs, use:
llvm-as < /dev/null | llc -march=xyz -mtune=help
  • -filetype=<output file type> β€” specify 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). vibe check: not all targets support all options. πŸ’€
  • -mattr=a1,+a2,-a3,... β€” override or control 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 β€” specify effect of frame pointer elimination optimization (all,non-leaf,none). 🦴
  • --disable-excess-fp-precision β€” disable optimizations that may produce excess precision for floating point. note that this option can dramatically slow down code on some systems (e.g. X86). like, actually. be aware 😭
  • --enable-no-infs-fp-math β€” enable optimizations that assume no Inf values. ∞ who? never met her 🚫
  • --enable-no-nans-fp-math β€” enable optimizations that assume no NAN values. not a number? not on our watch 🚫
  • --enable-no-signed-zeros-fp-math β€” enable FP math optimizations that assume the sign of 0 is insignificant. zero is zero, bestie, don't overthink it ✨
  • --enable-no-trapping-fp-math β€” enable setting the FP exceptions build attribute not to use exceptions. πŸ™…β€β™€οΈ
  • --stats β€” print statistics recorded by code-generation passes. numbers!! we love data πŸ“Š
  • --save-stats, --save-stats=cwd, --save-stats=obj β€” save 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. save it for later πŸ’Ύ
  • --time-passes β€” record the amount of time needed for each pass and print a report to standard error. time is a construct but we're measuring it anyway ⏱️
  • --load=<dso_path> β€” dynamically load 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. plug it in, turn it on πŸ”Œ
  • -meabi=[default|gnu|4|5] β€” specify which EABI version should conform to. valid EABI versions are gnu, 4 and 5. default value (default) depends on the triple. 🀝
  • -stack-size-section β€” emit 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. read that twice, it matters πŸ‘€
  • -remarks-section β€” emit the __remarks (MachO) section which contains metadata about remark diagnostics. πŸ“

🌈 Tuning/Configuration Options 🌈

  • --print-after-isel β€” print generated machine code after instruction selection (useful for debugging). peek behind the curtain, it's giving backstage pass 🎟️
  • --regalloc=<allocator> β€” specify 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'. (yes that's the whole name, she's fancy like that πŸ‘‘)
  • --spiller=<spiller> β€” specify 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] β€” specify whether to emit assembly code in AT&T syntax (the default) or Intel syntax. choose your aesthetic πŸ’…

⭐ EXIT STATUS ⭐

if llc succeeds, it will exit with 0. otherwise, if an error occurs, it will exit with a non-zero value. success gets a gold star, failure gets a sad little number 🌟

πŸ“ SEE ALSO πŸ“

(go say hi to her, she's the interpreter bestie 🫢)

πŸ’– AUTHOR πŸ’–

maintained by the LLVM Team (https://llvm.org/). they're the blueprint, honestly. 🧑

2003-2026, LLVM Project


and that's the whole page, bestie β€” no cap, every flag intact πŸ¦‹ this was LLC(1) from the LLVM fam, version/date situation: page 23, dated 2026-10-06. mwah πŸ’‹ slay responsibly ✨

πŸ“¦ where this page comes from