This is an archive of the discontinued LLVM Phabricator instance.

[mlir][shape] Add `shape.from_extents`.
ClosedPublic

Authored by silvas on May 12 2020, 6:40 PM.

Details

Summary

This is a basic op needed for creating shapes from SSA values
representing the extents.

Diff Detail

Event Timeline

silvas created this revision.May 12 2020, 6:40 PM
Herald added a project: Restricted Project. · View Herald Transcript
jpienaar accepted this revision.May 19 2020, 9:41 AM
jpienaar marked an inline comment as done.

Thanks

mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
139

No period at the end please (summary is sentence fragment)

mlir/lib/Dialect/Shape/IR/Shape.cpp
212

Seems like we could just have constantShapeReturn function which all the inferReturnType could call [I did a version where it was "trait" that reduced a lot of repetition which I should perhaps clean up a bit - doesn't add anything truly new, just packages]

This revision is now accepted and ready to land.May 19 2020, 9:41 AM
silvas updated this revision to Diff 265039.May 19 2020, 2:24 PM
silvas marked 2 inline comments as done.

Address comments.

mlir/lib/Dialect/Shape/IR/Shape.cpp
212

I want to avoid that because I specifically want to make this ugly to show the hole in the infra (and eventually make myself fix it :) ). If all result types are buildable types then this should be autogenerated somehow. (as a stretch goal unifying with the type inference logic used by the declarative asm parser)

This revision was automatically updated to reflect the committed changes.