This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Remove iterator_types() method from LinalgStructuredInterface.
ClosedPublic

Authored by olegshyshkov on Oct 12 2022, 5:00 AM.

Details

Summary

getIteratorTypesArray should be used instead. It's a better substitute for all the current usages of the interface.

The current ArrayAttr iterator_types() has a few problems:

  • It creates an assumption operation has iterators types as an attribute, but it's not always the case. Sometime iterator types can be inferred from other attribute, or they're just static.
  • ArrayAttr is an obscure contained and required extracting values in the client code.
  • Makes it hard to migrate iterator types from strings to enums (RFC).

Concrete ops, like linalg.generic will still have iterator types as an attribute if needed.

As a side effect, this change helps a bit with migration to prefixed accessors.

Diff Detail

Event Timeline

olegshyshkov created this revision.Oct 12 2022, 5:00 AM
Herald added a project: Restricted Project. · View Herald Transcript
olegshyshkov requested review of this revision.Oct 12 2022, 5:00 AM
pifon2a accepted this revision.Oct 12 2022, 5:21 AM

Nice!

This revision is now accepted and ready to land.Oct 12 2022, 5:21 AM

Sync and resolve merge conflicts with Linalg::MapOp that was just added in https://reviews.llvm.org/D135754.