This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Move getDimsOfType to StructuredOpsUtils.h.
ClosedPublic

Authored by olegshyshkov on Sep 21 2022, 4:46 AM.

Details

Summary

This change will bring all helpers that work with iterator types to one place.
Currently getDimsOfType is is declared in Linalg.h, but not directly included by
LinalgInterfaces. It worked so far only because all the places that include
LinalgInterfaces.h also include Linalg.h directly or indirectly.

Diff Detail

Event Timeline

olegshyshkov created this revision.Sep 21 2022, 4:46 AM
olegshyshkov requested review of this revision.Sep 21 2022, 4:46 AM
pifon2a accepted this revision.Sep 21 2022, 5:03 AM
pifon2a added inline comments.
mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
261–262

If you're not passing the operation itself, then the function becomes more general and just computes positions of x: type in vector<type>. In that case, you probably want to rename it to findPositions or smth like that.

mlir/include/mlir/Dialect/Utils/StructuredOpsUtils.h
117

nit: use (auto en : llvm::enumerate(iteratorType...)) and then en.index() and en.value()

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

Resolved comments.

olegshyshkov marked 2 inline comments as done.Sep 21 2022, 5:28 AM
pifon2a accepted this revision.Sep 21 2022, 5:36 AM
This revision was landed with ongoing or failed builds.Sep 21 2022, 5:50 AM
This revision was automatically updated to reflect the committed changes.