[Mlir-commits] [mlir] [mlir][spirv] Add pattern matching for arith.index_cast index to i1 for ArithToSPIRV (PR #156031)

Ian Li llvmlistbot at llvm.org
Tue Sep 2 10:35:11 PDT 2025


================
@@ -734,6 +734,14 @@ func.func @index_castui4(%arg0: index) {
   return
 }
 
+// CHECK-LABEL: index_castindexi1
+func.func @index_castindexi1(%arg0 : index) {
+  // CHECK: %[[ZERO:.+]] = spirv.Constant 0 : i32
+  // CHECK: spirv.INotEqual %[[ZERO]], %{{.+}} : i32
+  %0 = arith.index_cast %arg0 : index to i1
----------------
ianayl wrote:

That's a good point, thanks for the catch! I've also gone ahead and added test cases for vectors.

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


More information about the Mlir-commits mailing list