

ALT This paper introduces SimplyTheBest, a data-driven technique for improving dataflow analyses automatically. Rather than requiring compiler developers to notice and hand-code each missing case, SimplyTheBest mines recurring instruction patterns where a current analysis loses precision and where a more precise interpretation could expose new optimizations. For each such pattern, SimplyTheBest uses a formal specification of the instructions being analyzed to construct a maximally precise abstract transformer for the specific abstract input values that are seen during compilation. On the high-profile dataset llvm-opt-benchmark, SimplyTheBest discovers millions of known bits beyond LLVM’s hand-engineered analysis and enables optimizations such as removing a load and replacing a function by a constant.

ALT Fig. 1. SimplyTheBest mines frequent patterns from llvm-opt-benchmark, reduces compositionally complete subterms in patterns, and finally uses profiling and SMT to specialize the remaining patterns for the abstract inputs observed in practice. Rows are kept aligned across stages for comparison; × marks rejected patterns and pruned items while ✓marks accepted patterns and selected items. In the following, we call the existing instruction-by-instruction analysis a sequential transformer: it first abstracts the result of x%y and then analyzes the subtraction. By contrast, a composite transformer analyzes the whole pattern x -nsw (x%y) at once, avoiding the intermediate abstraction that can lose the relationship between x and x%y.

ALT Although x -nsw (x%y) is invoked 1.10 million times across llvm-opt-benchmark, and despite an input space of size 32·64 (it has only two arguments), these invocations exercise only 71 distinct abstract inputs—just a fistful of abstract values! Table Pruning for x -nsw (x % y) When deployed inside LLVM, the 40-entry table for x -nsw (x%y) is queried 2.08 million times and improves precision on 2.06 million of those queries. Across llvm-opt-benchmark, this single composite transformer produces 12.3 million additional known bits across all queries to ComputeKnownBits(), or 2.57 million additional known bits when counting only top-level queries. Fig. 4. Narrowing millions of observed inputs to thousands stored in SimplyTheBest.

ALT Table 1 presents the precision gain and compile-time cost of SimplyTheBest on all benchmark code using both Max mode and Fast mode. The largest relative improvement is close to 6 % precision in SConstRange. Fast mode for SConstRange does well compared to Max mode, retaining about 80 % of the precision gains. Switching to Fast mode reduces the average overhead to about 1.1 %. Table 1. Precision gain and compile-time overhead. Bits Added is the precision gain in millions of fractional bits (and percent improvement relative to LLVM). Improved Queries counts the number of calls where SimplyTheBest added precision (and percent improvement vs. LLVM’s transformers).

























