X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbechordal_main.c;h=d5c0b0e5be3325ad475713cb409e0990ba008710;hb=755e96e2816108e2bef2317b741e49aac230d5bb;hp=29ca472cd71b04eb933234e8aa53b819eb4a7d4f;hpb=02046d6f22e734521c84dfb2f342cf61e6442c2f;p=libfirm diff --git a/ir/be/bechordal_main.c b/ir/be/bechordal_main.c index 29ca472cd..d5c0b0e5b 100644 --- a/ir/be/bechordal_main.c +++ b/ir/be/bechordal_main.c @@ -117,6 +117,7 @@ static const lc_opt_enum_int_items_t lower_perm_stat_items[] = { }; static const lc_opt_enum_int_items_t dump_items[] = { + { "none", BE_CH_DUMP_NONE }, { "spill", BE_CH_DUMP_SPILL }, { "live", BE_CH_DUMP_LIVE }, { "color", BE_CH_DUMP_COLOR }, @@ -418,7 +419,7 @@ static void pre_spill(const arch_isa_t *isa, int cls_idx, post_spill_env_t *pse) /** * Perform things which need to be done per register class after spilling. */ -static void post_spill(post_spill_env_t *pse) { +static void post_spill(post_spill_env_t *pse, int iteration) { be_chordal_env_t *chordal_env = &pse->cenv; be_irg_t *birg = pse->birg; ir_graph *irg = birg->irg; @@ -441,9 +442,15 @@ static void post_spill(post_spill_env_t *pse) { } #endif /* FIRM_STATISTICS */ - check_for_memory_operands(chordal_env); - - be_abi_fix_stack_nodes(birg->abi, birg->lv); + /* + If we have a backend provided spiller, post spill is + called in a loop after spilling for each register class. + But we only need to fix stack nodes once in this case. + */ + if (iteration == 0) { + check_for_memory_operands(chordal_env); + be_abi_fix_stack_nodes(birg->abi, birg->lv); + } BE_TIMER_PUSH(ra_timer.t_verify); @@ -578,7 +585,7 @@ static void be_ra_chordal_main(be_irg_t *birg) dump(BE_CH_DUMP_SPILL, irg, pse.cls, "-spill", dump_ir_block_graph_sched); - post_spill(&pse); + post_spill(&pse, 0); } } else { @@ -601,7 +608,7 @@ static void be_ra_chordal_main(be_irg_t *birg) dump(BE_CH_DUMP_SPILL, irg, NULL, "-spill", dump_ir_block_graph_sched); for (j = 0; j < m; ++j) { - post_spill(&pse[j]); + post_spill(&pse[j], j); } }