GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
genattrtab Performance Win

genattrtab: Distribute generated code across multiple files

Splits genattrtab's large output into multiple files to improve AArch64 bootstrap compile times.

This commit refactors genattrtab to distribute its generated code across multiple files, similar to genemit and genrecog. This addresses performance bottlenecks on targets like AArch64 where insn-attrtab.cc became a very slow-compiling object due to large switch statements. The changes leverage the existing --with-insnemit-partitions mechanism and sort functions by size to improve load balancing, significantly reducing the compile time of the largest attribute object.

In Details

This change partitions genattrtab's output, specifically the attribute handling functions, into multiple files using the common gensupport machinery and the --with-insnemit-partitions option. Previously, insn-attrtab.cc was a monolithic and slow-compiling source file. The new implementation sorts generated attribute functions by estimated output size to balance partitions effectively. For AArch64 with 10 partitions, this reduces the largest partition's size by 83% and compilation time by 76%, addressing slow bootstrap times.

For Context
genattrtab
A GCC machine description generator responsible for producing C code that handles machine-specific attributes of instructions.
insn-attrtab.cc
The C source file generated by genattrtab containing functions to retrieve instruction attributes.
switch statement
A control flow statement in C/C++ that selects one of many code blocks to execute based on the value of an expression.
AArch64 bootstrap
The process of compiling GCC for the AArch64 architecture, starting from a minimal set of tools. Slow compilation during bootstrap is a significant build system concern.
DFA
Data Flow Analysis, a technique used in compilers to analyze the flow of data through a program to optimize it.
latency
In the context of instruction scheduling, latency refers to the number of clock cycles between when an instruction starts execution and when its result is available for use by subsequent instructions.
Filed Under: genattrtabbuild systemAArch64compilation timeoptimization