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

Jakub Kuderski llvmlistbot at llvm.org
Wed Feb 4 16:46:47 PST 2026


================
@@ -708,13 +728,20 @@ struct ExtSIPattern final : public OpConversionPattern<arith::ExtSIOp> {
   matchAndRewrite(arith::ExtSIOp op, OpAdaptor adaptor,
                   ConversionPatternRewriter &rewriter) const override {
     Type srcType = adaptor.getIn().getType();
-    if (isBoolScalarOrVector(srcType))
-      return failure();
+
+    // extSI is only meaningful for integer scalar/vector types in SPIR-V.
+    if (!isScalarOrVectorOfScalar(srcType, /*excludeBool=*/true))
+      return rewriter.notifyMatchFailure(
+          op, "expected integer scalar or vector input type");
 
     Type dstType = getTypeConverter()->convertType(op.getType());
----------------
kuhar wrote:

@efric told me that we convert tensor types to spirv.array. If this is the case, this implementation is OK.

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


More information about the Mlir-commits mailing list