Compact insn_data and operand_data emission.
genoutput: Emit instruction and operand data more compactly, reducing file size and memory usage.
The emission of insn_data and operand_data in the genoutput component has been significantly compacted, resulting in substantial reductions in generated file sizes and peak memory usage during compilation. This was achieved by replacing the use of HAVE_DESIGNATED_UNION_INITIALIZERS with constexpr constructors and emitting table rows more compactly. The changes lead to a dramatic decrease in the size of insn-output.cc and associated object files without affecting compile times.
In Details
This commit restructures the generation of insn_data and operand_data in genoutput.cc to be more compact. It replaces the conditional logic for HAVE_DESIGNATED_UNION_INITIALIZERS (a GNU extension) with constexpr constructors for union members. This allows each table row to be emitted on a single line, drastically reducing source file size and indentation. The change also removes the fallback to a larger struct representation when designated initializers are unavailable. This improves memory usage during compilation and reduces the disk footprint of generated files, particularly for…
- genoutput
- A component within GCC responsible for generating machine description files, which define instructions and their properties for target architectures.
- insn_data
- Data structure containing information about machine instructions.
- operand_data
- Data structure containing information about the operands of machine instructions.
- HAVE_DESIGNATED_UNION_INITIALIZERS
- A preprocessor macro or feature that allows specific members of a C++ union to be initialized using designated initializers. This commit removes its usage in favor of C++14 constexpr constructors.
- constexpr constructor
- A constructor for a class or struct that can be evaluated at compile time. This allows objects to be initialized more efficiently and enables their use in compile-time computations.
- compact emission
- A process of generating output code or data in a highly condensed format, reducing file size and potentially improving loading or processing times.