match: Optimize neeq pattern and fix typo in matcher
Simplifies a pattern for the 'ne eq' comparison in the GCC matcher and corrects a typo.
This commit refactors the GCC matcher by combining two patterns for the ne eq (not equal, equal) condition into a single, more efficient pattern. Additionally, it corrects a typo in the zero_one_valued_p check, changing ‘C’ back to ‘X’ to ensure the pattern correctly identifies the intended operand. This optimization aims to simplify the pattern matching logic and improve the backend’s efficiency in handling specific comparison combinations.
In Details
The match.pd file contains patterns used by GCC's backend to recognize and optimize specific sequences of operations. This change targets the ne eq (not equal, equal) comparison, which typically reduces to a constant comparison. By combining two existing patterns into one, the matcher becomes more concise. The typo fix in zero_one_valued_p ensures the correct operand is evaluated for this predicate. These changes simplify the backend's RTX matching logic.
- pattern matching
- A technique used by compilers to recognize specific structures or sequences in the intermediate representation (IR) that can be replaced by more efficient code or simplified further.
- RTX
- Representation of intermediate code in GCC, used by the backend to describe operations and data. RTX stands for 'RePresentation of code EXpression'.
- ne eq
- A logical comparison combining 'not equal' and 'equal'. In many contexts, this can be simplified or optimized.