11
11
12
12
// -----
13
13
14
- // CHECK-LABEL: func @extract_slice_fun
14
+ // CHECK-LABEL: func @extract_slice_fun(
15
15
func @extract_slice_fun (%A : tensor <?xf32 > {linalg.inplaceable = false },
16
+ // CHECK-SAME: bufferization.access = "read"
16
17
%B : tensor <?xf32 > {linalg.inplaceable = true })
18
+ // CHECK-SAME: bufferization.access = "read"
17
19
-> (tensor <4 xf32 >, tensor <8 xf32 >)
18
20
{
19
21
// tensor.extract_slice is not used in a write, it is not compelled to
@@ -33,10 +35,13 @@ func @extract_slice_fun(%A : tensor<?xf32> {linalg.inplaceable = false},
33
35
34
36
// -----
35
37
36
- // CHECK-LABEL: func @insert_slice_fun
38
+ // CHECK-LABEL: func @insert_slice_fun(
37
39
func @insert_slice_fun (%A : tensor <?xf32 > {linalg.inplaceable = false },
40
+ // CHECK-SAME: bufferization.access = "read"
38
41
%B : tensor <?xf32 > {linalg.inplaceable = true },
42
+ // CHECK-SAME: bufferization.access = "read-write"
39
43
%C : tensor <4 xf32 > {linalg.inplaceable = false })
44
+ // CHECK-SAME: bufferization.access = "read"
40
45
-> (tensor <?xf32 >, tensor <?xf32 >)
41
46
{
42
47
// must bufferize out of place.
@@ -56,9 +61,11 @@ func @insert_slice_fun(%A : tensor<?xf32> {linalg.inplaceable = false},
56
61
57
62
// -----
58
63
59
- // CHECK-LABEL: func @conflict_on_B
64
+ // CHECK-LABEL: func @conflict_on_B(
60
65
func @conflict_on_B (%A : tensor <4 x4 xf32 > {linalg.inplaceable = true },
66
+ // CHECK-SAME: bufferization.access = "read"
61
67
%B : tensor <4 x4 xf32 > {linalg.inplaceable = true })
68
+ // CHECK-SAME: bufferization.access = "read-write"
62
69
-> (tensor <4 x4 xf32 >, tensor <4 x4 xf32 >, tensor <4 x4 xf32 >)
63
70
{
64
71
// matmul output operand interferes with input operand.
@@ -93,10 +100,12 @@ func @conflict_on_B(%A : tensor<4x4xf32> {linalg.inplaceable = true},
93
100
94
101
// -----
95
102
96
- // CHECK-LABEL: func @extract_slice_extract_slice
103
+ // CHECK-LABEL: func @extract_slice_extract_slice(
97
104
func @extract_slice_extract_slice (
98
105
%A : tensor <?xf32 > {linalg.inplaceable = true },
106
+ // CHECK-SAME: bufferization.access = "read"
99
107
%B : tensor <?xf32 > {linalg.inplaceable = false })
108
+ // CHECK-SAME: bufferization.access = "read"
100
109
-> (tensor <2 xf32 >, tensor <2 xf32 >)
101
110
{
102
111
// tensor.extract_slice is not used in a write, it is not compelled to
@@ -120,14 +129,20 @@ func @extract_slice_extract_slice(
120
129
121
130
// -----
122
131
123
- // CHECK-LABEL: func @insert_slice_insert_slice
132
+ // CHECK-LABEL: func @insert_slice_insert_slice(
124
133
func @insert_slice_insert_slice (
125
134
%A : tensor <?xf32 > {linalg.inplaceable = true },
135
+ // CHECK-SAME: bufferization.access = "read-write"
126
136
%A2 : tensor <4 xf32 > {linalg.inplaceable = true },
137
+ // CHECK-SAME: bufferization.access = "read-write"
127
138
%A3 : tensor <2 xf32 > {linalg.inplaceable = true },
139
+ // CHECK-SAME: bufferization.access = "read"
128
140
%B : tensor <?xf32 > {linalg.inplaceable = false },
141
+ // CHECK-SAME: bufferization.access = "read"
129
142
%B2 : tensor <4 xf32 > {linalg.inplaceable = false },
143
+ // CHECK-SAME: bufferization.access = "read"
130
144
%B3 : tensor <2 xf32 > {linalg.inplaceable = false })
145
+ // CHECK-SAME: bufferization.access = "read"
131
146
-> (tensor <?xf32 >, tensor <?xf32 >)
132
147
{
133
148
// CHECK: {__inplace_operands_attr__ = ["true", "true"]}
@@ -888,12 +903,16 @@ builtin.func @matmul_on_tensors(
888
903
// prioritizing the tensor.insert_slice ops.
889
904
//===----------------------------------------------------------------------===//
890
905
906
+ // CHECK-LABEL: func @insert_slice_chain(
891
907
func @insert_slice_chain (
892
908
%v1: vector <32 x90 xf32 >,
893
909
%v2: vector <30 x90 xf32 >,
894
910
%arg0: tensor <62 x126 xf32 > {linalg.buffer_layout = affine_map <(d0 , d1 ) -> (d0 , d1 )>, linalg.inplaceable = false },
911
+ // CHECK-SAME: bufferization.access = "none"
895
912
%arg1: tensor <126 x90 xf32 > {linalg.buffer_layout = affine_map <(d0 , d1 ) -> (d0 , d1 )>, linalg.inplaceable = false },
913
+ // CHECK-SAME: bufferization.access = "none"
896
914
%arg2: tensor <62 x90 xf32 > {linalg.buffer_layout = affine_map <(d0 , d1 ) -> (d0 , d1 )>, linalg.inplaceable = true })
915
+ // CHECK-SAME: bufferization.access = "write"
897
916
-> tensor <62 x90 xf32 > attributes {passthrough = [[" target-cpu" , " skylake-avx512" ], [" prefer-vector-width" , " 512" ]]}
898
917
{
899
918
%c0 = arith.constant 0 : index
@@ -968,10 +987,13 @@ func @ip(%t: tensor<10x20xf32> {linalg.inplaceable = true},
968
987
iterator_types = [" parallel" ]
969
988
}
970
989
971
- // CHECK-LABEL: func @linalg_op_same_out_tensors
990
+ // CHECK-LABEL: func @linalg_op_same_out_tensors(
972
991
func @linalg_op_same_out_tensors (
973
992
%t1: tensor <?xf32 > {linalg.inplaceable = true },
974
- %t2: tensor <?xf32 > {linalg.inplaceable = true }) -> (tensor <?xf32 >, tensor <?xf32 >){
993
+ // CHECK-SAME: bufferization.access = "read-write"
994
+ %t2: tensor <?xf32 > {linalg.inplaceable = true })
995
+ // CHECK-SAME: bufferization.access = "write"
996
+ -> (tensor <?xf32 >, tensor <?xf32 >){
975
997
976
998
// CHECK: linalg.generic
977
999
// CHECK-SAME: {__inplace_operands_attr__ = ["true", "true", "true"]
@@ -999,10 +1021,12 @@ func @linalg_op_same_out_tensors(
999
1021
iterator_types = [" parallel" ]
1000
1022
}
1001
1023
1002
- // CHECK-LABEL: func @linalg_op_same_out_tensors_2
1024
+ // CHECK-LABEL: func @linalg_op_same_out_tensors_2(
1003
1025
func @linalg_op_same_out_tensors_2 (
1004
1026
%t1: tensor <?xf32 > {linalg.inplaceable = true },
1027
+ // CHECK-SAME: bufferization.access = "read-write"
1005
1028
%t2: tensor <?xf32 > {linalg.inplaceable = true })
1029
+ // CHECK-SAME: bufferization.access = "write"
1006
1030
-> (tensor <?xf32 >, tensor <?xf32 >, tensor <?xf32 >){
1007
1031
1008
1032
// CHECK: linalg.generic
0 commit comments