Page MenuHomePhabricator

[mlir][Linalg] Add utility function that return static loop bounds of Linalg ops
ClosedPublic

Authored by mravishankar on Nov 18 2020, 4:05 PM.

Diff Detail

Event Timeline

mravishankar created this revision.Nov 18 2020, 4:05 PM
mravishankar requested review of this revision.Nov 18 2020, 4:05 PM
asaadaldien accepted this revision.Nov 18 2020, 4:38 PM
asaadaldien added inline comments.
mlir/include/mlir/Dialect/Linalg/Utils/Utils.h
120

nit: Maybe a comment to explain what is the shape of an op ?

This revision is now accepted and ready to land.Nov 18 2020, 4:38 PM
hanchung accepted this revision.Nov 19 2020, 12:07 AM

few nits, LGTM!

mlir/lib/Dialect/Linalg/Utils/Utils.cpp
162

nit: I think we don't need template because this is not a template function?

162

If it is getStaticShape, do we want to check if shape.hasStaticShape()?

antiagainst accepted this revision.Nov 19 2020, 5:24 AM
mravishankar marked 3 inline comments as done.Nov 19 2020, 6:58 PM
mravishankar added inline comments.
mlir/include/mlir/Dialect/Linalg/Utils/Utils.h
120

It says its the static version of the getShape method above. That explains what shape is.

mlir/lib/Dialect/Linalg/Utils/Utils.cpp
162

The comment in the header files says it returns -1 for the dynamic shapes. Might worth returning that in case clients want to check which dim is dynamic.

mravishankar marked 2 inline comments as done.

Address comments

This revision was landed with ongoing or failed builds.Nov 19 2020, 7:01 PM
This revision was automatically updated to reflect the committed changes.