[Mlir-commits] [mlir] [MLIR] Implement emulation of static indexing subbyte type vector stores (PR #115922)

Andrzej WarzyƄski llvmlistbot at llvm.org
Thu Jan 16 09:52:19 PST 2025


================
@@ -336,30 +442,178 @@ struct ConvertVectorStore final : OpConversionPattern<vector::StoreOp> {
     // vector.store %bitcast, %alloc[%linear_index] : memref<16xi8>,
     // vector<4xi8>
 
-    auto origElements = op.getValueToStore().getType().getNumElements();
-    if (origElements % scale != 0)
-      return failure();
+    auto origElements = valueToStore.getType().getNumElements();
+    bool isAlignedEmulation = origElements % numSrcElemsPerDest == 0;
----------------
banach-space wrote:

Please double check, but I think that this definition of "aligned" is only covering point 1. from https://github.com/llvm/llvm-project/blob/5a90168fa34e15b544d7749ca4d247a16d360119/mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp#L1072-L1079

If you agree, I'll try to propose something - we should use consistent definition throughout this file. 

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


More information about the Mlir-commits mailing list