IT lexicon › Programming › Superoptimization

Superoptimization

Programming På svenska → Updated: 2026-11-05

Searching the space of instruction sequences for the genuinely shortest one that does the same job, rather than trusting hand-written optimization rules.

Henry Massalin coined the term in 1987 with a program that tried every instruction sequence in order of length until one matched the input function. It only worked for functions a handful of instructions long, but it turned up tricks with the carry flag and sign bits that no human had thought of. The GNU Superoptimizer of 1992 put the idea to work finding patterns that were then hand-coded into GCC.

Later variants swap brute force for randomness and proof: Stanford's STOKE (2013) mutates programs stochastically, and Souper hunts for missed simplifications in LLVM's intermediate representation and checks them with an SMT solver. The output rarely ships directly. It becomes new rules for the peephole optimizer, discovered by a machine with more patience than any compiler engineer.

← Back to the lexicon