summaryrefslogtreecommitdiffhomepage
path: root/ir/be/belive.c
diff options
context:
space:
mode:
authorMatthias Braun <matthias.braun@kit.edu>2012-08-16 16:30:56 +0200
committerMatthias Braun <matthias.braun@kit.edu>2012-08-21 13:56:12 +0200
commitd7c75dd3795a9dc7af9342ead4a5ed0a01f9b3ce (patch)
tree63fd0cd661efd407ece011bb31e0895a08fea337 /ir/be/belive.c
parent69ea35dad47322047ab3fc29f639d332d4f7c360 (diff)
use be_foreach_definition in liveness_transfer
Diffstat (limited to 'ir/be/belive.c')
-rw-r--r--ir/be/belive.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/ir/be/belive.c b/ir/be/belive.c
index 3129520..8b7911d 100644
--- a/ir/be/belive.c
+++ b/ir/be/belive.c
@@ -509,30 +509,21 @@ void be_liveness_update(be_lv_t *lv, ir_node *irn)
void be_liveness_transfer(const arch_register_class_t *cls,
ir_node *node, ir_nodeset_t *nodeset)
{
- int i, arity;
-
/* You should better break out of your loop when hitting the first phi
* function. */
assert(!is_Phi(node) && "liveness_transfer produces invalid results for phi nodes");
- if (get_irn_mode(node) == mode_T) {
- foreach_out_edge(node, edge) {
- ir_node *proj = get_edge_src_irn(edge);
+ ir_node *value;
+ be_foreach_definition(node, cls, value,
+ ir_nodeset_remove(nodeset, value);
+ );
- if (arch_irn_consider_in_reg_alloc(cls, proj)) {
- ir_nodeset_remove(nodeset, proj);
- }
- }
- } else if (arch_irn_consider_in_reg_alloc(cls, node)) {
- ir_nodeset_remove(nodeset, node);
- }
-
- arity = get_irn_arity(node);
- for (i = 0; i < arity; ++i) {
+ int arity = get_irn_arity(node);
+ for (int i = 0; i < arity; ++i) {
ir_node *op = get_irn_n(node, i);
-
- if (arch_irn_consider_in_reg_alloc(cls, op))
- ir_nodeset_insert(nodeset, op);
+ if (!arch_irn_consider_in_reg_alloc(cls, op))
+ continue;
+ ir_nodeset_insert(nodeset, op);
}
}