LLVM IR
The intermediate language of the LLVM compilers (clang, rustc, swiftc and others); optimizations and code generation happen here.
What do you want to prove about your LLVM IR code?
Where proofs can attach
Toolchains that verify LLVM IR directly, and those that verify what it compiles to. A proof about compiled code also relies on the compiler that produced it.
- Compiled from Languages that compile to LLVM IRF* (Low*) verification language
- to C via KaRaMeL trusted
- to LLVM IR via clang trusted
- This IRLLVM IR
- Intermediate code Proofs here are about the code the compiler produced
- Machine code Proofs here are about the binary itself
Verify LLVM IR directly
Ranked by stage, feature coverage and trust.
| Toolchain | Stage | Trust | Effort | Feature coverage |
|---|---|---|---|---|
| Alive2 Automatically checks that an optimized LLVM IR function still behaves like the original, or shows a counterexample. Loops are checked only up to a set bound. | Stage 1 · Usable | 1/5 | Push-button | 2/14full, 11 partial |
Verify the compiled code
These prove facts about what the compiler produced, not about your source.
| Toolchain | Stage | Trust | Effort | Path |
|---|---|---|---|---|
| s2n-bignum Prove hand-written x86-64 or Arm64 assembly correct in HOL Light, on the exact bytes of the built object file; used for AWS's cryptography code. | Stage 1 · Usable | 4/5 | Interactive | x86-64 (LLVM backend (llc), trusted) |
| Islaris Prove Arm or RISC-V machine code correct in Rocq, against the full official Sail ISA models, using Isla symbolic execution and an Iris separation logic. | Stage 0 · Research | 2/5 | Interactive | AArch64 (LLVM backend (llc), trusted) |
| LNSym Prove Armv8 (AArch64) machine code correct in Lean 4 by symbolic simulation over a hand-written model; aimed at AWS-LC cryptographic routines. | Stage 0 · Research | 2/5 | Interactive | AArch64 (LLVM backend (llc), trusted) |
Feature coverage
Which language features each toolchain handles. Hover or focus a mark for the note and source. Toolchains on compiled code are shown for common features only.
| Feature | Alive2 | s2n-bignum via x86-64 | Islaris via AArch64 | LNSym via AArch64 |
|---|---|---|---|---|
| Common features | ||||
| Machine integersFixed-width integer arithmetic, overflow and bit operations. | Alive2, Machine integers: Supported.Integers are encoded as SMT bit-vectors, including the nsw/nuw overflow flags. Source | s2n-bignum, Machine integers: Unknown. | Islaris, Machine integers: Unknown. | LNSym, Machine integers: Unknown. |
| Floating pointIEEE 754 floating-point arithmetic, including rounding and NaNs. | Alive2, Floating point: Partial.IEEE-754 operations map to SMT floating-point theory (half, bfloat, float, double, fp128). Not supported: x86 80-bit and PowerPC double-double types. The 2021 paper notes that LLVM's frem rounds differently from SMT's remainder. Source | s2n-bignum, Floating point: Unknown. | Islaris, Floating point: Unknown. | LNSym, Floating point: Unknown. |
| Heap and pointersDynamically allocated memory, pointers or references, and aliasing. | Alive2, Heap and pointers: Partial.Byte-level memory model with blocks and pointer provenance (CAV 2021 encoding). The 2021 paper's stated limitation: it assumes calls do not modify local variables whose address has escaped. Volatile and atomic accesses are unsupported. Source | s2n-bignum, Heap and pointers: Unknown. | Islaris, Heap and pointers: Unknown. | LNSym, Heap and pointers: Unknown. |
| Arrays and buffersIndexed memory such as arrays, slices, vectors and byte buffers. | Alive2, Arrays and buffers: Supported.Memory blocks are modeled as SMT arrays of bytes, so arrays and buffers are supported. Source | s2n-bignum, Arrays and buffers: Unknown. | Islaris, Arrays and buffers: Unknown. | LNSym, Arrays and buffers: Unknown. |
| LoopsUnbounded loops, which need invariants or bounds to verify. | Alive2, Loops: Partial.Loops are unrolled up to a bound (-src-unroll and -tgt-unroll). The default bound is 0: any jump back to an already visited block is cut, so only paths that never repeat a loop body are compared. Bugs that need more iterations are missed. Source | s2n-bignum, Loops: Unknown. | Islaris, Loops: Unknown. | LNSym, Loops: Unknown. |
| RecursionFunctions that call themselves, directly or through others. | Alive2, Recursion: Partial.Each function is checked on its own, and calls (recursive or not) are treated as calls to an unknown function. Transformations that change behavior across function boundaries are not supported. Source | s2n-bignum, Recursion: Unknown. | Islaris, Recursion: Unknown. | LNSym, Recursion: Unknown. |
| Higher-order codeFunction pointers, closures and callbacks. | Alive2, Higher-order code: Partial.Current code translates indirect calls through function pointers as calls to unknown functions. The 2021 paper still listed function pointers as unsupported. No source found on how precisely the target function is tracked. Source | s2n-bignum, Higher-order code: Unknown. | Islaris, Higher-order code: Unknown. | LNSym, Higher-order code: Unknown. |
| Threads and shared memoryConcurrent threads with locks, atomics or message passing. | Alive2, Threads and shared memory: Not supported.Atomic instructions and fences are rejected as unsupported. Source | s2n-bignum, Threads and shared memory: Unknown. | Islaris, Threads and shared memory: Unknown. | LNSym, Threads and shared memory: Unknown. |
| I/O and system callsFiles, network, system calls and foreign-function calls. | Alive2, I/O and system calls: Partial.External calls are modeled as unknown functions that may change any memory. The 2021 paper names missing semantics for some string and I/O library functions as a common reason functions were skipped. Source | s2n-bignum, I/O and system calls: Unknown. | Islaris, I/O and system calls: Unknown. | LNSym, I/O and system calls: Unknown. |
| Standard librarySpecifications or models for the language's standard library. | Alive2, Standard library: Partial.As of the 2021 paper, 117 C library functions had special semantics, some only partly. Others are treated as unknown calls. Source | s2n-bignum, Standard library: Unknown. | Islaris, Standard library: Unknown. | LNSym, Standard library: Unknown. |
| LLVM IR-specific features | ||||
| undef and poisonLLVM's deferred undefined behavior values. | Alive2, undef and poison: Partial.Poison and undef are both modeled. But function inputs are either fully undef or fully defined: partly-undef inputs (some bits undef) are not explored, so some bugs can be missed. The -disable-undef-input and -disable-poison-input flags narrow this further. Source | · | · | · |
| Memory operationsalloca, load, store, getelementptr and pointer provenance in LLVM IR. | Alive2, Memory operations: Partial.alloca, load, store, getelementptr and provenance are modeled. Not supported: volatile and atomic accesses. The 2021 paper also left out type-based alias analysis, and assumed calls never change local variables whose address was passed out. Source | · | · | · |
| IntrinsicsLLVM intrinsic functions such as memcpy, overflow checks and bit counts. | Alive2, Intrinsics: Partial.In 2021, 54 of 258 platform-independent intrinsics (21%) had semantics; current code also models some x86 intrinsics. Others are over-approximated as unknown calls, and Alive2 says so when that blocks a verdict. Source | · | · | · |
| Vector typesSIMD vector values and operations. | Alive2, Vector types: Partial.Fixed-width vectors are supported. Scalable vectors are checked only for one fixed vscale value (2 by default). Source | · | · | · |
Supported Partial Not supported Unknown
Formal semantics of LLVM IR
Models that proofs about LLVM IR can be stated against. See formal semanticsFormal semantics. A precise, mathematical definition of what programs in a language do..
- Vellvm Stage 1 · Validated
A formal semantics of LLVM IR in Rocq, with an executable interpreter extracted from the same definitions and used to test the model against clang.
Compilers from LLVM IR
What each compilation step preserves, and whether it is proved.
| To | Via | Assurance | What does not carry over |
|---|---|---|---|
| x86-64 | LLVM backend (llc) | trusted | IR-level values and types become registers and memory. |
| AArch64 | LLVM backend (llc) | trusted | IR-level values and types become registers and memory. |
| RISC-V | LLVM backend (llc) | trusted | IR-level values and types become registers and memory. |
| WebAssembly | LLVM WebAssembly backend | trusted | IR-level values and types become stack-machine code. |