summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bepeephole.c
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2011-11-09 19:22:09 +0100
committerMatthias Braun <matze@braunis.de>2011-11-09 19:30:02 +0100
commit133cd801b822b85c204ec60a2f07b8f285cfcc93 (patch)
treee348b5efda9115daddcf015eeab541b7108be3a7 /ir/be/bepeephole.c
parent1475afffa654e08ed191b07e7485df3a3616f56d (diff)
bepeephole: reachability check in can_move_before
before we only tested, if we produce an output that is used as as input of any schedule node in between. This missed the case where you have unscheduled utility nodes like Sync in between.
Diffstat (limited to 'ir/be/bepeephole.c')
-rw-r--r--ir/be/bepeephole.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/ir/be/bepeephole.c b/ir/be/bepeephole.c
index a3fa31d..03e47fc 100644
--- a/ir/be/bepeephole.c
+++ b/ir/be/bepeephole.c
@@ -33,6 +33,7 @@
#include "irprintf.h"
#include "ircons.h"
#include "irgmod.h"
+#include "heights.h"
#include "error.h"
#include "beirg.h"
@@ -248,22 +249,19 @@ bool be_has_only_one_user(ir_node *node)
return n_users == 1;
}
-bool be_can_move_before(const ir_node *node, const ir_node *before)
+bool be_can_move_before(ir_heights_t *heights, const ir_node *node,
+ const ir_node *before)
{
int node_arity = get_irn_arity(node);
ir_node *schedpoint = sched_next(node);
while (schedpoint != before) {
int i;
- int arity = get_irn_arity(schedpoint);
unsigned n_outs = arch_get_irn_n_outs(schedpoint);
/* the node must not use our computed values */
- for (i = 0; i < arity; ++i) {
- ir_node *in = get_irn_n(schedpoint, i);
- if (skip_Proj(in) == node)
- return false;
- }
+ if (heights_reachable_in_block(heights, schedpoint, node))
+ return false;
/* the node must not overwrite registers of our inputs */
for (i = 0; i < node_arity; ++i) {