Author: Ronan Lamy <ronan.l...@gmail.com> Branch: expressions Changeset: r74436:b499e643c6d3 Date: 2014-11-09 01:11 +0000 http://bitbucket.org/pypy/pypy/changeset/b499e643c6d3/
Log: fix transform_dead_op_vars_in_blocks() diff --git a/rpython/annotator/expression.py b/rpython/annotator/expression.py --- a/rpython/annotator/expression.py +++ b/rpython/annotator/expression.py @@ -21,3 +21,7 @@ return V_Type(mapping[self.arg]) else: return self + + @property + def dependencies(self): + return self.arg.dependencies diff --git a/rpython/flowspace/model.py b/rpython/flowspace/model.py --- a/rpython/flowspace/model.py +++ b/rpython/flowspace/model.py @@ -325,6 +325,10 @@ def replace(self, mapping): return mapping.get(self, self) + @property + def dependencies(self): + return set([self]) + class Constant(Hashable): __slots__ = ["concretetype"] @@ -356,6 +360,10 @@ def replace(self, mapping): return self + @property + def dependencies(self): + return set() + class FSException(object): def __init__(self, w_type, w_value): diff --git a/rpython/translator/simplify.py b/rpython/translator/simplify.py --- a/rpython/translator/simplify.py +++ b/rpython/translator/simplify.py @@ -420,9 +420,11 @@ # figure out which variables are ever read for op in block.operations: if not canremove(op, block): # the inputs are always needed - read_vars.update(op.args) + for arg in op.args: + read_vars.update(arg.dependencies) else: - dependencies[op.result].update(op.args) + for arg in op.args: + dependencies[op.result].update(arg.dependencies) if isinstance(block.exitswitch, Variable): read_vars.add(block.exitswitch) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit