[Mlir-commits] [mlir] [mlir][vector] Fix fold result for empty vector.mask with no results (PR #180345)

Andrzej WarzyƄski llvmlistbot at llvm.org
Thu Feb 12 11:49:55 PST 2026


================
@@ -772,3 +772,14 @@ func.func @arith_truncf(%arg0: f64) -> f16 {
 
   return %truncd1 : f16
 }
+
+// -----
+
+// Ensure that vector.mask with an empty mask does not cause issues.
+
+// CHECK-LABEL: empty_vector_mask
+func.func @empty_vector_mask(%mask : vector<8xi1>) {
+  // CHECK: vector.mask
+  vector.mask %mask { vector.yield } : vector<8xi1>
+  return
+}
----------------
banach-space wrote:

> I added this test case in arith-to-emitc.mlir to test the tryFold function invoked during conversion.

We should not be adding tests for `Vector` in location unrelated to `Vector` (and the "mlir/test/Conversion/ArithToEmitC/ " dir is unrelated to `Vector`).

IMO we can ignore testing for this change - it's not the first time that we discover that it's tricky to test folding in isolation. AFAIK, we don't have appropriate tools for that.

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


More information about the Mlir-commits mailing list