Hello everyone! I do see that there is documentation on the available MLIR passes here. But is there any documentation or publicly available tool available that lists, or helps one find all (or dialect specific) rewrite patterns available?
This may be useful in two ways:
Primarily, to be able to find/check if a pre-existing rewrite pattern exists similar to the required transformation, before implementing one. Having a high-level view of the rewrite patterns similar to the list of passes, would significantly help to improve productivity.
Some passes which just apply a series of rewrite patterns to the IR, may have unintended consequences and may be useful to use just a subset of patterns instead of running the entire pass.
There is no such documentation no. There have been conversations about generating some (and Id actually like a Hoogle esq search for it), but no work. The easiest would be for DRR and PDLL. I was thinking about this yesterday and one could get something approximate for regular C++ ones by hooking into rewrite driver and then running over all the unit tests and tracking what rewrites happen.
I think it would be very useful but no work ongoing AFAIK.
Sadly, “discoverability” is quite a pain point for us.
Yes and no. The number of passes is quite small compared to patterns. A list alone wouldn’t be sufficient, IMO. We’d need some way to organise that.
Note that in testing we often apply very narrow set of patterns through the TD dialect, here’s an example:
Thanks for all the feedback and comments everyone. @j2kun I do see that the PR is merged, and would be interested in contributing to any future updates if required