未验证 提交 b5ffe5bc 编写于 作者: Q QI JUN 提交者: GitHub

optimize data flow analysis (#8271)

上级 73f1b471
...@@ -92,14 +92,13 @@ class ControlFlowGraph(object): ...@@ -92,14 +92,13 @@ class ControlFlowGraph(object):
live_in = defaultdict(set) live_in = defaultdict(set)
live_out = defaultdict(set) live_out = defaultdict(set)
while True: while True:
for i in range(self.op_size): for i in range(self.op_size, 0, -1):
live_in[i] = set(self._live_in[i]) live_in[i] = set(self._live_in[i])
live_out[i] = set(self._live_out[i]) live_out[i] = set(self._live_out[i])
self._live_in[i] = self._uses[i] | (
self._live_out[i] - self._defs[i])
for s in self._successors[i]: for s in self._successors[i]:
self._live_out[i] |= self._live_in[s] self._live_out[i] |= self._live_in[s]
self._live_in[i] = self._uses[i] | (
self._live_out[i] - self._defs[i])
if self._reach_fixed_point(live_in, live_out): if self._reach_fixed_point(live_in, live_out):
break break
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册