@@ -17,6 +17,60 @@ module attributes {transform.with_named_sequence} {
17
17
18
18
// -----
19
19
20
+ // expected-remark @below {{associated attr 42 : i32}}
21
+ module attributes { test.dlti = #dlti.map <#dlti.dl_entry <i32 , 42 : i32 >>} {
22
+ func.func private @f ()
23
+ }
24
+
25
+ module attributes {transform.with_named_sequence } {
26
+ transform.named_sequence @__transform_main (%arg: !transform.any_op ) {
27
+ %funcs = transform.structured.match ops {[" func.func" ]} in %arg : (!transform.any_op ) -> !transform.any_op
28
+ %module = transform.get_parent_op %funcs : (!transform.any_op ) -> !transform.any_op
29
+ %param = transform.dlti.query [i32 ] at %module : (!transform.any_op ) -> !transform.any_param
30
+ transform.debug.emit_param_as_remark %param , " associated attr" at %module : !transform.any_param , !transform.any_op
31
+ transform.yield
32
+ }
33
+ }
34
+
35
+ // -----
36
+
37
+ // expected-remark @below {{associated attr 32 : i32}}
38
+ module attributes { test.dlti = #dlti.map <#dlti.dl_entry <i32 , #dlti.map <#dlti.dl_entry <" width_in_bits" , 32 : i32 >>>>} {
39
+ func.func private @f ()
40
+ }
41
+
42
+ module attributes {transform.with_named_sequence } {
43
+ transform.named_sequence @__transform_main (%arg: !transform.any_op ) {
44
+ %funcs = transform.structured.match ops {[" func.func" ]} in %arg : (!transform.any_op ) -> !transform.any_op
45
+ %module = transform.get_parent_op %funcs : (!transform.any_op ) -> !transform.any_op
46
+ %param = transform.dlti.query [i32 ," width_in_bits" ] at %module : (!transform.any_op ) -> !transform.any_param
47
+ transform.debug.emit_param_as_remark %param , " associated attr" at %module : !transform.any_param , !transform.any_op
48
+ transform.yield
49
+ }
50
+ }
51
+
52
+ // -----
53
+
54
+ // expected-remark @below {{width in bits of i32 = 32 : i64}}
55
+ // expected-remark @below {{width in bits of f64 = 64 : i64}}
56
+ module attributes { test.dlti = #dlti.map <#dlti.dl_entry <" width_in_bits" , #dlti.map <#dlti.dl_entry <i32 , 32 >, #dlti.dl_entry <f64 , 64 >>>>} {
57
+ func.func private @f ()
58
+ }
59
+
60
+ module attributes {transform.with_named_sequence } {
61
+ transform.named_sequence @__transform_main (%arg: !transform.any_op ) {
62
+ %funcs = transform.structured.match ops {[" func.func" ]} in %arg : (!transform.any_op ) -> !transform.any_op
63
+ %module = transform.get_parent_op %funcs : (!transform.any_op ) -> !transform.any_op
64
+ %i32bits = transform.dlti.query [" width_in_bits" ,i32 ] at %module : (!transform.any_op ) -> !transform.any_param
65
+ %f64bits = transform.dlti.query [" width_in_bits" ,f64 ] at %module : (!transform.any_op ) -> !transform.any_param
66
+ transform.debug.emit_param_as_remark %i32bits , " width in bits of i32 =" at %module : !transform.any_param , !transform.any_op
67
+ transform.debug.emit_param_as_remark %f64bits , " width in bits of f64 =" at %module : !transform.any_param , !transform.any_op
68
+ transform.yield
69
+ }
70
+ }
71
+
72
+ // -----
73
+
20
74
// expected-remark @below {{associated attr 42 : i32}}
21
75
module attributes { test.dlti = #dlti.dl_spec <#dlti.dl_entry <" test.id" , 42 : i32 >>} {
22
76
func.func private @f ()
@@ -336,6 +390,23 @@ module attributes {transform.with_named_sequence} {
336
390
337
391
// -----
338
392
393
+ // expected-note @below {{got non-DLTI-queryable attribute upon looking up keys [i32]}}
394
+ module attributes { test.dlti = #dlti.dl_spec <#dlti.dl_entry <i32 , 32 : i32 >>} {
395
+ // expected-error @below {{target op of failed DLTI query}}
396
+ func.func private @f ()
397
+ }
398
+
399
+ module attributes {transform.with_named_sequence } {
400
+ transform.named_sequence @__transform_main (%arg: !transform.any_op ) {
401
+ %func = transform.structured.match ops {[" func.func" ]} in %arg : (!transform.any_op ) -> !transform.any_op
402
+ // expected-error @below {{'transform.dlti.query' op failed to apply}}
403
+ %param = transform.dlti.query [i32 ," width_in_bits" ] at %func : (!transform.any_op ) -> !transform.any_param
404
+ transform.yield
405
+ }
406
+ }
407
+
408
+ // -----
409
+
339
410
module {
340
411
// expected-error @below {{target op of failed DLTI query}}
341
412
// expected-note @below {{no DLTI-queryable attrs on target op or any of its ancestors}}
@@ -353,6 +424,23 @@ module attributes {transform.with_named_sequence} {
353
424
354
425
// -----
355
426
427
+ // expected-note @below {{key i64 has no DLTI-mapping per attr: #dlti.map<#dlti.dl_entry<i32, 32 : i64>>}}
428
+ module attributes { test.dlti = #dlti.map <#dlti.dl_entry <" width_in_bits" , #dlti.map <#dlti.dl_entry <i32 , 32 >>>>} {
429
+ // expected-error @below {{target op of failed DLTI query}}
430
+ func.func private @f ()
431
+ }
432
+
433
+ module attributes {transform.with_named_sequence } {
434
+ transform.named_sequence @__transform_main (%arg: !transform.any_op ) {
435
+ %func = transform.structured.match ops {[" func.func" ]} in %arg : (!transform.any_op ) -> !transform.any_op
436
+ // expected-error @below {{'transform.dlti.query' op failed to apply}}
437
+ %param = transform.dlti.query [" width_in_bits" ,i64 ] at %func : (!transform.any_op ) -> !transform.any_param
438
+ transform.yield
439
+ }
440
+ }
441
+
442
+ // -----
443
+
356
444
module attributes { test.dlti = #dlti.dl_spec <#dlti.dl_entry <" test.id" , 42 : i32 >>} {
357
445
func.func private @f ()
358
446
}
0 commit comments