From d0bf4325a38cd93458f136cc39a08fb4ba8e74b8 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Sat, 25 Aug 2007 19:50:16 +0000 Subject: [PATCH] Drastically lower the runtime of the strong normal form theorem scheduler by not putting nodes, which are in the schedule list already, in the list again. [r15608] --- ir/be/beschednormal.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ir/be/beschednormal.c b/ir/be/beschednormal.c index ba89e9b7f..c13498782 100644 --- a/ir/be/beschednormal.c +++ b/ir/be/beschednormal.c @@ -260,6 +260,8 @@ static ir_node** sched_node(ir_node** sched, ir_node* irn) int arity = get_irn_arity(irn); int i; + if (irn_visited(irn)) return sched; + if (!is_Phi(irn)) { for (i = 0; i < arity; ++i) { ir_node* pred = get_irn_n(irn, i); @@ -268,6 +270,7 @@ static ir_node** sched_node(ir_node** sched, ir_node* irn) } } + mark_irn_visited(irn); ARR_APP1(ir_node*, sched, irn); return sched; } @@ -343,6 +346,7 @@ static void *normal_init_graph(const list_sched_selector_t *vtab, irg_walk_graph(irg, normal_cost_walker, NULL, NULL); irg_walk_graph(irg, collect_roots, NULL, NULL); + inc_irg_visited(irg); irg_block_walk_graph(irg, normal_sched_block, NULL, NULL); return NULL; -- 2.20.1