This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Interfaces] Extract MixedOffsetsOpInterface from OffsetSizeAndStrideOpInterface
AbandonedPublic

Authored by springerm on Aug 2 2023, 7:30 AM.

Details

Summary

This revision splits OffsetSizeAndStrideOpInterface into two interfaces: OffsetSizeAndStrideOpInterface and MixedOffsetsOpInterface. The latter interface can be implemented by ops that have indices/offsets but not sizes or strides.

Depends On: D156871

Diff Detail

Event Timeline

springerm created this revision.Aug 2 2023, 7:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2023, 7:30 AM
springerm requested review of this revision.Aug 2 2023, 7:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2023, 7:30 AM
springerm edited the summary of this revision. (Show Details)Aug 2 2023, 7:31 AM
nicolasvasilache accepted this revision.Aug 2 2023, 7:32 AM
This revision is now accepted and ready to land.Aug 2 2023, 7:32 AM
mravishankar requested changes to this revision.Aug 2 2023, 7:56 AM

Does the new interface have to be offsets? It could be any mixed static/dynamic set of indices? Maybe the interfaces name should not be tied to offsets?

This revision now requires changes to proceed.Aug 2 2023, 7:56 AM
dcaballe accepted this revision.Aug 2 2023, 9:44 AM

Thanks, Matthias! LGTM

Does the new interface have to be offsets? It could be any mixed static/dynamic set of indices? Maybe the interfaces name should not be tied to offsets?

I think the problem is that offsets, sizes and strides have basically the same API with a different name so if we make one generic it' won't be clear what it refers to in ops that have the three. Perhaps a follow up step would be to refactor these interfaces into a generic one that allows an arbitrary number of mixed type operands. The API methods would be more generic but it would allows to use it for cases that are not offsets, sizes and strides.

There's also the question of why we need these interfaces altogether when we could represent constant indices with constant ops, but that's a separate discussion :)

I think the problem is that offsets, sizes and strides have basically the same API with a different name

exactly that’s the reason. the existing interface uses the term “offsets” and i wanted to use interface inheritance to avoid code duplication.

mravishankar resigned from this revision.Aug 2 2023, 1:30 PM

I think the problem is that offsets, sizes and strides have basically the same API with a different name

exactly that’s the reason. the existing interface uses the term “offsets” and i wanted to use interface inheritance to avoid code duplication.

I see what you are saying, but I am echoing what Diego is saying. We should have one interface that allows representing a list of mixed constant and dynamic values. Then the offsets, sizes and strides, uses that interface. This inheritance is kind of strange. Anyway, removing my blocker here.

This revision is now accepted and ready to land.Aug 2 2023, 1:30 PM
springerm abandoned this revision.Aug 7 2023, 11:44 PM