Souper
A superoptimizer for LLVM IR
...By leveraging SMT (Satisfiability Modulo Theories) solvers, Souper symbolically analyzes LLVM Intermediate Representation (IR) to synthesize equivalent, more efficient expressions. It identifies peephole optimizations—small instruction-level improvements—that LLVM’s optimizer may overlook, thereby improving compiled code quality. Souper can operate in multiple modes: as a standalone analysis tool that extracts and solves SMT queries from LLVM bitcode, or as an LLVM optimization pass that applies discovered optimizations directly to the IR. It integrates seamlessly with Clang and LLVM tools and supports caching mechanisms (RAM or Redis) to accelerate repeated analyses. ...