This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][Shape] Simplify `get_extent` when dependent on `from_extent_tensor`
AbandonedPublic

Authored by frgossen on Jun 17 2020, 8:05 AM.

Details

Summary

Simplify pattern of successive shape.get_extent and shape.from_extent_tensor
operations and express them with the standard operation extract_element.
This transformation later circumvents the necessity to materialize shapes in
memory.

Depends On D81871

Diff Detail

Event Timeline

frgossen created this revision.Jun 17 2020, 8:05 AM
Herald added a project: Restricted Project. · View Herald Transcript
frgossen retitled this revision from [MLIR][Shape] Lower `get_extent` when dependent on `from_extent_tensor` to [MLIR][Shape] Simplify `get_extent` when dependent on `from_extent_tensor`.Jun 17 2020, 8:10 AM
frgossen edited the summary of this revision. (Show Details)
frgossen added reviewers: herhut, pifon2a.
pifon2a accepted this revision.Jun 17 2020, 8:54 AM
pifon2a added inline comments.
mlir/lib/Dialect/Shape/Transforms/SimplifyShapePatterns.td
4 ↗(On Diff #271376)

is this really needed?

This revision is now accepted and ready to land.Jun 17 2020, 8:54 AM
frgossen marked an inline comment as done.Jun 17 2020, 8:58 AM
frgossen added inline comments.
mlir/lib/Dialect/Shape/Transforms/SimplifyShapePatterns.td
4 ↗(On Diff #271376)

Unfortunately, yes.
I tried to get away with out this and it seems that the declarative rewrite patterns can deal with variadic arguments but not with ValueRange.
I'd be happy if someone knows a nice solution.

frgossen marked an inline comment as done.Jun 17 2020, 9:20 AM
herhut accepted this revision.Jun 18 2020, 1:27 AM
frgossen updated this revision to Diff 271652.Jun 18 2020, 4:03 AM

Inline NativeCodeCall

frgossen marked an inline comment as done.Jun 18 2020, 4:03 AM