This is an archive of the discontinued LLVM Phabricator instance.

[mlir][vector] Add experimental memref cast operation.
AbandonedPublic

Authored by ThomasRaoux on Jul 31 2020, 4:39 PM.

Details

Summary

Add an experimental op to be able to cast static memref to a memref of the same size with different shape/element type. This would lower to a pointer bitcast.
This is needed for vector to GPU path as we need to be able to load/store from memref with different granularity.

Diff Detail

Event Timeline

ThomasRaoux created this revision.Jul 31 2020, 4:39 PM
Herald added a project: Restricted Project. · View Herald Transcript
ThomasRaoux requested review of this revision.Jul 31 2020, 4:39 PM

Does this op really belong to the vector dialect?

It seems like you're plugging a hole somewhere, but it isn't clear what or why this is desirable. Can you explain this in a thread on Discourse?

Does this op really belong to the vector dialect?

It seems like you're plugging a hole somewhere, but it isn't clear what or why this is desirable. Can you explain this in a thread on Discourse?

I agree that understanding the need better would help. We already have reshape/type_cast/shape_cast ops with somewhat specific behaviors, and I want to make sure we design the right operations (preferable just a few).

Does this op really belong to the vector dialect?

It seems like you're plugging a hole somewhere, but it isn't clear what or why this is desirable. Can you explain this in a thread on Discourse?

I agree that understanding the need better would help. We already have reshape/type_cast/shape_cast ops with somewhat specific behaviors, and I want to make sure we design the right operations (preferable just a few).

Sounds good, I started a discussion here: https://llvm.discourse.group/t/memref-cast/1514
The reason why I added it to the vector dialect was because it seemed analogue to the existing vector.type_cast and it is meant to be used for vectorization. However I understand this may be confusing and I don't have a strong opinion on this.

ThomasRaoux abandoned this revision.Aug 5 2020, 11:55 AM

I'm abandoning this change as it is not needed after https://reviews.llvm.org/D85244.