[Mlir-commits] [mlir] [mlir][vector] Refine vectorisation of tensor.extract (PR #109580)
Andrzej WarzyĆski
llvmlistbot at llvm.org
Mon Sep 23 10:59:46 PDT 2024
================
@@ -1012,7 +1019,10 @@ getTensorExtractMemoryAccessPattern(tensor::ExtractOp extractOp,
bool foundIndexOp = false;
bool isContiguousLoad = isContiguousLoadIdx(linalgOp, extractOpTrailingIdx,
foundIndexOp, resType);
- isContiguousLoad &= foundIndexOp;
+ // TODO: Support generating contiguous loads for column vectors - that will
+ // require adding a permutation map to tranfer_read Ops.
+ bool isRowVector = resType.getShape().back() != 1;
+ isContiguousLoad &= (foundIndexOp && isRowVector);
----------------
banach-space wrote:
See for _which_ indices we call `isLoopInvariantIdx`: https://github.com/llvm/llvm-project/blob/1c47fa9b620d0abb280647b4f361ada43784d00e/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp#L974-L991
In particular, look at this line:
```cpp
// The trailing index is not analysed here
auto leadIndices = indices.drop_back(1);
```
The trailing index is analysed separately further down: https://github.com/llvm/llvm-project/blob/1c47fa9b620d0abb280647b4f361ada43784d00e/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp#L1013
https://github.com/llvm/llvm-project/pull/109580
More information about the Mlir-commits
mailing list