[Mlir-commits] [mlir] [memref] Support non-scalar copies in `reinterpret_cast` elision (PR #203873)

Andrzej WarzyƄski llvmlistbot at llvm.org
Wed Jun 17 09:55:05 PDT 2026


================
@@ -42,26 +47,31 @@ static std::optional<SmallVector<int64_t>> getIdentityStrides(MemRefType type) {
   return strides;
 }
 
+/// Non-unit strided memref dimensions are lowered to loops over base memref
+/// dimensions. Static reinterpret_cast strides connect those dimension spaces
+/// in the currently supported cases.
----------------
banach-space wrote:

Similarly to `getIdentityStrides`, this description refers to implementation details of the user of this method. Please try to avoid that and document this method in more general terms. 

As a guiding principle, it should be possible to understand what the method does without viewing how the method is used in `getCopyFromReinterCastInfo`. That's currently obscured.

https://github.com/llvm/llvm-project/pull/203873


More information about the Mlir-commits mailing list