Debian Codegraph @

mlir/utils/tree-sitter-mlir/test/corpus/attribute.txt

raw
1 ================================================================================
2 func.func with result attribute
3 ================================================================================
4 func.func @example_fn_result() -> (f64 {dialectName.attrName = 0 : i64})
5 --------------------------------------------------------------------------------
6
7 (toplevel
8 (operation
9 (custom_operation
10 (func_dialect
11 (symbol_ref_id)
12 (func_arg_list)
13 (func_return
14 (type_list_attr_parens
15 (type
16 (builtin_type
17 (float_type)))
18 (attribute
19 (dictionary_attribute
20 (attribute_entry
21 (bare_id)
22 (attribute_value
23 (integer_literal)
24 (type
25 (builtin_type
26 (integer_type)))))))))))))
27
28 ================================================================================
29 func.func with argument attribute
30 ================================================================================
31 func.func @example_fn_arg(%x: i32 {swift.self = unit})
32 --------------------------------------------------------------------------------
33
34 (toplevel
35 (operation
36 (custom_operation
37 (func_dialect
38 (symbol_ref_id)
39 (func_arg_list
40 (value_use)
41 (type
42 (builtin_type
43 (integer_type)))
44 (attribute
45 (dictionary_attribute
46 (attribute_entry
47 (bare_id)
48 (attribute_value
49 (unit_literal))))))))))
50
51 ================================================================================
52 strided attribute in memref
53 ================================================================================
54 func.func @dot_view(%arg0: memref<?xf32, strided<[1], offset: ?>>,
55 %arg1: memref<?xf32, strided<[1], offset: ?>>, %arg2: memref<f32>) {
56 linalg.dot ins(%arg0, %arg1 : memref<?xf32, strided<[1], offset: ?>>,
57 memref<?xf32, strided<[1], offset: ?>>)
58 outs(%arg2: memref<f32>)
59 return
60 }
61 --------------------------------------------------------------------------------
62
63 (toplevel
64 (operation
65 (custom_operation
66 (func_dialect
67 (symbol_ref_id)
68 (func_arg_list
69 (value_use)
70 (type
71 (builtin_type
72 (memref_type
73 (dim_list
74 (float_type))
75 (attribute_value
76 (builtin_attribute
77 (strided_layout))))))
78 (value_use)
79 (type
80 (builtin_type
81 (memref_type
82 (dim_list
83 (float_type))
84 (attribute_value
85 (builtin_attribute
86 (strided_layout))))))
87 (value_use)
88 (type
89 (builtin_type
90 (memref_type
91 (dim_list
92 (float_type))))))
93 (region
94 (entry_block
95 (operation
96 (custom_operation
97 (linalg_dialect
98 (value_use)
99 (value_use)
100 (type
101 (builtin_type
102 (memref_type
103 (dim_list
104 (float_type))
105 (attribute_value
106 (builtin_attribute
107 (strided_layout))))))
108 (type
109 (builtin_type
110 (memref_type
111 (dim_list
112 (float_type))
113 (attribute_value
114 (builtin_attribute
115 (strided_layout))))))
116 (value_use)
117 (type
118 (builtin_type
119 (memref_type
120 (dim_list
121 (float_type))))))))
122 (operation
123 (custom_operation
124 (func_dialect)))))))))
125
126 ================================================================================
127 dense attribute in linalg.depthwise_conv_1d_nwc_wcm
128 ================================================================================
129 func.func @depthwise_conv_1d_nwc_wcm(%input: tensor<1x12x8xf32>, %filter: tensor<3x8x8xf32>)
130 -> tensor<1x10x8x8xf32> {
131 %zero = arith.constant 0.000000e+00 : f32
132 %init = tensor.empty() : tensor<1x10x8x8xf32>
133 %fill = linalg.fill ins(%zero : f32) outs(%init : tensor<1x10x8x8xf32>) -> tensor<1x10x8x8xf32>
134 %0 = linalg.depthwise_conv_1d_nwc_wcm {dilations = dense<1> : tensor<1xi64>,
135 strides = dense<1> : tensor<1xi64>}
136 ins(%input, %filter : tensor<1x12x8xf32>, tensor<3x8x8xf32>)
137 outs(%fill : tensor<1x10x8x8xf32>) -> tensor<1x10x8x8xf32>
138 return %0 : tensor<1x10x8x8xf32>
139 }
140 --------------------------------------------------------------------------------
141
142 (toplevel
143 (operation
144 (custom_operation
145 (func_dialect
146 (symbol_ref_id)
147 (func_arg_list
148 (value_use)
149 (type
150 (builtin_type
151 (tensor_type
152 (dim_list
153 (float_type)))))
154 (value_use)
155 (type
156 (builtin_type
157 (tensor_type
158 (dim_list
159 (float_type))))))
160 (func_return
161 (type_list_attr_parens
162 (type
163 (builtin_type
164 (tensor_type
165 (dim_list
166 (float_type)))))))
167 (region
168 (entry_block
169 (operation
170 (op_result
171 (value_use))
172 (custom_operation
173 (arith_dialect
174 (float_literal)
175 (type
176 (builtin_type
177 (float_type))))))
178 (operation
179 (op_result
180 (value_use))
181 (custom_operation
182 (tensor_dialect
183 (type
184 (builtin_type
185 (tensor_type
186 (dim_list
187 (float_type))))))))
188 (operation
189 (op_result
190 (value_use))
191 (custom_operation
192 (linalg_dialect
193 (value_use)
194 (type
195 (builtin_type
196 (float_type)))
197 (value_use)
198 (type
199 (builtin_type
200 (tensor_type
201 (dim_list
202 (float_type)))))
203 (type
204 (builtin_type
205 (tensor_type
206 (dim_list
207 (float_type))))))))
208 (operation
209 (op_result
210 (value_use))
211 (custom_operation
212 (linalg_dialect
213 (attribute
214 (dictionary_attribute
215 (attribute_entry
216 (bare_id)
217 (attribute_value
218 (tensor_literal
219 (integer_literal))
220 (type
221 (builtin_type
222 (tensor_type
223 (dim_list
224 (integer_type)))))))
225 (attribute_entry
226 (bare_id)
227 (attribute_value
228 (tensor_literal
229 (integer_literal))
230 (type
231 (builtin_type
232 (tensor_type
233 (dim_list
234 (integer_type)))))))))
235 (value_use)
236 (value_use)
237 (type
238 (builtin_type
239 (tensor_type
240 (dim_list
241 (float_type)))))
242 (type
243 (builtin_type
244 (tensor_type
245 (dim_list
246 (float_type)))))
247 (value_use)
248 (type
249 (builtin_type
250 (tensor_type
251 (dim_list
252 (float_type)))))
253 (type
254 (builtin_type
255 (tensor_type
256 (dim_list
257 (float_type))))))))
258 (operation
259 (custom_operation
260 (func_dialect
261 (value_use)
262 (type
263 (builtin_type
264 (tensor_type
265 (dim_list
266 (float_type))))))))))))))
267
268 ================================================================================
269 fastmath attribute in arith
270 ================================================================================
271 func.func @fastmath(%arg0: f32, %arg1: f32, %arg2: i32) {
272 %0 = arith.addf %arg0, %arg1 fastmath<fast> : f32
273 %1 = arith.subf %arg0, %arg1 fastmath<fast> : f32
274 %2 = arith.mulf %arg0, %arg1 fastmath<fast> : f32
275 %3 = arith.divf %arg0, %arg1 fastmath<fast> : f32
276 %4 = arith.remf %arg0, %arg1 fastmath<fast> : f32
277 %5 = arith.negf %arg0 fastmath<fast> : f32
278 %6 = arith.addf %arg0, %arg1 fastmath<none> : f32
279 %7 = arith.addf %arg0, %arg1 fastmath<nnan,ninf> : f32
280 %8 = arith.mulf %arg0, %arg1 fastmath<reassoc,nnan,ninf,nsz,arcp,contract,afn> : f32
281 return
282 }
283 --------------------------------------------------------------------------------
284
285 (toplevel
286 (operation
287 (custom_operation
288 (func_dialect
289 (symbol_ref_id)
290 (func_arg_list
291 (value_use)
292 (type
293 (builtin_type
294 (float_type)))
295 (value_use)
296 (type
297 (builtin_type
298 (float_type)))
299 (value_use)
300 (type
301 (builtin_type
302 (integer_type))))
303 (region
304 (entry_block
305 (operation
306 (op_result
307 (value_use))
308 (custom_operation
309 (arith_dialect
310 (value_use)
311 (value_use)
312 (fastmath_attr)
313 (type
314 (builtin_type
315 (float_type))))))
316 (operation
317 (op_result
318 (value_use))
319 (custom_operation
320 (arith_dialect
321 (value_use)
322 (value_use)
323 (fastmath_attr)
324 (type
325 (builtin_type
326 (float_type))))))
327 (operation
328 (op_result
329 (value_use))
330 (custom_operation
331 (arith_dialect
332 (value_use)
333 (value_use)
334 (fastmath_attr)
335 (type
336 (builtin_type
337 (float_type))))))
338 (operation
339 (op_result
340 (value_use))
341 (custom_operation
342 (arith_dialect
343 (value_use)
344 (value_use)
345 (fastmath_attr)
346 (type
347 (builtin_type
348 (float_type))))))
349 (operation
350 (op_result
351 (value_use))
352 (custom_operation
353 (arith_dialect
354 (value_use)
355 (value_use)
356 (fastmath_attr)
357 (type
358 (builtin_type
359 (float_type))))))
360 (operation
361 (op_result
362 (value_use))
363 (custom_operation
364 (arith_dialect
365 (value_use)
366 (fastmath_attr)
367 (type
368 (builtin_type
369 (float_type))))))
370 (operation
371 (op_result
372 (value_use))
373 (custom_operation
374 (arith_dialect
375 (value_use)
376 (value_use)
377 (fastmath_attr)
378 (type
379 (builtin_type
380 (float_type))))))
381 (operation
382 (op_result
383 (value_use))
384 (custom_operation
385 (arith_dialect
386 (value_use)
387 (value_use)
388 (fastmath_attr)
389 (type
390 (builtin_type
391 (float_type))))))
392 (operation
393 (op_result
394 (value_use))
395 (custom_operation
396 (arith_dialect
397 (value_use)
398 (value_use)
399 (fastmath_attr)
400 (type
401 (builtin_type
402 (float_type))))))
403 (operation
404 (custom_operation
405 (func_dialect)))))))))
406
407 ================================================================================
408 Generic function bracketed attributes
409 ================================================================================
410 "llvm.func"() ({
411 }) {sym_name = "qux", function_type = !llvm.func<void (ptr<i64>, i64)>,
412 arg_attrs = [{llvm.noalias}, {}], xxx = {yyy = 42}} : () -> ()
413 --------------------------------------------------------------------------------
414
415 (toplevel
416 (operation
417 (generic_operation
418 (string_literal)
419 (region)
420 (attribute
421 (dictionary_attribute
422 (attribute_entry
423 (bare_id)
424 (attribute_value
425 (string_literal)))
426 (attribute_entry
427 (bare_id)
428 (attribute_value
429 (type
430 (dialect_type
431 (pretty_dialect_item
432 (dialect_namespace)
433 (dialect_ident)
434 (pretty_dialect_item_body
435 (pretty_dialect_item_body)))))))
436 (attribute_entry
437 (bare_id)
438 (attribute_value
439 (dictionary_attribute
440 (attribute_entry
441 (bare_id)))
442 (dictionary_attribute)))
443 (attribute_entry
444 (bare_id)
445 (attribute_value
446 (dictionary_attribute
447 (attribute_entry
448 (bare_id)
449 (attribute_value
450 (integer_literal))))))))
451 (function_type))))
452
453 ================================================================================
454 linalg.generic with attributes using attribute aliases
455 ================================================================================
456 #map0 = affine_map<(d0, d1) -> (d0, d1)>
457 #map1 = affine_map<(d0, d1) -> (d0)>
458 #map2 = affine_map<(d0) -> (d0)>
459
460 func.func @add_broadcast_mul_fusion(%arg0: tensor<?xf32>, %arg1 : tensor<?xf32>,
461 %arg2 : tensor<?x?xf32>) -> tensor<?x?xf32>
462 {
463 %c0 = arith.constant 0 : index
464 %c1 = arith.constant 1 : index
465 %0 = tensor.dim %arg0, %c0 : tensor<?xf32>
466 %1 = tensor.empty(%0) : tensor<?xf32>
467 %2 = linalg.generic {indexing_maps = [#map2, #map2, #map2], iterator_types = ["parallel"]}
468 ins(%arg0, %arg1 : tensor<?xf32>, tensor<?xf32>)
469 outs(%1 : tensor<?xf32>) {
470 ^bb0(%arg3: f32, %arg4: f32, %arg5: f32):
471 %3 = arith.addf %arg3, %arg4 : f32
472 linalg.yield %3 : f32
473 } -> tensor<?xf32>
474 %3 = tensor.dim %arg2, %c1 : tensor<?x?xf32>
475 %4 = tensor.empty(%0, %3) : tensor<?x?xf32>
476 %5 = linalg.generic {indexing_maps = [#map1, #map0, #map0], iterator_types = ["parallel", "parallel"]}
477 ins(%2, %arg2 : tensor<?xf32>, tensor<?x?xf32>)
478 outs(%4 : tensor<?x?xf32>){
479 ^bb0(%arg5: f32, %arg6: f32, %arg7: f32):
480 %6 = arith.mulf %arg5, %arg6 : f32
481 linalg.yield %6 : f32
482 } -> tensor<?x?xf32>
483 return %5 : tensor<?x?xf32>
484 }
485 --------------------------------------------------------------------------------
486
487 (toplevel
488 (attribute_alias_def
489 (attribute_value
490 (builtin_attribute
491 (affine_map
492 (bare_id)
493 (bare_id)
494 (bare_id)
495 (bare_id)))))
496 (attribute_alias_def
497 (attribute_value
498 (builtin_attribute
499 (affine_map
500 (bare_id)
501 (bare_id)
502 (bare_id)))))
503 (attribute_alias_def
504 (attribute_value
505 (builtin_attribute
506 (affine_map
507 (bare_id)
508 (bare_id)))))
509 (operation
510 (custom_operation
511 (func_dialect
512 (symbol_ref_id)
513 (func_arg_list
514 (value_use)
515 (type
516 (builtin_type
517 (tensor_type
518 (dim_list
519 (float_type)))))
520 (value_use)
521 (type
522 (builtin_type
523 (tensor_type
524 (dim_list
525 (float_type)))))
526 (value_use)
527 (type
528 (builtin_type
529 (tensor_type
530 (dim_list
531 (float_type))))))
532 (func_return
533 (type_list_attr_parens
534 (type
535 (builtin_type
536 (tensor_type
537 (dim_list
538 (float_type)))))))
539 (region
540 (entry_block
541 (operation
542 (op_result
543 (value_use))
544 (custom_operation
545 (arith_dialect
546 (integer_literal)
547 (type
548 (builtin_type
549 (index_type))))))
550 (operation
551 (op_result
552 (value_use))
553 (custom_operation
554 (arith_dialect
555 (integer_literal)
556 (type
557 (builtin_type
558 (index_type))))))
559 (operation
560 (op_result
561 (value_use))
562 (custom_operation
563 (tensor_dialect
564 (value_use)
565 (value_use)
566 (type
567 (builtin_type
568 (tensor_type
569 (dim_list
570 (float_type))))))))
571 (operation
572 (op_result
573 (value_use))
574 (custom_operation
575 (tensor_dialect
576 (value_use)
577 (type
578 (builtin_type
579 (tensor_type
580 (dim_list
581 (float_type))))))))
582 (operation
583 (op_result
584 (value_use))
585 (custom_operation
586 (linalg_dialect
587 (attribute
588 (dictionary_attribute
589 (attribute_entry
590 (bare_id)
591 (attribute_value
592 (attribute_alias)
593 (attribute_alias)
594 (attribute_alias)))
595 (attribute_entry
596 (bare_id)
597 (attribute_value
598 (string_literal)))))
599 (value_use)
600 (value_use)
601 (type
602 (builtin_type
603 (tensor_type
604 (dim_list
605 (float_type)))))
606 (type
607 (builtin_type
608 (tensor_type
609 (dim_list
610 (float_type)))))
611 (value_use)
612 (type
613 (builtin_type
614 (tensor_type
615 (dim_list
616 (float_type)))))
617 (region
618 (block
619 (block_label
620 (caret_id)
621 (block_arg_list
622 (value_use)
623 (type
624 (builtin_type
625 (float_type)))
626 (value_use)
627 (type
628 (builtin_type
629 (float_type)))
630 (value_use)
631 (type
632 (builtin_type
633 (float_type)))))
634 (operation
635 (op_result
636 (value_use))
637 (custom_operation
638 (arith_dialect
639 (value_use)
640 (value_use)
641 (type
642 (builtin_type
643 (float_type))))))
644 (operation
645 (custom_operation
646 (linalg_dialect
647 (value_use)
648 (type
649 (builtin_type
650 (float_type))))))))
651 (type
652 (builtin_type
653 (tensor_type
654 (dim_list
655 (float_type))))))))
656 (operation
657 (op_result
658 (value_use))
659 (custom_operation
660 (tensor_dialect
661 (value_use)
662 (value_use)
663 (type
664 (builtin_type
665 (tensor_type
666 (dim_list
667 (float_type))))))))
668 (operation
669 (op_result
670 (value_use))
671 (custom_operation
672 (tensor_dialect
673 (value_use)
674 (value_use)
675 (type
676 (builtin_type
677 (tensor_type
678 (dim_list
679 (float_type))))))))
680 (operation
681 (op_result
682 (value_use))
683 (custom_operation
684 (linalg_dialect
685 (attribute
686 (dictionary_attribute
687 (attribute_entry
688 (bare_id)
689 (attribute_value
690 (attribute_alias)
691 (attribute_alias)
692 (attribute_alias)))
693 (attribute_entry
694 (bare_id)
695 (attribute_value
696 (string_literal)
697 (string_literal)))))
698 (value_use)
699 (value_use)
700 (type
701 (builtin_type
702 (tensor_type
703 (dim_list
704 (float_type)))))
705 (type
706 (builtin_type
707 (tensor_type
708 (dim_list
709 (float_type)))))
710 (value_use)
711 (type
712 (builtin_type
713 (tensor_type
714 (dim_list
715 (float_type)))))
716 (region
717 (block
718 (block_label
719 (caret_id)
720 (block_arg_list
721 (value_use)
722 (type
723 (builtin_type
724 (float_type)))
725 (value_use)
726 (type
727 (builtin_type
728 (float_type)))
729 (value_use)
730 (type
731 (builtin_type
732 (float_type)))))
733 (operation
734 (op_result
735 (value_use))
736 (custom_operation
737 (arith_dialect
738 (value_use)
739 (value_use)
740 (type
741 (builtin_type
742 (float_type))))))
743 (operation
744 (custom_operation
745 (linalg_dialect
746 (value_use)
747 (type
748 (builtin_type
749 (float_type))))))))
750 (type
751 (builtin_type
752 (tensor_type
753 (dim_list
754 (float_type))))))))
755 (operation
756 (custom_operation
757 (func_dialect
758 (value_use)
759 (type
760 (builtin_type
761 (tensor_type
762 (dim_list
763 (float_type))))))))))))))
764
765 ================================================================================
766 linalg.generic with attribute alias
767 ================================================================================
768 #map0 = affine_map<() -> ()>
769
770 #attrs = {
771 indexing_maps = [#map0, #map0, #map0],
772 iterator_types = []
773 }
774
775 func.func @main() -> (tensor<i32>) attributes {} {
776 %c0 = arith.constant 0 : i32
777 %0 = tensor.from_elements %c0 : tensor<i32>
778 %c10 = arith.constant 10 : i32
779 %1 = tensor.from_elements %c10 : tensor<i32>
780 cf.br ^bb1(%0 : tensor<i32>)
781
782 ^bb1(%2: tensor<i32>): // 2 preds: ^bb0, ^bb2
783 %3 = tensor.empty() : tensor<i1>
784 %4 = linalg.generic #attrs
785 ins(%2, %1 : tensor<i32>, tensor<i32>)
786 outs(%3 : tensor<i1>) {
787 ^bb0(%arg0: i32, %arg1: i32, %arg2: i1):
788 %8 = arith.cmpi slt, %arg0, %arg1 : i32
789 linalg.yield %8 : i1
790 } -> tensor<i1>
791 %5 = tensor.extract %4[] : tensor<i1>
792 cf.cond_br %5, ^bb2(%2 : tensor<i32>), ^bb3(%2 : tensor<i32>)
793
794 ^bb2(%6: tensor<i32>): // pred: ^bb1
795 %7 = tensor.empty() : tensor<i32>
796 %8 = linalg.generic #attrs
797 ins(%6, %6 : tensor<i32>, tensor<i32>)
798 outs(%7 : tensor<i32>) {
799 ^bb0(%arg0: i32, %arg1: i32, %arg2: i32):
800 %9 = arith.addi %arg0, %arg1 : i32
801 linalg.yield %9 : i32
802 } -> tensor<i32>
803 cf.br ^bb3(%8 : tensor<i32>)
804
805 ^bb3(%10: tensor<i32>): // pred: ^bb1
806 return %10 : tensor<i32>
807 }
808 --------------------------------------------------------------------------------
809
810 (toplevel
811 (attribute_alias_def
812 (attribute_value
813 (builtin_attribute
814 (affine_map))))
815 (attribute_alias_def
816 (attribute_value
817 (dictionary_attribute
818 (attribute_entry
819 (bare_id)
820 (attribute_value
821 (attribute_alias)
822 (attribute_alias)
823 (attribute_alias)))
824 (attribute_entry
825 (bare_id)
826 (attribute_value)))))
827 (operation
828 (custom_operation
829 (func_dialect
830 (symbol_ref_id)
831 (func_arg_list)
832 (func_return
833 (type_list_attr_parens
834 (type
835 (builtin_type
836 (tensor_type
837 (dim_list
838 (integer_type)))))))
839 (attribute
840 (dictionary_attribute))
841 (region
842 (entry_block
843 (operation
844 (op_result
845 (value_use))
846 (custom_operation
847 (arith_dialect
848 (integer_literal)
849 (type
850 (builtin_type
851 (integer_type))))))
852 (operation
853 (op_result
854 (value_use))
855 (custom_operation
856 (tensor_dialect
857 (value_use)
858 (type
859 (builtin_type
860 (tensor_type
861 (dim_list
862 (integer_type))))))))
863 (operation
864 (op_result
865 (value_use))
866 (custom_operation
867 (arith_dialect
868 (integer_literal)
869 (type
870 (builtin_type
871 (integer_type))))))
872 (operation
873 (op_result
874 (value_use))
875 (custom_operation
876 (tensor_dialect
877 (value_use)
878 (type
879 (builtin_type
880 (tensor_type
881 (dim_list
882 (integer_type))))))))
883 (operation
884 (custom_operation
885 (cf_dialect
886 (successor
887 (caret_id)
888 (value_use)
889 (type
890 (builtin_type
891 (tensor_type
892 (dim_list
893 (integer_type))))))))))
894 (block
895 (block_label
896 (caret_id)
897 (block_arg_list
898 (value_use)
899 (type
900 (builtin_type
901 (tensor_type
902 (dim_list
903 (integer_type)))))))
904 (comment)
905 (operation
906 (op_result
907 (value_use))
908 (custom_operation
909 (tensor_dialect
910 (type
911 (builtin_type
912 (tensor_type
913 (dim_list
914 (integer_type))))))))
915 (operation
916 (op_result
917 (value_use))
918 (custom_operation
919 (linalg_dialect
920 (attribute
921 (attribute_alias))
922 (value_use)
923 (value_use)
924 (type
925 (builtin_type
926 (tensor_type
927 (dim_list
928 (integer_type)))))
929 (type
930 (builtin_type
931 (tensor_type
932 (dim_list
933 (integer_type)))))
934 (value_use)
935 (type
936 (builtin_type
937 (tensor_type
938 (dim_list
939 (integer_type)))))
940 (region
941 (block
942 (block_label
943 (caret_id)
944 (block_arg_list
945 (value_use)
946 (type
947 (builtin_type
948 (integer_type)))
949 (value_use)
950 (type
951 (builtin_type
952 (integer_type)))
953 (value_use)
954 (type
955 (builtin_type
956 (integer_type)))))
957 (operation
958 (op_result
959 (value_use))
960 (custom_operation
961 (arith_dialect
962 (value_use)
963 (value_use)
964 (type
965 (builtin_type
966 (integer_type))))))
967 (operation
968 (custom_operation
969 (linalg_dialect
970 (value_use)
971 (type
972 (builtin_type
973 (integer_type))))))))
974 (type
975 (builtin_type
976 (tensor_type
977 (dim_list
978 (integer_type))))))))
979 (operation
980 (op_result
981 (value_use))
982 (custom_operation
983 (tensor_dialect
984 (value_use)
985 (type
986 (builtin_type
987 (tensor_type
988 (dim_list
989 (integer_type))))))))
990 (operation
991 (custom_operation
992 (cf_dialect
993 (value_use)
994 (successor
995 (caret_id)
996 (value_use)
997 (type
998 (builtin_type
999 (tensor_type
1000 (dim_list
1001 (integer_type))))))
1002 (successor
1003 (caret_id)
1004 (value_use)
1005 (type
1006 (builtin_type
1007 (tensor_type
1008 (dim_list
1009 (integer_type))))))))))
1010 (block
1011 (block_label
1012 (caret_id)
1013 (block_arg_list
1014 (value_use)
1015 (type
1016 (builtin_type
1017 (tensor_type
1018 (dim_list
1019 (integer_type)))))))
1020 (comment)
1021 (operation
1022 (op_result
1023 (value_use))
1024 (custom_operation
1025 (tensor_dialect
1026 (type
1027 (builtin_type
1028 (tensor_type
1029 (dim_list
1030 (integer_type))))))))
1031 (operation
1032 (op_result
1033 (value_use))
1034 (custom_operation
1035 (linalg_dialect
1036 (attribute
1037 (attribute_alias))
1038 (value_use)
1039 (value_use)
1040 (type
1041 (builtin_type
1042 (tensor_type
1043 (dim_list
1044 (integer_type)))))
1045 (type
1046 (builtin_type
1047 (tensor_type
1048 (dim_list
1049 (integer_type)))))
1050 (value_use)
1051 (type
1052 (builtin_type
1053 (tensor_type
1054 (dim_list
1055 (integer_type)))))
1056 (region
1057 (block
1058 (block_label
1059 (caret_id)
1060 (block_arg_list
1061 (value_use)
1062 (type
1063 (builtin_type
1064 (integer_type)))
1065 (value_use)
1066 (type
1067 (builtin_type
1068 (integer_type)))
1069 (value_use)
1070 (type
1071 (builtin_type
1072 (integer_type)))))
1073 (operation
1074 (op_result
1075 (value_use))
1076 (custom_operation
1077 (arith_dialect
1078 (value_use)
1079 (value_use)
1080 (type
1081 (builtin_type
1082 (integer_type))))))
1083 (operation
1084 (custom_operation
1085 (linalg_dialect
1086 (value_use)
1087 (type
1088 (builtin_type
1089 (integer_type))))))))
1090 (type
1091 (builtin_type
1092 (tensor_type
1093 (dim_list
1094 (integer_type))))))))
1095 (operation
1096 (custom_operation
1097 (cf_dialect
1098 (successor
1099 (caret_id)
1100 (value_use)
1101 (type
1102 (builtin_type
1103 (tensor_type
1104 (dim_list
1105 (integer_type))))))))))
1106 (block
1107 (block_label
1108 (caret_id)
1109 (block_arg_list
1110 (value_use)
1111 (type
1112 (builtin_type
1113 (tensor_type
1114 (dim_list
1115 (integer_type)))))))
1116 (comment)
1117 (operation
1118 (custom_operation
1119 (func_dialect
1120 (value_use)
1121 (type
1122 (builtin_type
1123 (tensor_type
1124 (dim_list
1125 (integer_type))))))))))))))
1126
1127 ================================================================================
1128 linalg.generic with inline attributes
1129 ================================================================================
1130 func.func @copy_view(%arg0: memref<?xf32, strided<[1], offset: ?>>,
1131 %arg1: memref<?xf32, strided<[1], offset: ?>>) {
1132 linalg.generic {
1133 iterator_types = ["parallel"],
1134 indexing_maps = [ affine_map<(i) -> (i)>, affine_map<(i) -> (i)>] }
1135 ins(%arg0: memref<?xf32, strided<[1], offset: ?>>)
1136 outs(%arg1: memref<?xf32, strided<[1], offset: ?>>) {
1137 ^bb0(%a: f32, %b: f32):
1138 linalg.yield %a : f32
1139 }
1140 return
1141 }
1142 --------------------------------------------------------------------------------
1143
1144 (toplevel
1145 (operation
1146 (custom_operation
1147 (func_dialect
1148 (symbol_ref_id)
1149 (func_arg_list
1150 (value_use)
1151 (type
1152 (builtin_type
1153 (memref_type
1154 (dim_list
1155 (float_type))
1156 (attribute_value
1157 (builtin_attribute
1158 (strided_layout))))))
1159 (value_use)
1160 (type
1161 (builtin_type
1162 (memref_type
1163 (dim_list
1164 (float_type))
1165 (attribute_value
1166 (builtin_attribute
1167 (strided_layout)))))))
1168 (region
1169 (entry_block
1170 (operation
1171 (custom_operation
1172 (linalg_dialect
1173 (attribute
1174 (dictionary_attribute
1175 (attribute_entry
1176 (bare_id)
1177 (attribute_value
1178 (string_literal)))
1179 (attribute_entry
1180 (bare_id)
1181 (attribute_value
1182 (builtin_attribute
1183 (affine_map
1184 (bare_id)
1185 (bare_id)))
1186 (builtin_attribute
1187 (affine_map
1188 (bare_id)
1189 (bare_id)))))))
1190 (value_use)
1191 (type
1192 (builtin_type
1193 (memref_type
1194 (dim_list
1195 (float_type))
1196 (attribute_value
1197 (builtin_attribute
1198 (strided_layout))))))
1199 (value_use)
1200 (type
1201 (builtin_type
1202 (memref_type
1203 (dim_list
1204 (float_type))
1205 (attribute_value
1206 (builtin_attribute
1207 (strided_layout))))))
1208 (region
1209 (block
1210 (block_label
1211 (caret_id)
1212 (block_arg_list
1213 (value_use)
1214 (type
1215 (builtin_type
1216 (float_type)))
1217 (value_use)
1218 (type
1219 (builtin_type
1220 (float_type)))))
1221 (operation
1222 (custom_operation
1223 (linalg_dialect
1224 (value_use)
1225 (type
1226 (builtin_type
1227 (float_type)))))))))))
1228 (operation
1229 (custom_operation
1230 (func_dialect)))))))))
1231
1232 ================================================================================
1233 linalg.broadcast with inline attributes, without dictionary tokens
1234 ================================================================================
1235 func.func @broadcast(%input: tensor<8x32xf32>,
1236 %init: tensor<8x16x32xf32>) -> tensor<8x16x32xf32> {
1237 %bcast = linalg.broadcast
1238 ins(%input:tensor<8x32xf32>)
1239 outs(%init:tensor<8x16x32xf32>)
1240 dimensions = [1]
1241 func.return %bcast : tensor<8x16x32xf32>
1242 }
1243 --------------------------------------------------------------------------------
1244
1245 (toplevel
1246 (operation
1247 (custom_operation
1248 (func_dialect
1249 (symbol_ref_id)
1250 (func_arg_list
1251 (value_use)
1252 (type
1253 (builtin_type
1254 (tensor_type
1255 (dim_list
1256 (float_type)))))
1257 (value_use)
1258 (type
1259 (builtin_type
1260 (tensor_type
1261 (dim_list
1262 (float_type))))))
1263 (func_return
1264 (type_list_attr_parens
1265 (type
1266 (builtin_type
1267 (tensor_type
1268 (dim_list
1269 (float_type)))))))
1270 (region
1271 (entry_block
1272 (operation
1273 (op_result
1274 (value_use))
1275 (custom_operation
1276 (linalg_dialect
1277 (value_use)
1278 (type
1279 (builtin_type
1280 (tensor_type
1281 (dim_list
1282 (float_type)))))
1283 (value_use)
1284 (type
1285 (builtin_type
1286 (tensor_type
1287 (dim_list
1288 (float_type)))))
1289 (bare_attribute_entry
1290 (bare_id)
1291 (attribute_value
1292 (integer_literal))))))
1293 (operation
1294 (custom_operation
1295 (func_dialect
1296 (value_use)
1297 (type
1298 (builtin_type
1299 (tensor_type
1300 (dim_list
1301 (float_type))))))))))))))