This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][Shape] Support transforming shape.num_elements on tensors
ClosedPublic

Authored by herhut on Jul 28 2020, 4:24 AM.

Details

Summary

The current transformation to shape.reduce does not support tensor values.
This adds the required changes to make that work, including fixing the builder
for shape.reduce.

Diff Detail

Event Timeline

herhut created this revision.Jul 28 2020, 4:24 AM
Herald added a project: Restricted Project. · View Herald Transcript
herhut published this revision for review.Jul 28 2020, 4:25 AM
herhut added a reviewer: frgossen.
frgossen accepted this revision.Jul 28 2020, 4:31 AM
This revision is now accepted and ready to land.Jul 28 2020, 4:31 AM
frgossen added inline comments.Jul 28 2020, 4:36 AM
mlir/lib/Dialect/Shape/IR/Shape.cpp
839

I think these braces can be removed.

mlir/lib/Dialect/Shape/Transforms/ShapeToShapeLowering.cpp
68

In most other places, the legal dialects are listed in the template parameters.
addLegalDialect<ShapeDialect, StandardOpsDialect>()

herhut updated this revision to Diff 281192.Jul 28 2020, 5:10 AM

Comments on formatting

herhut marked 2 inline comments as done.Jul 28 2020, 5:11 AM

Thanks!

This revision was landed with ongoing or failed builds.Jul 28 2020, 5:13 AM
This revision was automatically updated to reflect the committed changes.