This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Linalg] NFC - Cleanup explicitly instantiated paterns 2/n - Loops.cpp
ClosedPublic

Authored by nicolasvasilache on Oct 9 2020, 9:58 AM.

Details

Summary

This revision belongs to a series of patches that reduce reliance of Linalg transformations on templated rewrite and conversion patterns.
Instead, this uses a MatchAnyTag pattern for the vast majority of cases and dispatches internally.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptOct 9 2020, 9:58 AM
nicolasvasilache requested review of this revision.Oct 9 2020, 9:58 AM
pifon2a accepted this revision.Oct 9 2020, 10:05 AM

Nice, it became much cleaner with llvm::TypeSwitch.

This revision is now accepted and ready to land.Oct 9 2020, 10:05 AM
mravishankar requested changes to this revision.Oct 9 2020, 10:21 AM

Nice cleanup! Concerned about drop in coverage though.

mlir/lib/Dialect/Linalg/Transforms/Loops.cpp
313–315

Nit: Crux of this method and the one below are the same. Can we just have a emitScalarPoolingMinMaxOpImplementation and combine the logic (the explicit instantiation would be just calling this impl function). But maybe not be worth it, so a suggestion that can be ignored.

455–460

TIL TypeSwitch! This looks great! Thanks!

mlir/test/Dialect/Linalg/loops.mlir
2 ↗(On Diff #297269)

Does this need to be split. Having the entire command line in one line looks fine to me.

3 ↗(On Diff #297269)

Does R_UN work? Will this not stop the test from executing?

6 ↗(On Diff #297269)

Is this actually running the test?

81 ↗(On Diff #297269)

This seems to be dropping coverage a lot. For example, the pooling ops, conv ops, etc. arent being tests. Not sure whats happening here?

This revision now requires changes to proceed.Oct 9 2020, 10:21 AM

Revert spurious test file changes.

This revision is now accepted and ready to land.Oct 9 2020, 12:14 PM

Factor out common code.

nicolasvasilache marked 2 inline comments as done.Oct 9 2020, 12:19 PM