This is an archive of the discontinued LLVM Phabricator instance.

[mlir][OpDSL] Add support for adding canonicalization patterns.
ClosedPublic

Authored by gysit on Mar 1 2022, 7:03 AM.

Details

Summary

Extend OpDSL with a defines method that can set the hasCanonicalizer flag for an OpDSL operation. If the flag is set via defines(Canonicalizer) the operation needs to implement the getCanonicalizationPatterns method. The revision specifies the flag for linalg.fill_tensor and adds an empty FillTensorOp::getCanonicalizationPatterns implementation.

This revision is a preparation step to replace linalg.fill by its OpDSL counterpart linalg.fill_tensor. The two are only functionally equivalent if both specify the same canonicalization patterns. The revision is thus a prerequisite for the linalg.fill replacement.

Depends On D120725

Diff Detail

Event Timeline

gysit created this revision.Mar 1 2022, 7:03 AM
gysit requested review of this revision.Mar 1 2022, 7:03 AM
gysit updated this revision to Diff 413719.Mar 8 2022, 12:35 AM

Rebase.

Herald added a project: Restricted Project. · View Herald TranscriptMar 8 2022, 12:35 AM
nicolasvasilache accepted this revision.Mar 8 2022, 5:51 AM
This revision is now accepted and ready to land.Mar 8 2022, 5:51 AM
gysit updated this revision to Diff 413790.Mar 8 2022, 6:34 AM

Rebase.