This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][Shape] Expose extent tensor type builder
ClosedPublic

Authored by frgossen on Aug 3 2020, 4:42 AM.

Details

Summary

The extent tensor type is a tensor<?xindex> that is used in the shape dialect.
To facilitate the use of this type when working with the shape dialect, we
expose the helper function for its construction.

Diff Detail

Event Timeline

frgossen created this revision.Aug 3 2020, 4:42 AM
Herald added a reviewer: silvas. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
frgossen requested review of this revision.Aug 3 2020, 4:42 AM
pifon2a accepted this revision.Aug 3 2020, 4:48 AM
pifon2a added inline comments.
mlir/lib/Dialect/Shape/IR/Shape.cpp
716–719

will

Type type = arg.getType().isa<ShapedType>() 
     ? getExtentTensorType(builder.getContext())
     : builder.getType<ShapeType>();

work?

frgossen updated this revision to Diff 282592.Aug 3 2020, 5:11 AM

Address comment

mlir/lib/Dialect/Shape/IR/Shape.cpp
716–719

Tried that first but it does not work without explicit casts: "incompatible operand types".

frgossen marked an inline comment as done.Aug 3 2020, 5:11 AM
This revision was not accepted when it landed; it landed in state Needs Review.Aug 5 2020, 2:44 AM
This revision was automatically updated to reflect the committed changes.