match: Remove unused result captures to speed up compilation.
match: Optimizes pattern matching by removing unneeded result captures, slightly reducing compiler time.
This commit removes several unused result captures from widening multiply matches in the match.pd file. By reducing the amount of data stored in result operands, these changes offer a slight improvement in compiler speed. The affected patterns include mul_carry_low_sum, mul_low_accum, and several mul_ladder_sum variations.
In Details
In match.pd, several pattern-matching definitions for widening multiply operations (mul_carry_low_sum, mul_low_accum, etc.) included result captures (e.g., @1) that were not subsequently used by the forwprop pass. This commit removes these now-obsolete captures, reducing the size of the internal representation of match results and slightly improving the performance of the code generation for these patterns.
- widening multiply
- A multiplication operation where the result may require more bits than the operands. For example, multiplying two 32-bit integers can result in a 64-bit value.
- pattern matching
- A mechanism used in compilers to recognize specific structures or sequences of operations in the intermediate representation (IR) of the code, often used for optimization or code generation.
- result captures
- In pattern matching, these are placeholders that store parts of the matched structure, which can then be used or referred to later. Removing unused captures reduces overhead.