GCC Newspaper
JUNE 15, 2026
gcc Proposed

RFC: Standalone AutoFDO Profile Tool for GCC

An RFC proposes a standalone AutoFDO profile tool for GCC, aiming for simplicity and minimal dependencies, sparking discussion on dependency choices.

Kugan Vivekanandarajah proposes a standalone AutoFDO (Automatic Feedback-Directed Optimization) profile tool for GCC, intended to replace reliance on external, unmaintained Google tools. The tool aims to convert samples into AutoFDO profiles readable by the GCC toolchain, with minimal dependencies. The discussion focuses on whether to use libdwarf or libbacktrace for DWARF parsing, considering factors like version support and dependency size.

In the Thread 3 participants
  1. Kugan Vivekanandarajah proposer

    Proposes creating a native, simplified AutoFDO tool for GCC to replace the current reliance on external Google tools. The goal is simplicity and minimal dependencies, focusing on libraries like libdwarf for DWARF parsing.

    “Building on our discussions from the last Cauldron, we propose creating a native, simplified AutoFDO tool for GCC to replace our current reliance on external Google tools which is not actively maintained.”
  2. Jan Hubička reviewer

    Suggests reusing libbacktrace's code instead of requiring libdwarf and libelf as dependencies, mentioning potential issues with specific libdwarf versions.

    “Could we reuse libbacktrace's code here? Instead of requiring libdwarf and libelf as a dependency? Or maybe libiberty/simple-object code?”
  3. Kugan Vivekanandarajah contributor

    Responds to the feedback, noting that libbacktrace might require ibdw to get the discriminator, but agrees libbacktrace looks like a better solution.

    “I tried recreating with libbacktrace. AFIK, we however would need ibdw to get the discriminater unless we change libbacktrace. libbacktrace looks to me like a better solution given version issues you mentioned.”

Technical Tradeoffs

  • **Dependency Size:** libdwarf might be larger than libbacktrace.
  • **Version Support:** libdwarf versioning can be an issue, potentially requiring support for newer DWARF standards.
  • **Functionality:** libbacktrace might require changes or an additional library (ibdw) to provide the necessary functionality (discriminator).

In Details

AutoFDO uses execution profiles to guide compiler optimizations. This proposal outlines a standalone tool to generate these profiles from samples. The discussion centers around minimizing dependencies (libdwarf vs. libbacktrace) for parsing DWARF debugging information, a common tradeoff in toolchain development.

For Context

Automatic Feedback-Directed Optimization (AutoFDO) is a compilation technique where the compiler uses runtime information to optimize code. A profile is generated that indicates how frequently different parts of the code are executed. This information then guides the compiler to optimize the most frequently used code paths. This proposal concerns a tool to generate these profiles in a format that GCC can use. The core discussion is on the dependencies of the tool (libraries to parse debugging information).

Filed Under: AutoFDOoptimizationprofilingtoolchain