Match: Add simplifications for min/max comparisons.
The compiler can now simplify comparisons between min(a, b) and max(a, b) to true, false, a!=b, or a==b.
New patterns were added to simplify comparisons between the results of min(a, b) and max(a, b). Specifically, expressions like min(a,b) <= max(a,b) will now reduce to true, min(a,b) > max(a,b) to false, min(a,b) < max(a,b) to a!=b, and min(a,b) >= max(a,b) to a==b. This can help later optimization passes by removing complexity early.
In Details
The match.pd file uses the Pattern Description language to define tree transformations. This commit adds patterns that fire during the tree-ssa phase to simplify relational comparisons of MIN_EXPR and MAX_EXPR. The simplification patterns are architecture-independent.
For Context
The compiler uses pattern matching to recognize opportunities for optimization. The match.pd file contains a list of code patterns and their corresponding replacements. This commit adds several new patterns that allow the compiler to simplify code that compares the minimum and maximum of two values, potentially leading to more efficient code generation.