The Unseen Delta: Characterizing the Compiler Optimization Landscape via Top-Down Differential Analysis
Open Access
- 1 October 2026
- journal article
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Software Engineering
- Vol. 3 (ISSTA) , 1672-1695
Abstract
Compiler optimizations are essential for achieving high performance in modern software. However, recent studies highlight the persistence of performance bugs, i.e., subtle defects where the compiler generates functionally correct but computationally inefficient code, leading to significant performance degradation. Existing detection and testing methods typically employ a bottom-up approach, focusing on specific low-level code properties and remaining confined to known optimization rules. Consequently, they struggle to quantify the holistic impact of identified issues and often overlook critical microarchitectural inefficiencies. We observe a key indicator of untapped potential: different compilers often produce binaries with significant performance differences for identical source code. However, the root causes of these discrepancies remain largely unexplored and difficult to pinpoint using current techniques. To bridge this gap, we introduce a top-down differential analysis methodology. This approach calibrates compiler optimization differences with fine-grained, hierarchical microarchitectural metrics, offering a comprehensive view of runtime behavior. Using a sampling-based approach, this method efficiently pinpoints the critical code snippets responsible for performance differences, enabling targeted root cause analysis. Our empirical evaluation uncovers substantial and often surprising performance differences between binaries generated by GCC and Clang. A categorization of root causes reveals systemic challenges in compiler optimizations. To quantitatively validate our findings and demonstrate practical impact, we developed a binary patching framework that fixes identified performance issues by transplanting superior code sequences from competing compilers. This work provides a novel lens for understanding and analyzing optimization defects.Keywords
All Related Versions
This publication has 66 references indexed in Scilit:
- Facile: Fast, Accurate, and Interpretable Basic-Block Throughput Prediction2023
- Leaky Frontends: Security Vulnerabilities in Processor Frontends2022
- An empirical study of optimization bugs in GCC and LLVMJournal of Systems and Software, 2021
- Criticality Aware Tiered Cache Hierarchy: A Fundamental Relook at Multi-Level Cache Hierarchies2018
- Learning to Prioritize Test Programs for Compiler Testing2017
- Top-Down Characterization Approximation based on performance counters architecture for AMD processorsSimulation Modelling Practice and Theory, 2016
- Inline Analysis: Beyond Selection Heuristics2006
- To Inline or Not to Inline? Enhanced Inlining Decisions2004
- Generalized loop-unrolling: a method for program speedup2003
- Speculation techniques for improving load related instruction scheduling2003