This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Add shape.is_broadcastable.
AbandonedPublic

Authored by tpopp on Oct 29 2020, 9:27 AM.

Details

Summary

This op returns a boolean value indicating whether 2 ops are
broadcastable or not. This follows the same logic as the other ops with
broadcast in their names in the shape dialect.

Concretely, shape.is_broadcastable returning true implies that
shape.broadcast will not give an error, and shape.cstr_broadcastable
will not result in an assertion failure. Similarly, false implies an
error or assertion failure.

Diff Detail

Event Timeline

tpopp created this revision.Oct 29 2020, 9:27 AM
tpopp requested review of this revision.Oct 29 2020, 9:27 AM
silvas accepted this revision.Oct 29 2020, 5:23 PM
jpienaar accepted this revision.Oct 30 2020, 9:16 PM

Thanks

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

Could you document error case here too? (You do in change summary)

202

attr-dict before : (we are inconsistent here, and I should fix that, but that closer correspondence to generic & std and reads more naturally IMHO)

This revision is now accepted and ready to land.Oct 30 2020, 9:16 PM
frgossen accepted this revision.Nov 2 2020, 1:32 AM
tpopp abandoned this revision.Nov 3 2020, 12:42 AM

Somehow I submitted this already, but the commit detached from this review. I am abandoning this change, so it goes away, but I will handle feedback in a follow up commit.