Skip to content

Commit 9d34013

Browse files
momchil-velikovAnthony Tran
authored andcommitted
[MLIR][ArmNeon] Add a couple of negative tests for BFMMLA with scalable dimensions (llvm#145882)
1 parent 9fcdd21 commit 9d34013

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

mlir/test/Dialect/ArmNeon/invalid.mlir

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,16 @@ func.func @bfmmla_invalid_dimension_lhs_rhs(%acc: vector<4xf32>,
114114

115115
// -----
116116

117+
func.func @bfmmla_scalable_dimension_lhs_rhs(%acc: vector<4xf32>,
118+
%lhs: vector<[8]xbf16>,
119+
%rhs: vector<[8]xbf16>) -> vector<4xf32> {
120+
// expected-error@+1 {{operand #1 must be a vector with length 8 of bfloat16 type values, but got 'vector<[8]xbf16>'}}
121+
%0 = arm_neon.intr.bfmmla %acc, %lhs, %rhs : vector<[8]xbf16> to vector<4xf32>
122+
return %0 : vector<4xf32>
123+
}
124+
125+
// -----
126+
117127
func.func @bfmmla_invalid_element_type_acc(%acc: vector<4xi32>,
118128
%lhs: vector<8xbf16>,
119129
%rhs: vector<8xbf16>) -> vector<4xi32> {
@@ -131,3 +141,13 @@ func.func @bfmmla_invalid_dimension_acc(%acc: vector<8xf32>,
131141
%0 = arm_neon.intr.bfmmla %acc, %lhs, %rhs : vector<8xbf16> to vector<8xf32>
132142
return %0 : vector<8xf32>
133143
}
144+
145+
// -----
146+
147+
func.func @bfmmla_scalable_dimension_acc(%acc: vector<[4]xf32>,
148+
%lhs: vector<8xbf16>,
149+
%rhs: vector<8xbf16>) -> vector<[4]xf32> {
150+
// expected-error@+1 {{op operand #0 must be a vector with length 4 of 32-bit float values, but got 'vector<[4]xf32>'}}
151+
%0 = arm_neon.intr.bfmmla %acc, %lhs, %rhs : vector<8xbf16> to vector<[4]xf32>
152+
return %0 : vector<[4]xf32>
153+
}

0 commit comments

Comments
 (0)