Skip to content

Commit 1ab1045

Browse files
committed
immediately return empty predicate list when _extract_operation_predicates does not receive an OperationOp.
1 parent dce8c15 commit 1ab1045

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

xdsl/transforms/convert_pdl_to_pdl_interp/conversion.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,15 @@ def _extract_operation_predicates(
172172
"""Extract predicates for an operation"""
173173
predicates: list[PositionalPredicate] = []
174174

175+
if not isinstance(op_op, pdl.OperationOp):
176+
return predicates
177+
175178
if not op_pos.is_root():
176179
is_not_null = Predicate.get_is_not_null()
177180
predicates.append(
178181
PositionalPredicate(q=is_not_null.q, a=is_not_null.a, position=op_pos)
179182
)
180183

181-
if not isinstance(op_op, pdl.OperationOp):
182-
return predicates
183-
184184
# Operation name check
185185
if op_op.opName:
186186
op_name = op_op.opName.data

0 commit comments

Comments
 (0)