LinuxCommandLibrary

llc

compiles LLVM intermediate representation to machine code

TLDR

Compile LLVM IR to assembly

$ llc [input.ll]
copy
Output to file
$ llc -o [output.s] [input.ll]
copy
Compile to object file
$ llc -filetype=obj [input.ll]
copy
Target specific architecture
$ llc -march=[x86-64] [input.ll]
copy
Optimization level
$ llc -O[2] [input.ll]
copy
List targets
$ llc --version
copy

SYNOPSIS

llc [options] file

DESCRIPTION

llc is the LLVM static compiler that translates LLVM intermediate representation (IR) into native machine code. It accepts input in either LLVM bitcode (.bc) or human-readable LLVM assembly (.ll) format and produces target-specific assembly language or object files. As the backend stage of the LLVM compilation pipeline, llc performs instruction selection, register allocation, and machine-specific optimizations to generate efficient code for the target architecture.
The tool supports a wide range of target architectures including x86, ARM, AArch64, MIPS, RISC-V, and others, selectable via the `-march` and `-mtriple` flags. Optimization levels from `-O0` (no optimization) through `-O3` (aggressive optimization) control how much effort llc spends on code improvement during compilation. Output can be either textual assembly (default) or a relocatable object file when using `-filetype=obj`, making llc useful both for inspecting generated code and for producing linkable artifacts directly.

PARAMETERS

FILE

LLVM bitcode or IR file.
-o FILE
Output file name.
-filetype TYPE
Output type (asm, obj, null).
-march ARCH
Target architecture.
-O LEVEL
Optimization level (0-3).
-mtriple TRIPLE
Target triple.
--help
Display help information.

CAVEATS

Requires LLVM IR input. Target support varies. Part of LLVM toolchain.

HISTORY

llc is part of the LLVM compiler infrastructure project, providing the backend compilation step.

SEE ALSO

clang(1), opt(1), lli(1), llvm-as(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community