================ @@ -630,7 +639,10 @@ class FlattenContiguousRowMajorTransferReadPattern if (transferReadOp.getMask()) return failure(); - int64_t firstDimToCollapse = sourceType.getRank() - vectorType.getRank(); ---------------- momchil-velikov wrote:
With leading unit dimensions of a vector, the memref might not even be contiguous on that many dimensions. Example: `memref<2x2x2xi8, strided<[8, 4, 1]>` and `vector<1x1x2xi8>` Another consideration, in principle a memref can be collapsed in several different ways for given memref and vector types, anywhere from losing just one dimension to just one dimension remaining. I've chosen to do maximum collapsing, as it seems simpler to do, and the resulting IR is arguably simpler. https://github.com/llvm/llvm-project/pull/142422 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits