This is an archive of the discontinued LLVM Phabricator instance.

Split InferShapedTypeOpInterface to create ReifyRankedShapeTypeShapeOpInterface.
ClosedPublic

Authored by mravishankar on Jul 16 2021, 1:10 AM.

Details

Summary

The reifyReturnTypeShapesPerResultDim method supports shape
inference for rsults that are ranked types. These are used lower in
the codegeneration stack than its counter part reifyReturnTypeShapes
which also supports unranked types, and is more suited for use higher
up the compilation stack. To have separation of concerns, this method
is split into its own interface.
See discussion : https://llvm.discourse.group/t/better-layering-for-infershapedtypeopinterface/3823

Diff Detail

Event Timeline

mravishankar created this revision.Jul 16 2021, 1:10 AM
mravishankar requested review of this revision.Jul 16 2021, 1:10 AM
jpienaar accepted this revision.Jul 16 2021, 8:42 AM

Looks like good cleanup thanks. I just focused interface side as I don't know the rest as well.

mlir/include/mlir/Interfaces/InferTypeOpInterface.td
150

Not to bike shed, but is the additonal shape needed?

ShapedType is the c++ class, and just ReifyRankedShapedTypeOpInterface seems descriptive and unambiguous

155

Vector too correct?

165

Indent more to avoid the document generator adding weird spaces :)

170

The last sentence is probably not needed given interface name.

177

OOC Should we perhaps add a typedef for this?

This revision is now accepted and ready to land.Jul 16 2021, 8:42 AM
mravishankar marked 3 inline comments as done.

Addressing comments

mlir/include/mlir/Interfaces/InferTypeOpInterface.td
150

Sounds good. I just copy pasted from Discourse. I like this better.

155

Sure, but vectors so far are statically shaped. So the interface not really needed there.

165

Ugh! Tabs. Fixed.

Fix build warning and update bazel file

This revision was landed with ongoing or failed builds.Jul 19 2021, 2:45 PM
This revision was automatically updated to reflect the committed changes.