We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df50bd1 commit aae487aCopy full SHA for aae487a
src/kirin/dialects/ilist/rewrite/flatten_add.py
@@ -9,8 +9,10 @@ class FlattenAdd(RewriteRule):
9
def rewrite_Statement(self, node: ir.Statement) -> RewriteResult:
10
if not (
11
isinstance(node, py.binop.Add)
12
- and node.lhs.type.is_subseteq(ilist.IListType)
13
- and node.rhs.type.is_subseteq(ilist.IListType)
+ and (lhs_type := node.lhs.type).is_subseteq(ilist.IListType)
+ and (rhs_type := node.rhs.type).is_subseteq(ilist.IListType)
14
+ and not lhs_type.is_structurally_equal(types.Bottom)
15
+ and not rhs_type.is_structurally_equal(types.Bottom)
16
):
17
return RewriteResult()
18
0 commit comments