[mlir][arith] Canonicalization patterns for `arith.select` (#67809)
This adds the following canonicalization patterns: - Inverting condition: - `select(not(pred), a, b) => select(pred, b, a)` - Merging consecutive selects with the same predicate - `select(pred, select(pred, a, b), c) => select(pred, a, c)` - `select(pred, a, select(pred, b, c)) => select(pred, a, c)` - Merging consecutive selects with a common value: - `select(predA, select(predB, a, b), b) => select(and(predA, predB), a, b)` - `select(predA, select(predB, b, a), b) => select(and(predA, not(predB)), a, b)` - `select(predA, a, select(predB, a, b)) => select(or(predA, predB), a, b)` - `select(predA, a, select(predB, b, a)) => select(or(predA, not(predB)), a, b)`
Loading
Please sign in to comment