The constructor of PatternApplicator doesn't have a constructor that
accepts only a RewritePatternSet as currently used in the example
code in PatternRewriter.md. Instead, one has to turn it into a
FrozenRewritePatternSet.
Details
- Reviewers
nicolasvasilache - Commits
- rGd4a7ca81feb4: [mlir][doc] Fix usage of PatternApplicator.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Doesn't FrozenRewritePatternSet have an implicit constructor https://mlir.llvm.org/doxygen/classmlir_1_1FrozenRewritePatternSet.html#ad651d65d1d56ecfdd6290c62f08d5a15 that would apply?
It seems like this is the inverse direction than what is needed: The constructor you point to constructs a FrozenRewritePatternSet from a RewritePatternSet (which freezes the set); however, in the example, we have a FrozenRewritepatternSet that is given to a function that expected a RewritePatternSet (which would "unfreeze" the set, which I guess shouldn't be possible). My commit makes the function accept a FrozenRewritePatternSet instead, but one could also never freeze it in the first place. I don't really understand the code, so any more informed suggestions are welcome!