Skip to content

[MLIR][ArmNeon] Add a couple of negative tests for BFMMLA with scalable dimensions #145882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

momchil-velikov
Copy link
Collaborator

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Jun 26, 2025

@llvm/pr-subscribers-mlir-neon

@llvm/pr-subscribers-mlir

Author: Momchil Velikov (momchil-velikov)

Changes

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

1 Files Affected:

  • (modified) mlir/test/Dialect/ArmNeon/invalid.mlir (+20)
diff --git a/mlir/test/Dialect/ArmNeon/invalid.mlir b/mlir/test/Dialect/ArmNeon/invalid.mlir
index 989293a3508b4..00d489b639191 100644
--- a/mlir/test/Dialect/ArmNeon/invalid.mlir
+++ b/mlir/test/Dialect/ArmNeon/invalid.mlir
@@ -114,6 +114,16 @@ func.func @bfmmla_invalid_dimension_lhs_rhs(%acc: vector<4xf32>,
 
 // -----
 
+func.func @bfmmla_scalable_dimension_lhs_rhs(%acc: vector<4xf32>,
+                                             %lhs: vector<[8]xbf16>,
+                                             %rhs: vector<[8]xbf16>) -> vector<4xf32> {
+  // expected-error@+1 {{operand #1 must be a vector with length 8 of bfloat16 type values, but got 'vector<[8]xbf16>'}}
+  %0 = arm_neon.intr.bfmmla %acc, %lhs, %rhs : vector<[8]xbf16> to vector<4xf32>
+  return %0 : vector<4xf32>
+}
+
+// -----
+
 func.func @bfmmla_invalid_element_type_acc(%acc: vector<4xi32>,
                                            %lhs: vector<8xbf16>,
                                            %rhs: vector<8xbf16>) -> vector<4xi32> {
@@ -131,3 +141,13 @@ func.func @bfmmla_invalid_dimension_acc(%acc: vector<8xf32>,
   %0 = arm_neon.intr.bfmmla %acc, %lhs, %rhs : vector<8xbf16> to vector<8xf32>
   return %0 : vector<8xf32>
 }
+
+// -----
+
+func.func @bfmmla_scalable_dimension_acc(%acc: vector<[4]xf32>,
+                                         %lhs: vector<8xbf16>,
+                                         %rhs: vector<8xbf16>) -> vector<[4]xf32> {
+  // expected-error@+1 {{op operand #0 must be a vector with length 4 of 32-bit float values, but got 'vector<[4]xf32>'}}
+  %0 = arm_neon.intr.bfmmla %acc, %lhs, %rhs : vector<8xbf16> to vector<[4]xf32>
+  return %0 : vector<[4]xf32>
+}

Copy link
Contributor

@banach-space banach-space left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@momchil-velikov
Copy link
Collaborator Author

Normally, I'll wait for a while before committing, but this change seems unlikely to cause much uproar and commotion, so I'll risk it and go ahead and commit.

@momchil-velikov momchil-velikov merged commit e0b83ca into main Jun 26, 2025
10 checks passed
@momchil-velikov momchil-velikov deleted the users/momchil-velikov/bfmmla-neon-followup-tests branch June 26, 2025 16:10
anthonyhatran pushed a commit to anthonyhatran/llvm-project that referenced this pull request Jun 26, 2025
rlavaee pushed a commit to rlavaee/llvm-project that referenced this pull request Jul 1, 2025
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