-
-
Notifications
You must be signed in to change notification settings - Fork 47
Description
What's the problem this feature will solve?
Generally, rewrites of the IR within a dialect can be categorized into Folds, Canonicalizations, and Transformations.
At the moment, all rewrites mqt-core uses are implemented as transformations. However, that's not necessarily the best solution. Patterns that help other transformations be more efficient should be implemented as canonicalizations so that they are applied between other passes.
Canonicalizations that only modify the root operation can also be impelmented as "folds" which are even more powerful.
Use this guide:
https://mlir.llvm.org/docs/Canonicalization/
for larger design decisions.
Describe the solution you'd like
The current transformation passes should be reorganized into:
- Transformations:
- non-local modifications
- may change semantics for the sake of optimization
- may have higher complexities
- e.g.:
mqt-core-round-trip
- Canonicalizations:
- local modifications
- don't change semantics
- constant complexity
- e.g.:
constant-folding,cancel-consecutive-inverses
- Folds:
- local modifications
- only modify or replace the root operation
- no operations are erased or created
A canonicalization pipeline should then be set up that automatically applies all our canonicalizations automatically