genemit: Distribute overloaded-name definitions across output files
Balances generated code size across files to improve parallel compilation times.
This commit refactors genemit to distribute the definitions of overloaded names more evenly across output files. Previously, a single file received all definitions for add_clobbers, added_clobbers_hard_reg_p, and code_for_/gen_ pairs. This led to a significant size imbalance, with one file being 70% larger than others, slowing down parallel compilation. By assigning an output file per overloaded name, the file sizes are now balanced within a 3% spread, improving overall build times.
In Details
The genemit tool previously consolidated all add_clobbers, added_clobbers_hard_reg_p, and code_for_/gen_ pairs for overloaded names into a single output file (e.g., insn-emit-10.cc). This commit modifies genemit.cc to select a separate output file for each overloaded name. This redistribution balances the compile times of generated code files, as the longest compile time dictates the group's overall duration. The result is a more even distribution of file sizes, reducing build bottlenecks on architectures like AArch64.
- genemit
- A GCC internal tool that generates C code for instruction patterns based on machine description files.
- overloaded name
- In this context, refers to multiple machine instructions that share a common base name but differ in their operands or specific behavior.
- clobbers
- In compiler terminology, registers or memory locations that are modified by an instruction and whose prior values are no longer guaranteed to be preserved.
- parallel compilation
- Compiling multiple source files simultaneously using multiple CPU cores or machines to reduce overall build time.