LLC(1)
π 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-Moption ofllvm-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-O3optimization levels used byclang. 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 ofllc -helpfor 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 outputllcshould generated. options are:asmfor textual assembly (.s),objfor native object files (.o) andnullfor 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 noInfvalues. β who? never met her π«--enable-no-nans-fp-mathβ enable optimizations that assume noNANvalues. not a number? not on our watch π«--enable-no-signed-zeros-fp-mathβ enable FP math optimizations that assume the sign of0is 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-marchoption 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 aregnu,4and5. default value (default) depends on the triple. π€-stack-size-sectionβ emit 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. 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 islocal. valid spillers are:simpleβ simple spillerlocalβ 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. π§‘
π COPYRIGHT π
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
- centos-stream 9: llvm 23.1.3-1.el9 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- centos-stream 9: llvm 23.1.3-1.el9 Β· 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