summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bepeephole.c
diff options
context:
space:
mode:
authorChristoph Mallon <mallon@cs.uni-saarland.de>2015-01-09 10:43:56 +0100
committerChristoph Mallon <mallon@cs.uni-saarland.de>2015-01-09 10:45:12 +0100
commit5b09d5ac08399faf9487b70fe366b7bc703a9415 (patch)
tree6426eff2021b818ac4dda0066370cd2591069831 /ir/be/bepeephole.c
parent3efe95eb6a546c5a07926f1dec956369edfa0951 (diff)
bepeephole: Add be_peephole_to_tuple().
Diffstat (limited to 'ir/be/bepeephole.c')
-rw-r--r--ir/be/bepeephole.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ir/be/bepeephole.c b/ir/be/bepeephole.c
index 0568bf2..8577d11 100644
--- a/ir/be/bepeephole.c
+++ b/ir/be/bepeephole.c
@@ -139,6 +139,17 @@ void be_peephole_exchange(ir_node *old, ir_node *nw)
be_liveness_introduce(lv, nw);
}
+ir_node *be_peephole_to_tuple(ir_node *const node)
+{
+ be_liveness_remove(lv, node);
+ ir_mode *const mode = get_irn_mode(node);
+ set_irn_mode(node, mode_T);
+ ir_node *const res = new_r_Proj(node, mode, 0);
+ edges_reroute_except(node, res, res);
+ be_liveness_introduce(lv, res);
+ return res;
+}
+
/**
* block-walker: run peephole optimization on the given block.
*/