Skip to content

Commit

Permalink
Improving attribute forwarding in p_expand_multi_precision
Browse files Browse the repository at this point in the history
  • Loading branch information
nibrunie committed Nov 18, 2018
1 parent 5a50d1a commit 776b044
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion metalibm_core/opt/p_expand_multi_precision.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ def wrapp_expand(op):
new_op = expander(*(sum(operands_expansion, [])), precision=elt_precision)
# setting dedicated name to expanded node
self.tag_expansion(node, new_op)
# forward other attributes
for elt in new_op:
elt.set_debug(node.get_debug())
elt.set_handle(node.get_handle())
return new_op

def expand_add(self, add_node):
Expand Down Expand Up @@ -408,7 +412,10 @@ def reconstruct_from_transformed(self, node, transformed_node):
if isinstance(node, Constant):
return node
else:
return BuildFromComponent(*tuple(transformed_node), precision=node.precision)
result = BuildFromComponent(*tuple(transformed_node), precision=node.precision)
forward_attributes(node, result)
result.set_tag(node.get_tag())
return result

## standard Opt pass API
def execute(self, optree):
Expand Down

0 comments on commit 776b044

Please sign in to comment.