# google/souper

A superoptimizer for LLVM IR

Repository: https://github.com/google/souper
Canonical: https://ross.abutalabs.com/products/souper
Language: C++
License: Apache-2.0
License Family: permissive
Archived: true
Last push: 2024-08-28T04:33:42+00:00

## Health v2 (maintenance only)
Score: 10/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 4534, "days_push": 735, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, archived
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2389, forks 189 (observed 2026-08-28T04:06:43.284583+00:00)

## What it is
Souper is a superoptimizer for LLVM IR that uses SMT solvers (like Z3) to synthesize shorter, equivalent instruction sequences. It identifies missing peephole optimizations in LLVM's midend optimizers and can either report them or apply them via an LLVM opt pass.

## Use cases
- find missed peephole optimizations in LLVM IR
- superoptimize compiled bitcode to shorter instruction sequences
- automatically apply synthesized optimizations via an LLVM opt pass
- test and improve LLVM's optimizer by discovering refinement opportunities
- verify instruction-level equivalence of code using an SMT solver

## When to choose
- you are developing or testing LLVM's optimizer and want to find missing peephole optimizations
- you need minimal instruction sequences for hot code paths and can tolerate slow synthesis
- you want to use SMT-based program synthesis on LLVM bitcode

## When to avoid
- you need fast, general-purpose compilation — superoptimization is computationally expensive
- you work with languages or IRs other than LLVM IR
- you need a turnkey optimizer without building LLVM dependencies yourself

## Facets
- artifact type: cli-tool
- maturity: active
- function: compiler, developer-tools, testing
- domain: compilers, developer-tools, performance
- platform: cpp
- tags: superoptimizer, llvm-ir, smt-solver, peephole-optimization, program-synthesis, z3, linux, macos, llvm

## Member repositories
- google/souper (main) score 10

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:43.284583+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:34:31.784703+00:00, confidence not recorded.
  - readme: https://github.com/google/souper (fetched 2026-08-28T04:06:43.284583+00:00, sha f10ee4189bdf)
- Data as of 2026-08-30T08:39:29.467469+00:00.
