Super-Analysis for Aggressive yet Scalable Compiler Optimization
Amirali Ebrahimzadeh, Amir Shaikhha
Abstract
Aggressive compiler optimization today occupies two distant extremes. Conventional optimizers run in milliseconds but reason through ad-hoc heuristics that miss opportunities; superoptimizers synthesize faster code but take hours, confining them to small kernels and offline use. We introduce solver-based super-analysis, a middle ground that uses expensive SMT-based analysis while transformations remain conventional, avoiding program synthesis entirely. The key argument for super-analysis is that conventional compilers have rich transformation rules, but proving them to be safe requires complex reasoning: proving a safety check dead often needs facts from three independent LLVM analyses simultaneously, a conjunctive entailment problem suited to an SMT solver, not to any single dataflow pass. We instantiate super-analysis in ODeSSy, an LLVM pass that proves sanitizer traps and native-language safety checks unreachable and removes them. One mechanism serves four frontend languages and yields speedups in each, including a 3.78x speedup for a GEMM implemented in Julia. A further solver-based optimization, guard synthesis, handles checks that are not dead for every input: the solver synthesizes a cheap invariant safety guard under which a fast check-free loop is cloned, speeding up a Swift Base64 encoder by 1.44x and a Julia LZ77 compressor by 4.01x. Compared with Souper, the synthesizing superoptimizer for LLVM, ODeSSy removes more safety checks in significantly less time, making it viable as an online compiler pass.
Create a lesson
Related papers
Tenon: A Unified Programming Framework for Retargetable PIM Compilation
Shared title terminology · Niansong Zhang, Shiran Guo, Zhiru Zhang
MetaphIR: Corpus-Scale Applicability Analysis for LLVM Peephole Optimizations
Shared title terminology · Hongxu Xu, Xintong Zhou, Chunhao Liao et al.
A Compilation Model for Divergent Parallel Workloads
Shared title terminology · Alexander J Root, Christophe Gyurgyik, Devanshu Ladsaria et al.
SAFE: Formal Specification and Implementation of a Scalable Analysis Framework for ECMAScript
Shared title terminology · Hongki Lee, Sooncheol Won, Joonho Jin et al.
CompCert4Lean: Porting a Verified C Compiler to Lean in Six Weeks with Parallel Coding Agents
Shared title terminology · Cong Wang, Zhiyang Chen, Fan Long et al.
Compiling Imperative Hardware Protocol Specifications to Hardware
Shared title terminology · Nikil V. Shyamsunder, Ernest Ng, Adrian Sampson et al.