88from kirin .validation import ValidationPass
99
1010from bloqade import squin
11- from bloqade .analysis .address import Address , AddressReg , AddressQubit , AddressAnalysis
11+ from bloqade .analysis .address import Address , AddressReg , AddressAnalysis
1212
1313
1414@dataclass
@@ -29,21 +29,17 @@ def eval_fallback(self, frame: ForwardFrame, node: ir.Statement):
2929 def check_first_gate (self , qubits : ir .SSAValue ) -> bool :
3030 address = self .addr_frame .get (qubits )
3131
32- if isinstance (address , AddressQubit ):
33- is_first = self .first_gates .get (address .data , True )
34- self .first_gates [address .data ] = False
35- return is_first
36- elif isinstance (address , AddressReg ):
37- is_first = True
38- for addr_int in address .data :
39- is_first = is_first and self .first_gates .get (addr_int , True )
40- self .first_gates [addr_int ] = False
41-
42- return is_first
43-
44- # NOTE: we should have a flat kernel with simple address analysis, so in case we don't
45- # get concrete addresses, we might as well error here since something's wrong
46- return False
32+ if not isinstance (address , AddressReg ):
33+ # NOTE: we should have a flat kernel with simple address analysis, so in case we don't
34+ # get concrete addresses, we might as well error here since something's wrong
35+ return False
36+
37+ is_first = True
38+ for addr_int in address .data :
39+ is_first = is_first and self .first_gates .get (addr_int , True )
40+ self .first_gates [addr_int ] = False
41+
42+ return is_first
4743
4844 def method_self (self , method : ir .Method ) -> EmptyLattice :
4945 return self .lattice .bottom ()
0 commit comments