mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 02:26:05 +00:00

If a transformation should be a canonicalization is an orthogonal question to if a transformation should be implemented as a `RewritePattern` or a `fold` method. The later is an implementation detail. This patch adds a suggestion to always implement a canonicalization as a `fold` pattern if possible, as they are a restricted subset of a `RewritePattern`. This has been a common source of confusion, as to when to implement a canonicalization as a fold method or a RewritePattern.
MLIR documentation ================== Please note mlir.llvm.org is where MLIR's rendered documentation is displayed. The viewing experience on GitHub or elsewhere may not match those of the website. For any changes please verify instead that they work on the main website first. See https://github.com/llvm/mlir-www for the website generation information.