This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Allow ShapedTypeComponents with attribute in inferReturnTensorTypes
ClosedPublic

Authored by Smit on Dec 4 2022, 12:50 AM.

Details

Summary

Originally, inferReturnTensorTypes didn't support shaped type components
containing an attribute just because there wasn't any motivating use-case.
Removing that limitation and using it to set the encoding attribute for
RankedTensorType.

Updated the existing test to set result attribute based on the first operand,
if available.

Signed-off-by: Smit Hinsu <smittvhinsu@gmail.com>

Diff Detail

Event Timeline

Smit created this revision.Dec 4 2022, 12:50 AM
Smit edited the summary of this revision. (Show Details)Dec 4 2022, 12:52 AM
Smit added a subscriber: burmako.
Smit updated this revision to Diff 479903.Dec 4 2022, 12:53 AM

Allow ShapedTypeComponents with attribute in inferReturnTensorTypes

Smit published this revision for review.Dec 4 2022, 12:58 AM
Smit retitled this revision from Allow ShapedTypeComponents with attribute in inferReturnTensorTypes to [MLIR} Allow ShapedTypeComponents with attribute in inferReturnTensorTypes.Dec 4 2022, 2:20 AM
Smit retitled this revision from [MLIR} Allow ShapedTypeComponents with attribute in inferReturnTensorTypes to [MLIR] Allow ShapedTypeComponents with attribute in inferReturnTensorTypes.
Smit edited the summary of this revision. (Show Details)Dec 4 2022, 4:47 PM

Looks good in general (I'll land in a bit) with regular caveat that encodings are open and downstream users may need to be more restrictive.

mlir/test/lib/Dialect/Test/TestDialect.cpp
1185

Elide single line braces.

Smit updated this revision to Diff 480587.Dec 6 2022, 12:57 PM

Removing single line braces

Smit marked an inline comment as done.Dec 6 2022, 1:05 PM
Smit updated this revision to Diff 480591.Dec 6 2022, 1:11 PM

Rebased

Smit updated this revision to Diff 480594.Dec 6 2022, 1:16 PM

Merged with original commit

This revision was not accepted when it landed; it landed in state Needs Review.Dec 7 2022, 5:21 PM
This revision was automatically updated to reflect the committed changes.