[Mlir-commits] [llvm] [mlir] [Linalg] Fix crash in vectorizeScalableVectorPrecondition with undersized vector sizes (PR #205493)

Andrzej WarzyƄski llvmlistbot at llvm.org
Thu Jun 25 08:20:20 PDT 2026


================
@@ -19,3 +19,29 @@ module attributes {transform.with_named_sequence} {
     transform.yield
   }
 }
+
+// -----
+
+// RUN: mlir-opt %s -transform-interpreter -verify-diagnostics
+// Regression test for bug #204100.
+// Assertion idx < size() in SmallVector.h used to happen here.
+// CHECK-LABEL: func @add_dynamic
+module {
+  func.func @add_dynamic(%arg0: memref<?x?xbf16>, %arg1: memref<?x?xbf16>, %arg2: memref<?x?xbf16>) {
+    linalg.add ins(%arg0, %arg1 : memref<?x?xbf16>, memref<?x?xbf16>) outs(%arg2 : memref<?x?xbf16>)
+    return
+  }
+  module attributes {transform.with_named_sequence} {
+    transform.named_sequence @__transform_main(%arg0: !transform.any_op {transform.readonly}) {
+      %0 = transform.structured.match ops{["linalg.add"]} in %arg0 : (!transform.any_op) -> !transform.any_op
+      // This combination was crashing (static/dynamic mismatch)
+      transform.structured.vectorize %0 vector_sizes [8, [16], 4] : !transform.any_op
+      // expected-error @above {{Attempted to vectorize, but failed}}
+      transform.yield
+    }
+  }
+}
+
+
+
+
----------------
banach-space wrote:

Please avoid spurious empty lines.

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


More information about the Mlir-commits mailing list