def default(self, n): if isinstance(n, ArithInstr): if n.lhs: lhs = n.lhs.name else: lhs = None if isinstance(n, IntMoveInstr) and isinstance(n.rhs[0], Name): rhs = n.rhs[0].name for v in n.live: if lhs and v != full_reg(lhs) and v != rhs: self.add_interference(v, full_reg(lhs)) self.add_move(full_reg(lhs), rhs) else: for v in n.live: if lhs and v != full_reg(lhs): self.add_interference(v, full_reg(lhs)) else: Visitor.default(self, n)
def free_vars(n): if isinstance(n, Const): return set([]) elif isinstance(n, Name): return set([n.name]) elif isinstance(n, FunName): return set([]) elif isinstance(n, Register): #?? -JGS return set([full_reg(n.name)]) else: return set([])
def free_vars(n): if isinstance(n, Const): return set([]) elif isinstance(n, Name): return set([n.name]) # elif isinstance(n, FunName): # return set([]) elif isinstance(n, Register): #?? -JGS return set([full_reg(n.name)]) else: return set([])
def default(self, n): if False: print 'visiting ' + repr(n) if isinstance(n, ArithInstr): if n.lhs: lhs = n.lhs.name else: lhs = None if isinstance(n, IntMoveInstr) \ and (isinstance(n.rhs[0], Name) \ or isinstance(n.rhs[0], Register)): rhs = n.rhs[0].name for v in n.live: if lhs and v != full_reg(lhs) and v != rhs: self.add_interference(v, full_reg(lhs)) self.add_move(full_reg(lhs), rhs) else: for v in n.live: if lhs and v != full_reg(lhs): self.add_interference(v, full_reg(lhs)) else: Visitor.default(self, n)
def visitPopValue(self, n): lhs = n.target.name for v in n.live: if lhs and v != full_reg(lhs): self.add_interference(v, full_reg(lhs))