Skip to content

Commit 99360b1

Browse files
authored
remove custom constprop for wire (#235)
@Roger-luo has fixed Kirin's constprop to [handle multiple result values](QuEraComputing/kirin#393) (: the custom constprop for certain wire statements is no longer needed
1 parent aa571b3 commit 99360b1

File tree

2 files changed

+6
-19
lines changed

2 files changed

+6
-19
lines changed

src/bloqade/squin/wire.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
dialect.
77
"""
88

9-
from kirin import ir, types, interp, lowering
9+
from kirin import ir, types, lowering
1010
from kirin.decl import info, statement
1111
from kirin.lowering import wraps
1212

@@ -112,18 +112,6 @@ class Reset(ir.Statement):
112112
wire: ir.SSAValue = info.argument(WireType)
113113

114114

115-
# Issue where constant propagation can't handle
116-
# multiple return values from Apply properly
117-
@dialect.register(key="constprop")
118-
class ConstPropWire(interp.MethodTable):
119-
120-
@interp.impl(Apply)
121-
@interp.impl(Broadcast)
122-
def apply(self, interp, frame, stmt: Apply):
123-
124-
return frame.get_values(stmt.inputs)
125-
126-
127115
@wraps(Unwrap)
128116
def unwrap(qubit: Qubit) -> Wire: ...
129117

test/squin/test_constprop.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
# There's a method table in the wire dialect statements
2-
# that handles the multiple return values from Apply and Broadcast
3-
# that can cause problems for constant propoagation's default implementation.
4-
# These tests just make sure there are corresponding lattice types per each
5-
# SSA value (as opposed to a bunch of "missing" entries despite multiple
6-
# return values from Broadcast and Apply)
1+
# These tests are used to verify the multiple
2+
# result values from certain statements are handled properly
3+
# in constant propagation. Originally a custom constprop
4+
# method table had to be implemented but the newer version of
5+
# Kirin has fixed this issue (:
76

87
from kirin import ir, types
98
from kirin.passes import Fold

0 commit comments

Comments
 (0)