File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -106,9 +106,14 @@ module @ir attributes { test.apply_constraint_3 } {
106
106
// Test support for negated constraints.
107
107
module @patterns {
108
108
pdl_interp.func @matcher (%root : !pdl.operation ) {
109
- pdl_interp.apply_constraint " single_entity_constraint" (%root : !pdl.operation ) {isNegated = true } -> ^pat , ^end
109
+ %test_attr = pdl_interp.create_attribute unit
110
+ %attr = pdl_interp.get_attribute " test_attr" of %root
111
+ pdl_interp.are_equal %test_attr , %attr : !pdl.attribute -> ^pat , ^end
110
112
111
113
^pat :
114
+ pdl_interp.apply_constraint " single_entity_constraint" (%root : !pdl.operation ) {isNegated = true } -> ^pat1 , ^end
115
+
116
+ ^pat1 :
112
117
pdl_interp.record_match @rewriters ::@success (%root : !pdl.operation ) : benefit (1 ), loc ([%root ]) -> ^end
113
118
114
119
^end :
@@ -129,8 +134,8 @@ module @patterns {
129
134
// CHECK: "test.replaced_by_pattern"
130
135
131
136
module @ir attributes { test.apply_constraint_4 } {
132
- " test.op" () : () -> ()
133
- " test.foo" () : () -> ()
137
+ " test.op" () { test_attr } : () -> ()
138
+ " test.foo" () { test_attr } : () -> ()
134
139
}
135
140
136
141
// -----
You can’t perform that action at this time.
0 commit comments