1 // RUN: mlir-opt %s | mlir-opt | FileCheck %s
3 // CHECK: irdl.dialect @testd {
5 // CHECK: irdl.type @parametric {
6 // CHECK: %[[v0:[^ ]*]] = irdl.any
7 // CHECK: irdl.parameters(%[[v0]])
9 irdl.type @parametric {
14 // CHECK: irdl.attribute @parametric_attr {
15 // CHECK: %[[v0:[^ ]*]] = irdl.any
16 // CHECK: irdl.parameters(%[[v0]])
18 irdl.attribute @parametric_attr {
23 // CHECK: irdl.type @attr_in_type_out {
24 // CHECK: %[[v0:[^ ]*]] = irdl.any
25 // CHECK: irdl.parameters(%[[v0]])
27 irdl.type @attr_in_type_out {
32 // CHECK: irdl.operation @eq {
33 // CHECK: %[[v0:[^ ]*]] = irdl.is i32
34 // CHECK: irdl.results(%[[v0]])
41 // CHECK: irdl.operation @anyof {
42 // CHECK: %[[v0:[^ ]*]] = irdl.is i32
43 // CHECK: %[[v1:[^ ]*]] = irdl.is i64
44 // CHECK: %[[v2:[^ ]*]] = irdl.any_of(%[[v0]], %[[v1]])
45 // CHECK: irdl.results(%[[v2]])
47 irdl.operation @anyof {
50 %2 = irdl.any_of(%0, %1)
54 // CHECK: irdl.operation @all_of {
55 // CHECK: %[[v0:[^ ]*]] = irdl.is i32
56 // CHECK: %[[v1:[^ ]*]] = irdl.is i64
57 // CHECK: %[[v2:[^ ]*]] = irdl.any_of(%[[v0]], %[[v1]])
58 // CHECK: %[[v3:[^ ]*]] = irdl.all_of(%[[v2]], %[[v1]])
59 // CHECK: irdl.results(%[[v3]])
61 irdl.operation @all_of {
64 %2 = irdl.any_of(%0, %1)
65 %3 = irdl.all_of(%2, %1)
69 // CHECK: irdl.operation @any {
70 // CHECK: %[[v0:[^ ]*]] = irdl.any
71 // CHECK: irdl.results(%[[v0]])
78 // CHECK: irdl.operation @dyn_type_base {
79 // CHECK: %[[v1:[^ ]*]] = irdl.base @testd::@parametric
80 // CHECK: irdl.results(%[[v1]])
82 irdl.operation @dyn_type_base {
83 %0 = irdl.base @testd::@parametric
87 // CHECK: irdl.operation @dyn_attr_base {
88 // CHECK: %[[v1:[^ ]*]] = irdl.base @testd::@parametric_attr
89 // CHECK: irdl.attributes {"attr1" = %[[v1]]}
91 irdl.operation @dyn_attr_base {
92 %0 = irdl.base @testd::@parametric_attr
93 irdl.attributes {"attr1" = %0}
96 // CHECK: irdl.operation @named_type_base {
97 // CHECK: %[[v1:[^ ]*]] = irdl.base "!builtin.integer"
98 // CHECK: irdl.results(%[[v1]])
100 irdl.operation @named_type_base {
101 %0 = irdl.base "!builtin.integer"
105 // CHECK: irdl.operation @named_attr_base {
106 // CHECK: %[[v1:[^ ]*]] = irdl.base "#builtin.integer"
107 // CHECK: irdl.attributes {"attr1" = %[[v1]]}
109 irdl.operation @named_attr_base {
110 %0 = irdl.base "#builtin.integer"
111 irdl.attributes {"attr1" = %0}
114 // CHECK: irdl.operation @dynparams {
115 // CHECK: %[[v0:[^ ]*]] = irdl.is i32
116 // CHECK: %[[v1:[^ ]*]] = irdl.is i64
117 // CHECK: %[[v2:[^ ]*]] = irdl.any_of(%[[v0]], %[[v1]])
118 // CHECK: %[[v3:[^ ]*]] = irdl.parametric @testd::@parametric<%[[v2]]>
119 // CHECK: irdl.results(%[[v3]])
121 irdl.operation @dynparams {
124 %2 = irdl.any_of(%0, %1)
125 %3 = irdl.parametric @testd::@parametric<%2>
129 // CHECK: irdl.operation @constraint_vars {
130 // CHECK: %[[v0:[^ ]*]] = irdl.is i32
131 // CHECK: %[[v1:[^ ]*]] = irdl.is i64
132 // CHECK: %[[v2:[^ ]*]] = irdl.any_of(%[[v0]], %[[v1]])
133 // CHECK: irdl.results(%[[v2]], %[[v2]])
135 irdl.operation @constraint_vars {
138 %2 = irdl.any_of(%0, %1)
142 // CHECK: irdl.operation @attrs {
143 // CHECK: %[[v0:[^ ]*]] = irdl.is i32
144 // CHECK: %[[v1:[^ ]*]] = irdl.is i64
145 // CHECK: irdl.attributes {"attr1" = %[[v0]], "attr2" = %[[v1]]}
147 irdl.operation @attrs {
156 // CHECK: irdl.operation @regions {
157 // CHECK: %[[r0:[^ ]*]] = irdl.region
158 // CHECK: %[[v0:[^ ]*]] = irdl.is i32
159 // CHECK: %[[v1:[^ ]*]] = irdl.is i64
160 // CHECK: %[[r1:[^ ]*]] = irdl.region(%[[v0]], %[[v1]])
161 // CHECK: %[[r2:[^ ]*]] = irdl.region with size 3
162 // CHECK: %[[r3:[^ ]*]] = irdl.region()
163 // CHECK: irdl.regions(%[[r0]], %[[r1]], %[[r2]], %[[r3]])
165 irdl.operation @regions {
169 %r1 = irdl.region(%v0, %v1)
170 %r2 = irdl.region with size 3
173 irdl.regions(%r0, %r1, %r2, %r3)
176 // CHECK: irdl.operation @region_and_operand {
177 // CHECK: %[[v0:[^ ]*]] = irdl.any
178 // CHECK: %[[r0:[^ ]*]] = irdl.region(%[[v0]])
179 // CHECK: irdl.operands(%[[v0]])
180 // CHECK: irdl.regions(%[[r0]])
182 irdl.operation @region_and_operand {
184 %r0 = irdl.region(%v0)