Page MenuHomePhabricator

[mlir][Pattern] Refactor the Pattern class into a "metadata only" class
AcceptedPublic

Authored by rriddle on Aug 19 2020, 5:32 PM.

Details

Summary

The Pattern class was originally intended to be used for solely matching operations, but that use never materialized. All of the pattern infrastructure uses RewritePattern, and the infrastructure for pure matching(Matchers.h) is implemented inline. This means that this class isn't a useful abstraction at the moment, so this revision refactors it to solely encapsulate the "metadata" of a pattern. The metadata includes the various state describing a pattern; benefit, root operation, etc. The API on PatternApplicator is updated to now operate on Patterns as nothing special from RewritePattern is necessary.

This refactoring is also necessary for the upcoming use of PDL patterns alongside C++ rewrite patterns.

Depends On D84580

Diff Detail