[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 06:34:32 PST 2026
================
@@ -122,6 +122,20 @@ static bool isBoolScalarOrVector(Type type) {
return false;
}
+/// Returns true if the given `type` is an integer scalar or vector type.
+static bool isIntScalarOrVectorType(Type type) {
+ auto eltTy = getElementTypeOrSelf(type);
+ return eltTy && isa<IntegerType>(eltTy) &&
+ (isa<IntegerType>(type) || isa<VectorType>(type));
+}
+
+/// Returns true if the given `type` is an integer or float scalar or vector.
+static bool isIntOrFloatScalarOrVectorType(Type type) {
+ auto eltTy = getElementTypeOrSelf(type);
+ return eltTy && eltTy.isIntOrFloat() &&
+ (isa<VectorType>(type) || type == eltTy);
+}
----------------
kuhar wrote:
```suggestion
```
https://github.com/llvm/llvm-project/pull/179009
More information about the Mlir-commits
mailing list