mirror of
https://github.com/data61/MP-SPDZ.git
synced 2026-01-09 05:27:56 -05:00
Fix ignored duplicate registers.
This commit is contained in:
@@ -180,9 +180,10 @@ def determine_scope(block, options):
|
||||
used_from_scope = set_by_id()
|
||||
|
||||
def read(reg, n):
|
||||
if last_def[reg] == -1:
|
||||
reg.can_eliminate = False
|
||||
used_from_scope.add(reg)
|
||||
for dup in reg.duplicates:
|
||||
if last_def[dup] == -1:
|
||||
dup.can_eliminate = False
|
||||
used_from_scope.add(dup)
|
||||
|
||||
def write(reg, n):
|
||||
if last_def[reg] != -1:
|
||||
@@ -331,8 +332,9 @@ class Merger:
|
||||
d[j] = d[i]
|
||||
|
||||
def read(reg, n):
|
||||
if last_def[reg] != -1:
|
||||
add_edge(last_def[reg], n)
|
||||
for dup in reg.duplicates:
|
||||
if last_def[dup] != -1:
|
||||
add_edge(last_def[dup], n)
|
||||
|
||||
def write(reg, n):
|
||||
last_def[reg] = n
|
||||
|
||||
@@ -22,7 +22,7 @@ class SparseDiGraph(object):
|
||||
self.default_attributes = default_attributes
|
||||
self.attribute_pos = dict(list(zip(list(default_attributes.keys()), list(range(len(default_attributes))))))
|
||||
self.n = max_nodes
|
||||
# each node contains list of default attributes, followed by outoing edges
|
||||
# each node contains list of default attributes, followed by outgoing edges
|
||||
self.nodes = [list(self.default_attributes.values()) for i in range(self.n)]
|
||||
self.succ = [collections.OrderedDict() for i in range(self.n)]
|
||||
self.pred = [set() for i in range(self.n)]
|
||||
|
||||
Reference in New Issue
Block a user