[Mlir-commits] [mlir] [MLIR] Fix VectorEmulateNarrowType constant op mask bug (PR #116064)

Andrzej WarzyƄski llvmlistbot at llvm.org
Thu Nov 14 08:20:40 PST 2024


================
@@ -249,3 +249,41 @@ func.func @vector_maskedload_i2_dynamic_indexing_mixed(%passthru: vector<3xi2>,
 // CHECK: %[[IN8:.+]] = vector.insert %[[EX8]], %[[IN7]] [1] : i2 into vector<3xi2>
 // CHECK: %[[EX9:.+]] = vector.extract %[[SELECT]][%[[INCIDX2]]] : i2 from vector<8xi2>
 // CHECK: %[[IN9:.+]] = vector.insert %[[EX9]], %[[IN8]] [2] : i2 into vector<3xi2>
+
+// -----
+
+func.func @vector_maskedload_i4_constant_mask_unaligned(%passthru: vector<5xi2>) -> vector<5xi2> {
+  %0 = memref.alloc() : memref<3x5xi2>
+  %mask = arith.constant dense<[false, true, true, true, false]> : vector<5xi1>
+  %c0 = arith.constant 0 : index
+  %c1 = arith.constant 1 : index
+  %1 = vector.maskedload %0[%c1, %c0], %mask, %passthru :
----------------
banach-space wrote:

IIUC, the key element of this example is the offset in the `vector.maskedload` operation? If that's the case, then it would be good to highlight the corresponding offset in the expected output. Either with a comment or clear LIT variable name. Also, using a higher value (e.g. "3", as a prime number, is nice) might be easier to illustrate what's happening here. "1" and "0" are super common and therefore it's hard to see them being propagated in tests.

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


More information about the Mlir-commits mailing list