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

Improve GCC build time on s390

Optimized scheduler description processing to reduce GCC build times on s390.

This commit significantly reduces GCC’s build time on the s390 architecture by optimizing how scheduler descriptions are processed, particularly impacting partial rebuilds. The bottleneck was identified in genattrtab, where complex attribute definitions led to massive intermediate expression (RTX) structures. The changes refactor the construction of these expressions, moving from a right-biased insertion that leads to O(n^2) complexity to a more efficient method that avoids quadratic blowup in expression simplification and insertion.

In Details

The genattrtab utility on s390 experienced quadratic build time complexity due to the construction of scheduler attribute tests. Specifically, define_attr clauses for many mnemonics were built using repeated right-insertions into IOR expressions, each requiring simplification via simplify_test_exp. This commit modifies the attribute definition processing to avoid this O(n^2) behavior by optimizing how ior/i expressions are constructed and simplified, thus improving build performance, especially for incremental builds.

For Context
s390
An architecture family from IBM, commonly used in servers.
genattrtab
A GCC utility that generates tables for instruction scheduling and attribute processing from machine description files.
RTX
Representation of intermediate code in GCC, a Lisp-like language used to represent expressions and other constructs.
define_attr
A construct in GCC machine description files used to define processor attributes for instruction scheduling.
IOR
A logical OR operation, used here to combine multiple conditions in attribute tests.
Filed Under: s390build timeoptimizationcompiler