Skip to content

Commit d70cab4

Browse files
angelz913kuhar
andauthored
[mlir][spirv] Add LIT test for vector.interleave to spirv.VectorShuffle (#93189)
The plan is to replace this with a dedicated pattern fom`vector.interleave` to `spirv.shuffle` in the future. --------- Co-authored-by: Jakub Kuderski <[email protected]>
1 parent 2d61692 commit d70cab4

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

mlir/test/Conversion/VectorToSPIRV/vector-to-spirv.mlir

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,17 @@ func.func @shuffle(%v0 : vector<1xi32>, %v1: vector<1xi32>) -> vector<2xi32> {
483483

484484
// -----
485485

486+
// CHECK-LABEL: func @interleave
487+
// CHECK-SAME: (%[[ARG0:.+]]: vector<2xf32>, %[[ARG1:.+]]: vector<2xf32>)
488+
// CHECK: %[[SHUFFLE:.*]] = spirv.VectorShuffle [0 : i32, 2 : i32, 1 : i32, 3 : i32] %[[ARG0]], %[[ARG1]] : vector<2xf32>, vector<2xf32> -> vector<4xf32>
489+
// CHECK: return %[[SHUFFLE]]
490+
func.func @interleave(%a: vector<2xf32>, %b: vector<2xf32>) -> vector<4xf32> {
491+
%0 = vector.interleave %a, %b : vector<2xf32>
492+
return %0 : vector<4xf32>
493+
}
494+
495+
// -----
496+
486497
// CHECK-LABEL: func @reduction_add
487498
// CHECK-SAME: (%[[V:.+]]: vector<4xi32>)
488499
// CHECK: %[[S0:.+]] = spirv.CompositeExtract %[[V]][0 : i32] : vector<4xi32>

0 commit comments

Comments
 (0)