Skip to content

Commit 99c5d23

Browse files
committed
Reorder tests
1 parent d1e4983 commit 99c5d23

File tree

1 file changed

+47
-47
lines changed

1 file changed

+47
-47
lines changed

mlir/test/Dialect/Vector/vector-sink.mlir

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -211,53 +211,6 @@ func.func @negative_op_only_supports_vectors(%arg0 : f32) -> vector<1xf32> {
211211
return %1 : vector<1xf32>
212212
}
213213

214-
//===----------------------------------------------------------------------===//
215-
// [Pattern: ReorderCastOpsOnBroadcast]
216-
//
217-
// Reorder casting ops and vector ops. The casting ops have almost identical
218-
// pattern, so only arith.extsi op is tested.
219-
//===----------------------------------------------------------------------===//
220-
221-
// -----
222-
223-
func.func @broadcast_vector_extsi(%a : vector<4xi8>) -> vector<2x4xi32> {
224-
// CHECK: %[[EXT:.+]] = arith.extsi %{{.+}} : vector<4xi8> to vector<4xi32>
225-
// CHECK: vector.broadcast %[[EXT:.+]] : vector<4xi32> to vector<2x4xi32>
226-
%b = vector.broadcast %a : vector<4xi8> to vector<2x4xi8>
227-
%r = arith.extsi %b : vector<2x4xi8> to vector<2x4xi32>
228-
return %r : vector<2x4xi32>
229-
}
230-
231-
// -----
232-
233-
func.func @broadcast_vector_extsi_scalable(%a : vector<[4]xi8>) -> vector<2x[4]xi32> {
234-
// CHECK: %[[EXT:.+]] = arith.extsi %{{.+}} : vector<[4]xi8> to vector<[4]xi32>
235-
// CHECK: vector.broadcast %[[EXT:.+]] : vector<[4]xi32> to vector<2x[4]xi32>
236-
%b = vector.broadcast %a : vector<[4]xi8> to vector<2x[4]xi8>
237-
%r = arith.extsi %b : vector<2x[4]xi8> to vector<2x[4]xi32>
238-
return %r : vector<2x[4]xi32>
239-
}
240-
241-
// -----
242-
243-
func.func @broadcast_scalar_extsi(%a : i8) -> vector<2x4xi32> {
244-
// CHECK: %[[EXT:.+]] = arith.extsi %{{.+}} : i8 to i32
245-
// CHECK: vector.broadcast %[[EXT]] : i32 to vector<2x4xi32>
246-
%b = vector.broadcast %a : i8 to vector<2x4xi8>
247-
%r = arith.extsi %b : vector<2x4xi8> to vector<2x4xi32>
248-
return %r : vector<2x4xi32>
249-
}
250-
251-
// -----
252-
253-
func.func @broadcast_scalar_extsi_scalable(%a : i8) -> vector<2x[4]xi32> {
254-
// CHECK: %[[EXT:.+]] = arith.extsi %{{.+}} : i8 to i32
255-
// CHECK: vector.broadcast %[[EXT]] : i32 to vector<2x[4]xi32>
256-
%b = vector.broadcast %a : i8 to vector<2x[4]xi8>
257-
%r = arith.extsi %b : vector<2x[4]xi8> to vector<2x[4]xi32>
258-
return %r : vector<2x[4]xi32>
259-
}
260-
261214
// -----
262215

263216
// CHECK-LABEL: func.func @broadcast_scalar_and_splat_const(
@@ -382,6 +335,53 @@ func.func @broadcast_vector_and_splat_const_mixed_type(%arg0: vector<4xf32>) ->
382335
return %2 : vector<3x4xf32>
383336
}
384337

338+
//===----------------------------------------------------------------------===//
339+
// [Pattern: ReorderCastOpsOnBroadcast]
340+
//
341+
// Reorder casting ops and vector ops. The casting ops have almost identical
342+
// pattern, so only arith.extsi op is tested.
343+
//===----------------------------------------------------------------------===//
344+
345+
// -----
346+
347+
func.func @broadcast_vector_extsi(%a : vector<4xi8>) -> vector<2x4xi32> {
348+
// CHECK: %[[EXT:.+]] = arith.extsi %{{.+}} : vector<4xi8> to vector<4xi32>
349+
// CHECK: vector.broadcast %[[EXT:.+]] : vector<4xi32> to vector<2x4xi32>
350+
%b = vector.broadcast %a : vector<4xi8> to vector<2x4xi8>
351+
%r = arith.extsi %b : vector<2x4xi8> to vector<2x4xi32>
352+
return %r : vector<2x4xi32>
353+
}
354+
355+
// -----
356+
357+
func.func @broadcast_vector_extsi_scalable(%a : vector<[4]xi8>) -> vector<2x[4]xi32> {
358+
// CHECK: %[[EXT:.+]] = arith.extsi %{{.+}} : vector<[4]xi8> to vector<[4]xi32>
359+
// CHECK: vector.broadcast %[[EXT:.+]] : vector<[4]xi32> to vector<2x[4]xi32>
360+
%b = vector.broadcast %a : vector<[4]xi8> to vector<2x[4]xi8>
361+
%r = arith.extsi %b : vector<2x[4]xi8> to vector<2x[4]xi32>
362+
return %r : vector<2x[4]xi32>
363+
}
364+
365+
// -----
366+
367+
func.func @broadcast_scalar_extsi(%a : i8) -> vector<2x4xi32> {
368+
// CHECK: %[[EXT:.+]] = arith.extsi %{{.+}} : i8 to i32
369+
// CHECK: vector.broadcast %[[EXT]] : i32 to vector<2x4xi32>
370+
%b = vector.broadcast %a : i8 to vector<2x4xi8>
371+
%r = arith.extsi %b : vector<2x4xi8> to vector<2x4xi32>
372+
return %r : vector<2x4xi32>
373+
}
374+
375+
// -----
376+
377+
func.func @broadcast_scalar_extsi_scalable(%a : i8) -> vector<2x[4]xi32> {
378+
// CHECK: %[[EXT:.+]] = arith.extsi %{{.+}} : i8 to i32
379+
// CHECK: vector.broadcast %[[EXT]] : i32 to vector<2x[4]xi32>
380+
%b = vector.broadcast %a : i8 to vector<2x[4]xi8>
381+
%r = arith.extsi %b : vector<2x[4]xi8> to vector<2x[4]xi32>
382+
return %r : vector<2x[4]xi32>
383+
}
384+
385385
//===----------------------------------------------------------------------===//
386386
// [Pattern: ReorderElementwiseOpsOnTranspose]
387387
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)