[Mlir-commits] [mlir] [mlir][docs] Update documentation for canonicalize. (PR #99753)

Mehdi Amini llvmlistbot at llvm.org
Sat Jul 20 14:20:10 PDT 2024


================
@@ -51,6 +55,61 @@ Some important things to think about w.r.t. canonicalization patterns:
 *   It is always good to eliminate operations entirely when possible, e.g. by
     folding known identities (like "x + 0 = x").
 
+*   Canonicalization isn't a great place to put pattens with expensive running
+    time (i.e. have O(n) complexity) or complicated cost models.
----------------
joker-eph wrote:

```suggestion
*   Pattens with expensive running time (i.e. have O(n) complexity) or complicated cost models
     don't belong to canonicalization: since the algorithm is executed iteratively until fixed-point
     we want patterns that execute quickly (in particular their matching phase).
```


https://github.com/llvm/llvm-project/pull/99753


More information about the Mlir-commits mailing list