Optimize MD generator partitions for i386 bootstrap compile times
Adjusted i386 MD generator partitions to 6:6:1, significantly reducing bootstrap compile times for matching and recognition objects.
GCC’s i386 machine description (MD) generator now defaults to 6:6:1 partitions for its internal processing. This change, aimed at optimizing bootstrap compile times, rebalances the workload across compilation units related to instruction matching and recognition. The new default significantly reduces the compile time for critical files like gimple-match and generic-match objects, bringing them closer to more efficient compile times previously seen with smaller partition counts.
In Details
The default_md_generator_partitions target default for i[34567]86-*-* | x86_64-*-* configurations has been changed to 6:6:1. This aims to balance the overhead of per-file preamble processing against the benefits of parallelization within the MD generator, which compiles gimple-match, generic-match, and insn-emit/insn-recog files. The previous default led to longer compile times for the largest objects. The new 6:6:1 partition scheme (typically for insn-emit, insn-recog, and insn-attrtab) yields comparable or better compile times across these critical bootstrap files.
- MD generator
- Machine Description generator. GCC uses machine description files (MD files) to describe the instruction set architecture of a target processor. The MD generator processes these files to create internal tables and code used by the compiler.
- partitions
- In this context, partitions refer to how the MD generator divides its work into separate compilation units. A higher number of partitions can increase parallelism but also incurs overhead from repeated setup and teardown.
- bootstrap compile times
- The time it takes to compile the compiler itself. Optimizing bootstrap times is crucial for development iteration speed, especially in large projects like GCC.
- i386
- A family of 32-bit microprocessors originally designed by Intel, forming the basis of the x86 architecture. GCC supports a wide range of i386-compatible processors.
- SGPR
- Special General Purpose Register. In some architectures (like AMD GCN), SGPRs are a class of registers used for specific purposes, often holding global state or parameters.
- VGPR
- Vector General Purpose Register. VGPRs are typically used to hold data for vector operations, allowing multiple data elements to be processed in parallel.