From: Matthias Braun Date: Thu, 21 Jun 2012 09:48:21 +0000 (+0200) Subject: normalize Sync node by sorting their inputs X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=b4a48e9c597df8f2e3559c037ed5a7b35f24b5fa;p=libfirm normalize Sync node by sorting their inputs This also makes the compiler alot more deterministic avoiding, lots of "random" jumping around in series of stores and loads. --- diff --git a/ir/ir/iropt.c b/ir/ir/iropt.c index 44c40d456..bbcfc0d91 100644 --- a/ir/ir/iropt.c +++ b/ir/ir/iropt.c @@ -6194,7 +6194,8 @@ static ir_node *transform_node_Sync(ir_node *n) ++arity; break; } - if (get_Sync_pred(n, k) == pred_pred) break; + if (get_Sync_pred(n, k) == pred_pred) + break; } } } @@ -6820,6 +6821,15 @@ void del_identities(ir_graph *irg) del_pset(irg->value_table); } +static int cmp_node_nr(const void *a, const void *b) +{ + ir_node **p1 = (ir_node**)a; + ir_node **p2 = (ir_node**)b; + long n1 = get_irn_node_nr(*p1); + long n2 = get_irn_node_nr(*p2); + return (n1>n2) - (n1