This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Add scalar tests for `Same*Shape` traits.
Needs ReviewPublic

Authored by arames on Sep 29 2021, 1:06 PM.

Details

Summary

The Same*Shape traits allow scalars.

Diff Detail

Event Timeline

arames created this revision.Sep 29 2021, 1:06 PM
arames requested review of this revision.Sep 29 2021, 1:06 PM

Personally I think we should deprecate this behavior. In my mind, an i1 doesn't have a shape at all. So it doesn't make sense to say it has the same shape as anything else. Is there a specific use case for this behavior (IIRC this might have fallen out of an implementation detail of an earlier implementation of the trait).

Personally I think we should deprecate this behavior. In my mind, an i1 doesn't have a shape at all. So it doesn't make sense to say it has the same shape as anything else. Is there a specific use case for this behavior (IIRC this might have fallen out of an implementation detail of an earlier implementation of the trait).

Not that I am aware of or care about. I would be fine restricting it.
This was just cleaning on the way as I was implementing type inference for the Same*Shape interfaces.

silvas added a subscriber: herhut.Sep 29 2021, 2:22 PM

@herhut - thoughts on keeping scalars (i1) as disallowed from Same*Shape traits?

@herhut - thoughts on keeping scalars (i1) as disallowed from Same*Shape traits?

Note that this is now out of the chain of reviews, as these interfaces will be handled by providing a default implementation of InferTypeOpInterface instead of having a special path in the type inference.