Computer Science
New Framework Uses Clustered Optimization Sequences to Speed Up Compiler Tuning
GRACE combines program clustering with reusable optimization sequences to achieve better code performance with minimal deployment overhead.
Automatic compiler optimization has long struggled with a fundamental tension: iterative search can find powerful program-specific improvements, but the computational cost is often impractical for real-world deployment. Meanwhile, machine-learning approaches are faster but don't transfer knowledge well across different programs. Researchers have now introduced GRACE, a framework that navigates this trade-off through cluster-specific sequence reuse.
The Core Innovation#
Rather than relying on a single universal set of optimization rules for all programs, GRACE groups similar programs together and builds a small, reusable optimization sequence specifically tailored to each cluster. The framework combines three key techniques: analyzing how compiler passes work together across programs, organizing programs based on how they respond to different optimizations, and applying evolutionary search within each cluster to find the best sequences.
Performance Gains#
Testing on seven benchmark datasets against LLVM 10.0.0 and 18.1.6 showed measurable improvements:
- For code size: GRACE reduced instruction counts by approximately 9.9–10.3% compared to standard LLVM's aggressive code-size optimization mode (
opt -Oz), while keeping per-program tuning time under one second. - For execution speed: The framework achieved reductions in estimated cycle counts of roughly 26.8–27.5% relative to LLVM's standard performance optimization (
opt -O3), with actual speedups observable on runnable benchmark suites.
Deployment in Practice#
At runtime, GRACE evaluates its precomputed coreset on a new program and can optionally refine results through lightweight searching within a bounded space. This approach keeps overhead minimal while maintaining quality gains, making it practical for integration into real compilation pipelines.
The results suggest that offline-prepared, cluster-aware optimization sequences offer a practical middle ground: better performance than one-size-fits-all defaults, yet faster and more scalable than program-specific iterative tuning.