summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bepeephole.c
diff options
context:
space:
mode:
authorJohannes Bucher <johannes.bucher2@student.kit.edu>2020-02-20 15:56:27 +0100
committerJohannes Bucher <johannes.bucher2@student.kit.edu>2020-02-21 14:08:04 +0100
commit8ec9cdb5700d3fac4ffe6331cb26364b9dc3d756 (patch)
tree42015aa028fda8cffe86947d0e4a6e8dac30729b /ir/be/bepeephole.c
parent8fa5acb79803197f6bf2d6db38b920453688f463 (diff)
amd64: peephole: remove consecutive zero extensions
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 d291d3e..89d2bf8 100644
--- a/ir/be/bepeephole.c
+++ b/ir/be/bepeephole.c
@@ -130,6 +130,17 @@ static void be_peephole_before_exchange(const ir_node *old_node,
be_liveness_remove(lv, old_node);
}
+void be_peephole_exchange_using_proj(ir_node *old_proj, ir_node *nw)
+{
+ assert(is_Proj(old_proj));
+ ir_node *old = skip_Proj(old_proj);
+ assert(be_has_only_one_user(old));
+ be_peephole_before_exchange(old, nw);
+ sched_remove(old);
+ exchange(old_proj, nw);
+ be_liveness_introduce(lv, nw);
+}
+
void be_peephole_exchange(ir_node *old, ir_node *nw)
{
be_peephole_before_exchange(old, nw);