Skip to content
Unverified Commit 6668d149 authored by peterbell10's avatar peterbell10 Committed by GitHub
Browse files

[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)`
parent b7abab2f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment