This is an archive of the discontinued LLVM Phabricator instance.

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

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

Event Timeline

rriddle created this revision.Aug 19 2020, 5:32 PM
Herald added a reviewer: ftynse. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
rriddle requested review of this revision.Aug 19 2020, 5:32 PM
ftynse accepted this revision.Aug 31 2020, 12:41 AM

Sorry for the delay.

This revision is now accepted and ready to land.Aug 31 2020, 12:41 AM
This revision was landed with ongoing or failed builds.Oct 26 2020, 6:05 PM
This revision was automatically updated to reflect the committed changes.