summaryrefslogtreecommitdiffhomepage
path: root/ir/common
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2014-09-15 19:03:29 +0200
committerMatthias Braun <matze@braunis.de>2014-09-17 17:17:43 +0200
commitf3209aa8d3fe148e180d1747e7360a8d8737e598 (patch)
tree9f25783911ac099e7fbdfc6b27f36bea19fffc40 /ir/common
parent512cb109a33fcb43c4cb84b220cefd64f33d26e6 (diff)
put irg link directly into node attributs
The previous approach put the irg link into the block attributes, so while saving memory an extra indirection was necessary. Some testing with valgrind massif+callgrind revealed that a direct link increses peak memory usage by ~1% while also increasing runtime by ~1%. More importantly the code gets a bit simpler and some strange corner cases can be removed with the direct link.
Diffstat (limited to 'ir/common')
-rw-r--r--ir/common/irtools.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/ir/common/irtools.c b/ir/common/irtools.c
index 5e4837f..677385b 100644
--- a/ir/common/irtools.c
+++ b/ir/common/irtools.c
@@ -107,11 +107,6 @@ void copy_irn_to_irg(ir_node *n, ir_graph *irg)
frees e.g. the memory of the graph_arr allocated in new_immBlock. */
copy_node_attr(irg, n, nn);
set_irn_link(n, nn);
-
- /* fix the irg for nodes containing a reference to it */
- if (ir_has_irg_ref(nn)) {
- nn->attr.block.irg.irg = irg;
- }
}
ir_node *irn_copy_into_irg(const ir_node *node, ir_graph *irg)
@@ -135,10 +130,6 @@ ir_node *irn_copy_into_irg(const ir_node *node, ir_graph *irg)
/* copy the attributes */
copy_node_attr(irg, node, res);
- /* fix irg attribute */
- if (ir_has_irg_ref(res))
- res->attr.irg.irg = irg;
-
/* duplicate dependency edges */
for (int i = 0, n_deps = get_irn_n_deps(node); i < n_deps; ++i) {
ir_node *dep = get_irn_dep(node, i);