@@ -18,7 +18,7 @@ module @foo_module attributes { transform.with_named_sequence } {
18
18
// -----
19
19
20
20
module @foo_module attributes { transform.with_named_sequence } {
21
- // expected-error @+1{{Tuning spec entry point expected to have a single any_op argument }}
21
+ // expected-error @+1{{Must take one 'any_op' (required by 'iree_codegen.tuning_spec_entrypoint') }}
22
22
transform.named_sequence @foo (%arg0: !transform.any_op {transform.readonly }, %arg1: !transform.any_op {transform.readonly }) -> !transform.any_op
23
23
attributes { iree_codegen.tuning_spec_entrypoint } {
24
24
transform.yield %arg0 : !transform.any_op
@@ -28,15 +28,15 @@ module @foo_module attributes { transform.with_named_sequence } {
28
28
// -----
29
29
30
30
module @foo_module attributes { transform.with_named_sequence } {
31
- // expected-error @+1{{Tuning spec entry point expected to have a single any_op argument }}
31
+ // expected-error @+1{{Must take one 'any_op' (required by 'iree_codegen.tuning_spec_entrypoint') }}
32
32
transform.named_sequence @foo (%arg0: i32 ) -> !transform.any_op
33
33
attributes { iree_codegen.tuning_spec_entrypoint } {}
34
34
}
35
35
36
36
// -----
37
37
38
38
module @foo_module attributes { transform.with_named_sequence } {
39
- // expected-error @+1{{Tuning spec entry point expected to return any_op }}
39
+ // expected-error @+1{{Must return one 'any_op' (required by 'iree_codegen.tuning_spec_entrypoint') }}
40
40
transform.named_sequence @foo (%arg0: !transform.any_op {transform.readonly }) -> i32
41
41
attributes { iree_codegen.tuning_spec_entrypoint } {
42
42
%0 = arith.constant 0 : i32
@@ -47,22 +47,256 @@ module @foo_module attributes { transform.with_named_sequence } {
47
47
// -----
48
48
49
49
module @foo_module attributes { transform.with_named_sequence } {
50
- // expected-error @+1{{Tuning spec entry point expected to return any_op }}
50
+ // expected-error @+1{{Must return one 'any_op' (required by 'iree_codegen.tuning_spec_entrypoint') }}
51
51
transform.named_sequence @foo (%arg0: !transform.any_op {transform.readonly })
52
52
attributes { iree_codegen.tuning_spec_entrypoint } {}
53
53
}
54
54
55
55
// -----
56
56
57
- // expected-error @+1{{The tuning specification must include a named sequence with the symbol name '__kernel_config' }}
57
+ // expected-error @+1{{Missing named sequence '__kernel_config' (required by 'iree_codegen.tuning_spec_with_default_entrypoint') }}
58
58
module @iree_default_tuning_spec attributes { iree_codegen.tuning_spec_with_default_entrypoint } {
59
59
}
60
60
61
61
// -----
62
62
63
- // expected-error @+1{{The tuning specification must include a named sequence with the symbol name '__kernel_config' }}
63
+ // expected-error @+1{{Missing named sequence '__kernel_config' (required by 'iree_codegen.tuning_spec_with_default_entrypoint') }}
64
64
module @iree_default_tuning_spec attributes { iree_codegen.tuning_spec_with_default_entrypoint } {
65
65
func.func @__kernel_config (%arg0: i32 ) -> () {
66
66
return
67
67
}
68
68
}
69
+
70
+ // -----
71
+
72
+ module @iree_default_tuning_spec attributes { iree_codegen.tuning_spec_with_default_entrypoint } {
73
+ // expected-error @+1{{Missing attribute 'iree_codegen.tuning_spec_entrypoint' in named sequence '__kernel_config' (required by 'iree_codegen.tuning_spec_with_default_entrypoint')}}
74
+ transform.named_sequence @__kernel_config (%arg0: !transform.any_op {transform.consumed })
75
+ -> (!transform.any_op ) {
76
+ transform.yield %arg0 : !transform.any_op
77
+ }
78
+ }
79
+
80
+ // -----
81
+
82
+ module @iree_default_tuning_spec attributes { iree_codegen.tuning_spec_with_default_entrypoint } {
83
+ transform.named_sequence @match (%arg: !transform.any_op ) -> (!transform.any_op ) {
84
+ transform.yield %arg : !transform.any_op
85
+ }
86
+
87
+ transform.named_sequence @apply_op_config (%op: !transform.any_op ) {
88
+ transform.yield
89
+ }
90
+
91
+ // expected-error @+1{{'__kernel_config' must contain exactly one block (required by 'iree_codegen.tuning_spec_with_default_entrypoint')}}
92
+ transform.named_sequence @__kernel_config (%arg0: !transform.any_op )
93
+ -> (!transform.any_op ) attributes { iree_codegen.tuning_spec_entrypoint }
94
+ }
95
+
96
+ // -----
97
+
98
+ module @iree_default_tuning_spec attributes { iree_codegen.tuning_spec_with_default_entrypoint } {
99
+ transform.named_sequence @match (%arg: !transform.any_op {transform.readonly }) -> (!transform.any_op ) {
100
+ transform.yield %arg : !transform.any_op
101
+ }
102
+
103
+ transform.named_sequence @apply_op_config (%op: !transform.any_op {transform.readonly }) {
104
+ transform.yield
105
+ }
106
+
107
+ // expected-error @+1{{'__kernel_config' must contain exactly two operations (required by 'iree_codegen.tuning_spec_with_default_entrypoint')}}
108
+ transform.named_sequence @__kernel_config (%arg0: !transform.any_op {transform.consumed })
109
+ -> (!transform.any_op ) attributes { iree_codegen.tuning_spec_entrypoint } {
110
+
111
+ %res_a = transform.foreach_match in %arg0
112
+ @match -> @apply_op_config
113
+ : (!transform.any_op ) -> (!transform.any_op )
114
+ %res_b = transform.foreach_match in %res_a
115
+ @match -> @apply_op_config
116
+ : (!transform.any_op ) -> (!transform.any_op )
117
+ transform.yield %res_b : !transform.any_op
118
+ }
119
+ }
120
+
121
+ // -----
122
+
123
+ // expected-error @+1{{Expected one named sequence with 'iree_codegen.tuning_spec_entrypoint', but found 2 (required by 'iree_codegen.tuning_spec_with_default_entrypoint')}}
124
+ module @iree_default_tuning_spec attributes { iree_codegen.tuning_spec_with_default_entrypoint } {
125
+ transform.named_sequence @__kernel_config (%arg0: !transform.any_op {transform.consumed })
126
+ -> (!transform.any_op ) attributes { iree_codegen.tuning_spec_entrypoint } {
127
+ transform.yield %arg0 : !transform.any_op
128
+ }
129
+
130
+ transform.named_sequence @main (%arg0: !transform.any_op {transform.readonly })
131
+ -> !transform.any_op attributes { iree_codegen.tuning_spec_entrypoint } {
132
+ transform.yield %arg0 : !transform.any_op
133
+ }
134
+ }
135
+
136
+ // -----
137
+
138
+ module @iree_default_tuning_spec attributes { iree_codegen.tuning_spec_with_default_entrypoint } {
139
+ transform.named_sequence @match (%arg: !transform.any_op {transform.readonly }) -> (!transform.any_op ) {
140
+ transform.yield %arg : !transform.any_op
141
+ }
142
+
143
+ transform.named_sequence @apply_op_config (%op: !transform.any_op {transform.readonly }) {
144
+ transform.yield
145
+ }
146
+
147
+ // expected-error @+1{{'__kernel_config' must start with 'ForeachMatchOp' (required by 'iree_codegen.tuning_spec_with_default_entrypoint')}}
148
+ transform.named_sequence @__kernel_config (%arg0: !transform.any_op {transform.consumed })
149
+ -> (!transform.any_op ) attributes { iree_codegen.tuning_spec_entrypoint } {
150
+ transform.print {name = " Hello" }
151
+ transform.yield %arg0 : !transform.any_op
152
+ }
153
+ }
154
+
155
+ // -----
156
+
157
+ // expected-error @+1{{Expected one named sequence with 'iree_codegen.tuning_spec_entrypoint', but found 2 (required by 'iree_codegen.tuning_spec_with_default_entrypoint')}}
158
+ module @iree_default_tuning_spec attributes { iree_codegen.tuning_spec_with_default_entrypoint } {
159
+ transform.named_sequence @__kernel_config (%arg0: !transform.any_op {transform.consumed })
160
+ -> (!transform.any_op ) attributes { iree_codegen.tuning_spec_entrypoint } {
161
+ transform.yield %arg0 : !transform.any_op
162
+ }
163
+
164
+ module @extra_module attributes { iree_codegen.tuning_spec_entrypoint } {
165
+ transform.yield
166
+ }
167
+ }
168
+
169
+ // -----
170
+
171
+ module @iree_default_tuning_spec attributes { transform.with_named_sequence , iree_codegen.tuning_spec_with_default_entrypoint } {
172
+ transform.named_sequence @match (%arg: !transform.any_op {transform.readonly })
173
+ -> (!transform.any_op , !transform.any_op ) {
174
+ transform.yield %arg , %arg : !transform.any_op , !transform.any_op
175
+ }
176
+
177
+ transform.named_sequence @apply_op_config (%op1: !transform.any_op {transform.readonly }, %op2: !transform.any_op {transform.readonly })
178
+ -> (!transform.any_op ) {
179
+ transform.yield %op1 : !transform.any_op
180
+ }
181
+
182
+ transform.named_sequence @__kernel_config (%arg0: !transform.any_op {transform.consumed })
183
+ -> (!transform.any_op ) attributes { iree_codegen.tuning_spec_entrypoint } {
184
+ // expected-error @+1 {{'ForeachMatchOp' must return exactly one 'any_op' result (required by 'iree_codegen.tuning_spec_with_default_entrypoint')}}
185
+ %res1 , %res2 = transform.foreach_match in %arg0
186
+ @match -> @apply_op_config
187
+ : (!transform.any_op ) -> (!transform.any_op , !transform.any_op )
188
+
189
+ transform.yield %res1 : !transform.any_op
190
+ }
191
+ }
192
+
193
+ // -----
194
+
195
+ module @iree_default_tuning_spec attributes { transform.with_named_sequence , iree_codegen.tuning_spec_with_default_entrypoint } {
196
+ transform.named_sequence @match (%arg: !transform.any_op ) -> (!transform.any_op ) {
197
+ transform.yield %arg : !transform.any_op
198
+ }
199
+
200
+ transform.named_sequence @apply_op_config (%op: !transform.any_op ) {
201
+ transform.yield
202
+ }
203
+
204
+ transform.named_sequence @__kernel_config (%arg0: !transform.any_op )
205
+ -> (f32 ) attributes { iree_codegen.tuning_spec_entrypoint } {
206
+ // expected-error @+1 {{'ForeachMatchOp' must return exactly one 'any_op' result (required by 'iree_codegen.tuning_spec_with_default_entrypoint')}}
207
+ %res = transform.foreach_match in %arg0
208
+ @match -> @apply_op_config
209
+ : (!transform.any_op ) -> (f32 )
210
+
211
+ transform.yield %res : f32
212
+ }
213
+ }
214
+
215
+ // -----
216
+
217
+ module @iree_default_tuning_spec attributes { iree_codegen.tuning_spec_with_default_entrypoint } {
218
+ transform.named_sequence @match (%arg1: !transform.any_op {transform.readonly }, %arg2: !transform.any_op {transform.readonly })
219
+ -> (!transform.any_op ) {
220
+ transform.yield %arg1 : !transform.any_op
221
+ }
222
+
223
+ transform.named_sequence @apply_op_config (%op: !transform.any_op {transform.readonly }) {
224
+ transform.yield
225
+ }
226
+
227
+ transform.named_sequence @__kernel_config (%arg0: !transform.any_op {transform.consumed })
228
+ -> (!transform.any_op ) attributes { iree_codegen.tuning_spec_entrypoint } {
229
+ // expected-error @+1 {{'ForeachMatchOp' must take exactly one 'any_op' argument (required by 'iree_codegen.tuning_spec_with_default_entrypoint')}}
230
+ %res = transform.foreach_match in %arg0 , %arg0
231
+ @match -> @apply_op_config
232
+ : (!transform.any_op , !transform.any_op ) -> (!transform.any_op )
233
+
234
+ transform.yield %res : !transform.any_op
235
+ }
236
+ }
237
+
238
+ // -----
239
+
240
+ module @iree_default_tuning_spec attributes { iree_codegen.tuning_spec_with_default_entrypoint } {
241
+ transform.named_sequence @match (%arg: index ) -> (index ) {
242
+ transform.yield %arg : index
243
+ }
244
+
245
+ transform.named_sequence @apply_op_config (%op: !transform.any_op ) {
246
+ transform.yield
247
+ }
248
+
249
+ transform.named_sequence @__kernel_config (%arg0: index )
250
+ -> (!transform.any_op ) attributes { iree_codegen.tuning_spec_entrypoint } {
251
+ // expected-error @+1 {{'ForeachMatchOp' must take exactly one 'any_op' argument (required by 'iree_codegen.tuning_spec_with_default_entrypoint')}}
252
+ %res = transform.foreach_match in %arg0
253
+ @match -> @apply_op_config
254
+ : (index ) -> (!transform.any_op )
255
+
256
+ transform.yield %res : !transform.any_op
257
+ }
258
+ }
259
+
260
+ // -----
261
+
262
+ module @iree_default_tuning_spec attributes { iree_codegen.tuning_spec_with_default_entrypoint } {
263
+ transform.named_sequence @match (%arg: !transform.any_op ) -> (!transform.any_op ) {
264
+ transform.yield %arg : !transform.any_op
265
+ }
266
+
267
+ transform.named_sequence @apply_op_config (%op: !transform.any_op ) {
268
+ transform.yield
269
+ }
270
+
271
+ transform.named_sequence @__kernel_config (%arg0: !transform.any_op )
272
+ -> (!transform.any_op ) attributes { iree_codegen.tuning_spec_entrypoint } {
273
+ // expected-error @+1{{'ForeachMatchOp' must not have 'restrict_root' attribute (required by 'iree_codegen.tuning_spec_with_default_entrypoint')}}
274
+ %res = transform.foreach_match restrict_root in %arg0
275
+ @match -> @apply_op_config
276
+ : (!transform.any_op ) -> (!transform.any_op )
277
+
278
+ transform.yield %res : !transform.any_op
279
+ }
280
+ }
281
+
282
+ // -----
283
+
284
+ module @iree_default_tuning_spec attributes { iree_codegen.tuning_spec_with_default_entrypoint } {
285
+ transform.named_sequence @match (%arg: !transform.any_op ) -> (!transform.any_op ) {
286
+ transform.yield %arg : !transform.any_op
287
+ }
288
+
289
+ transform.named_sequence @apply_op_config (%op: !transform.any_op ) {
290
+ transform.yield
291
+ }
292
+
293
+ transform.named_sequence @__kernel_config (%arg0: !transform.any_op )
294
+ -> (!transform.any_op ) attributes { iree_codegen.tuning_spec_entrypoint } {
295
+ // expected-error @+1{{'ForeachMatchOp' must not have 'flatten_results' attribute (required by 'iree_codegen.tuning_spec_with_default_entrypoint')}}
296
+ %res = transform.foreach_match flatten_results in %arg0
297
+ @match -> @apply_op_config
298
+ : (!transform.any_op ) -> (!transform.any_op )
299
+
300
+ transform.yield %res : !transform.any_op
301
+ }
302
+ }
0 commit comments