A Fistful of Abstract Values: Crafting the Transformers Compilers Actually Need

::

Wouldn’t it be nice to auto-tune dataflow analysis so that it maximizes precision on the code you actually wrote?

Compilers today use a small set of transfer functions, one per instruction, to analyze any program. This is sound, but imprecise. Consider the code fragment x&(x-1): the lowest bit must be 0, but instruction-by-instruction reasoning cannot see this!

At POPL 2027, we introduce a framework that uses profiling and lightweight formal methods to improve precision on the abstract values that arise in practice when LLVM is used to optimize a corpus of over 68,000 programs (llvm-opt-benchmark). On the KnownBits domain, we discover millions of new bits with only a minor increase in analysis cost, 1.6% median slowdown.

The key idea, which took months of failure to arrive at, is that only a tiny fraction of the abstract domain shows up in practice. So instead of making better transformers, we pre-compute a lookup table of best-abstract-outputs for the interesting inputs. The tables are remarkably small: only 20,000 entries for KnownBits after profiling several million instruction sequences.

Simple solutions to complex problems are often overlooked. Hence we call our framework SimplyTheBest.

Pre-print: https://users.cs.utah.edu/~blg/publications/xsynth/kpfrdg-popl-2027.pdf

Cross-post: https://www.linkedin.com/posts/ben-greenman-71b7953a0_wouldnt-it-be-nice-to-auto-tune-dataflow-share-7532109143218929664-7sdZ/?utm_source=share&utm_medium=member_desktop&rcm=ACoAAGJcEscBCvJ7DHNYN2Ibv5xQuTf19fh2sIU