Top-Down Differential Analysis Finds GCC and Clang Produce Substantially Different Performance From Identical Source — Then Patches Binaries by Transplanting the Winner's Code
Posted 2026-08-10, this work attacks compiler performance bugs — functionally correct but computationally inefficient codegen — from the top down instead of the usual bottom-up rule-checking that can't quantify holistic impact or catch microarchitectural inefficiency. It calibrates compiler differences against fine-grained hierarchical microarchitectural metrics and uses sampling to pinpoint the specific code snippets responsible. The empirical evaluation reports substantial and often surprising performance gaps between GCC- and Clang-generated binaries, and the authors built a binary patching framework that fixes identified issues by transplanting superior code sequences from the competing compiler.
↳ Follow the thread