[Mlir-commits] [mlir] [mlir][spirv] Fix crash in ArithToSPIRV trunc-i lowering on tensor types (PR #179009)

Jakub Kuderski llvmlistbot at llvm.org
Mon Feb 2 09:49:29 PST 2026


================
@@ -122,6 +122,26 @@ static bool isBoolScalarOrVector(Type type) {
   return false;
 }
 
+/// Returns true if `type` is a SPIR-V scalar type or a vector of SPIR-V scalar.
+/// If `excludeBool` is true, i1/bool types are excluded.
+static bool isScalarOrVectorOfScalar(Type type, bool excludeBool = false) {
+  auto isScalarOk = [&](Type t) {
+    if (!isa<spirv::ScalarType>(t))
+      return false;
+    if (excludeBool && t.isInteger(1))
+      return false;
+    return true;
----------------
kuhar wrote:

```suggestion
    if (excludeBool && t.isInteger(1))
      return false;
    return isa<spirv::ScalarType>(t);
```

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


More information about the Mlir-commits mailing list