Skip to content

Commit f494442

Browse files
authored
fix non-registered constprop (#125)
1 parent 2a80009 commit f494442

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/kirin/analysis/const/prop.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ def __init__(
2121
dialects: ir.DialectGroup | Iterable[ir.Dialect],
2222
*,
2323
fuel: int | None = None,
24+
save_all_ssa: bool = False,
2425
max_depth: int = 128,
2526
max_python_recursion_depth: int = 8192,
2627
):
2728
super().__init__(
2829
dialects,
2930
fuel=fuel,
31+
save_all_ssa=save_all_ssa,
3032
max_depth=max_depth,
3133
max_python_recursion_depth=max_python_recursion_depth,
3234
)
@@ -81,6 +83,8 @@ def eval_stmt(
8183
# fallback to top for other statements
8284
return (JointResult(Unknown(), Pure()),)
8385
else:
86+
if frame.extra is None:
87+
frame.extra = ExtraFrameInfo(True)
8488
return (JointResult(Unknown(), NotPure()),)
8589

8690
def _set_frame_not_pure(self, result: interp.StatementResult[JointResult]):

0 commit comments

Comments
 (0)