Skip to content

Conversation

newling
Copy link
Contributor

@newling newling commented Aug 19, 2025

Bug introduced in
#93664

The bug was fixed in
#152957

But there was no test. This PR adds a test that hits the assertion failure if the fix is reverted (if I change dyn_cast to cast).

@llvmbot
Copy link
Member

llvmbot commented Aug 19, 2025

@llvm/pr-subscribers-mlir

Author: James Newling (newling)

Changes

Bug introduced in
#93664

Fixed without test in
#152957

This new test hits an assertion failure if the fix is reverted (if I change dyn_cast to cast).


Full diff: https://github.com/llvm/llvm-project/pull/154434.diff

1 Files Affected:

  • (modified) mlir/test/Dialect/Vector/transform-vector.mlir (+7)
diff --git a/mlir/test/Dialect/Vector/transform-vector.mlir b/mlir/test/Dialect/Vector/transform-vector.mlir
index 4b38db79bff3e..524a4f429211b 100644
--- a/mlir/test/Dialect/Vector/transform-vector.mlir
+++ b/mlir/test/Dialect/Vector/transform-vector.mlir
@@ -121,6 +121,13 @@ func.func @arith_to_outerproduct_trans_rhs_f32(%lhs: vector<16xf32>, %rhs: vecto
   return %mul: vector<8x16xf32>
 }
 
+// See https://github.com/llvm/llvm-project/pull/152957
+// CHECK-LABEL: func.func @negative_non_vector_type
+func.func @negative_non_vector_type(%lhs: f32, %rhs: f32) -> f32 {
+  %mul = arith.mulf %lhs, %rhs : f32
+  return %mul: f32
+}
+
 module attributes {transform.with_named_sequence} {
   transform.named_sequence @__transform_main(%module_op: !transform.any_op {transform.readonly}) {
     %func = transform.structured.match ops{["func.func"]} in %module_op : (!transform.any_op) -> !transform.any_op

@llvmbot
Copy link
Member

llvmbot commented Aug 19, 2025

@llvm/pr-subscribers-mlir-vector

Author: James Newling (newling)

Changes

Bug introduced in
#93664

Fixed without test in
#152957

This new test hits an assertion failure if the fix is reverted (if I change dyn_cast to cast).


Full diff: https://github.com/llvm/llvm-project/pull/154434.diff

1 Files Affected:

  • (modified) mlir/test/Dialect/Vector/transform-vector.mlir (+7)
diff --git a/mlir/test/Dialect/Vector/transform-vector.mlir b/mlir/test/Dialect/Vector/transform-vector.mlir
index 4b38db79bff3e..524a4f429211b 100644
--- a/mlir/test/Dialect/Vector/transform-vector.mlir
+++ b/mlir/test/Dialect/Vector/transform-vector.mlir
@@ -121,6 +121,13 @@ func.func @arith_to_outerproduct_trans_rhs_f32(%lhs: vector<16xf32>, %rhs: vecto
   return %mul: vector<8x16xf32>
 }
 
+// See https://github.com/llvm/llvm-project/pull/152957
+// CHECK-LABEL: func.func @negative_non_vector_type
+func.func @negative_non_vector_type(%lhs: f32, %rhs: f32) -> f32 {
+  %mul = arith.mulf %lhs, %rhs : f32
+  return %mul: f32
+}
+
 module attributes {transform.with_named_sequence} {
   transform.named_sequence @__transform_main(%module_op: !transform.any_op {transform.readonly}) {
     %func = transform.structured.match ops{["func.func"]} in %module_op : (!transform.any_op) -> !transform.any_op

@newling newling changed the title [Vector] Test to accompany bug fix [MLIR][Vector] Test to accompany bug fix Aug 19, 2025
@newling newling merged commit a64e6f4 into llvm:main Aug 21, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants