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.
Details
- Reviewers
nicolasvasilache aartbik rriddle ftynse
Diff Detail
Event Timeline
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.
I'm abandoning this change as it is not needed after https://reviews.llvm.org/D85244.