This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Add lowering for IsBroadcastable to Std dialect.
ClosedPublic

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

Diff Detail

Event Timeline

tpopp created this revision.Oct 29 2020, 9:39 AM
tpopp requested review of this revision.Oct 29 2020, 9:39 AM
tpopp added inline comments.Oct 29 2020, 9:42 AM
mlir/lib/Conversion/ShapeToStandard/ShapeToStandard.cpp
571

Just a note. I have deleted this locally.

frgossen accepted this revision.Oct 29 2020, 10:04 AM

Looks good!

mlir/lib/Conversion/ShapeToStandard/ShapeToStandard.cpp
228

If you want to enforce this, you can compare the types below to shape::getExtentTensorType.

mlir/test/Conversion/ShapeToStandard/shape-to-standard.mlir
394

nit: indentation

403

Maybe test this with one shape of statically known rank?

409

Name, e.g. I

412

SMALLER_EXTENT_INDEX?

This revision is now accepted and ready to land.Oct 29 2020, 10:04 AM
tpopp marked 4 inline comments as done.Oct 30 2020, 2:41 AM

I'm going to land this with these changes because the code was already in another commit and didn't receive any strong negative feedback, so I'm hoping there are only nits left if anything. I will follow up on any comments.

mlir/lib/Conversion/ShapeToStandard/ShapeToStandard.cpp
228

Right now this is enforced by checking that neither input is a Shape. I'm going to leave this to ease future find replace when this is changed because I copied this from Broadcast lowering in this file.

This revision was landed with ongoing or failed builds.Oct 30 2020, 2:44 AM
This revision was automatically updated to reflect the committed changes.