[Mlir-commits] [mlir] [mlir][memref] `memref.subview`: Verify result strides (PR #79865)

Matthias Springer llvmlistbot at llvm.org
Thu Feb 1 00:12:52 PST 2024


matthias-springer wrote:

You can insert a `memref.cast` to turn the static stride into a dynamic one:
```
    %1 = memref.subview %alloca[0, 0] [%0, %0] [1, 1] : memref<16x16xi32> to memref<?x?xi32, strided<[16, 1]>>
    %cast = memref.cast %1 : memref<?x?xi32, strided<[16, 1]>> to memref<?x?xi32, strided<[?, 1]>>
    %2 = memref.subview %cast[%o0, %o1][%c1, %0][1, 1] : memref<?x?xi32, strided<[?, 1]>> to memref<?x?xi32, strided<[?, 1], offset: ?>>
```


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


More information about the Mlir-commits mailing list