genemit: Emit split dump messages via a helper function
Reduces generated code size and compilation time by centralizing dump message logic.
This commit refactors the genemit tool to use a helper function, note_split, for emitting dump messages related to split operations. Previously, each of the thousands of define_split and define_peephole2 generators included repetitive code to print a dump message. By centralizing this logic into note_split in emit-rtl.cc, the generated code size for insn-emit-*.cc files is reduced, and compilation time decreases. The dump output remains unchanged, preserving the integrity of regression tests that rely on it.
In Details
The genemit tool's generated code for define_split and define_peephole2 generators previously contained repetitive if (dump_file) and fprintf calls for reporting split operations. This commit extracts this logic into a new helper function, note_split, in emit-rtl.cc. The genemit.cc code now calls this helper, passing a string describing the split (e.g., function name and location). This reduces code bloat in the generated insn-emit-*.cc files and speeds up compilation, with no change to the actual dump output for scan-rtl-dump tests.
- genemit
- A GCC internal tool that generates C code for instruction patterns based on machine description files.
- define_split
- A macro in GCC's machine description files that defines a transformation rule for breaking down complex instructions into simpler ones.
- define_peephole2
- A macro in GCC's machine description files that defines a peephole optimization rule, applied to a small sequence of instructions.
- emit-rtl.cc
- A GCC source file containing functions related to emitting RTL (Register Transfer Language) code.
- scan-rtl-dump
- A GCC test utility used to verify that the compiler's internal RTL dump matches expected output.