test-constant-mask.mlir
1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// RUN: mlir-opt %s -convert-scf-to-std -convert-vector-to-llvm -convert-std-to-llvm | \
// RUN: mlir-cpu-runner -e entry -entry-point-result=void \
// RUN: -shared-libs=%mlir_integration_test_dir/libmlir_c_runner_utils%shlibext | \
// RUN: FileCheck %s
func @entry() {
%0 = vector.constant_mask [4] : vector<8xi1>
vector.print %0 : vector<8xi1>
// CHECK: ( 1, 1, 1, 1, 0, 0, 0, 0 )
%1 = vector.constant_mask [1, 3] : vector<4x4xi1>
vector.print %1 : vector<4x4xi1>
// CHECK: ( ( 1, 1, 1, 0 ), ( 0, 0, 0, 0 ), ( 0, 0, 0, 0 ), ( 0, 0, 0, 0 ) )
%2 = vector.constant_mask [2, 2] : vector<4x4xi1>
vector.print %2 : vector<4x4xi1>
// CHECK: ( ( 1, 1, 0, 0 ), ( 1, 1, 0, 0 ), ( 0, 0, 0, 0 ), ( 0, 0, 0, 0 ) )
%3 = vector.constant_mask [2, 4] : vector<4x4xi1>
vector.print %3 : vector<4x4xi1>
// CHECK: ( ( 1, 1, 1, 1 ), ( 1, 1, 1, 1 ), ( 0, 0, 0, 0 ), ( 0, 0, 0, 0 ) )
%4 = vector.constant_mask [3, 1] : vector<4x4xi1>
vector.print %4 : vector<4x4xi1>
// CHECK: ( ( 1, 0, 0, 0 ), ( 1, 0, 0, 0 ), ( 1, 0, 0, 0 ), ( 0, 0, 0, 0 ) )
%5 = vector.constant_mask [3, 2] : vector<4x4xi1>
vector.print %5 : vector<4x4xi1>
// CHECK: ( ( 1, 1, 0, 0 ), ( 1, 1, 0, 0 ), ( 1, 1, 0, 0 ), ( 0, 0, 0, 0 ) )
%6 = vector.constant_mask [4, 3] : vector<4x4xi1>
vector.print %6 : vector<4x4xi1>
// CHECK: ( ( 1, 1, 1, 0 ), ( 1, 1, 1, 0 ), ( 1, 1, 1, 0 ), ( 1, 1, 1, 0 ) )
%7 = vector.constant_mask [4, 4] : vector<4x4xi1>
vector.print %7 : vector<4x4xi1>
// CHECK: ( ( 1, 1, 1, 1 ), ( 1, 1, 1, 1 ), ( 1, 1, 1, 1 ), ( 1, 1, 1, 1 ) )
%8 = vector.constant_mask [1, 2, 3] : vector<2x3x4xi1>
vector.print %8 : vector<2x3x4xi1>
// CHECK: ( ( ( 1, 1, 1, 0 ), ( 1, 1, 1, 0 ), ( 0, 0, 0, 0 ) ), ( ( 0, 0, 0, 0 ), ( 0, 0, 0, 0 ), ( 0, 0, 0, 0 ) ) )
%9 = vector.constant_mask [2, 2, 3] : vector<2x3x4xi1>
vector.print %9 : vector<2x3x4xi1>
// CHECK: ( ( ( 1, 1, 1, 0 ), ( 1, 1, 1, 0 ), ( 0, 0, 0, 0 ) ), ( ( 1, 1, 1, 0 ), ( 1, 1, 1, 0 ), ( 0, 0, 0, 0 ) ) )
return
}