From 2e3ffede78bcedb20a4f597a0f07699a2a1a17a7 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Fri, 14 Sep 2007 11:53:42 +0000 Subject: [PATCH] do mode_b lowering before abi phase [r15803] --- ir/be/ia32/bearch_ia32.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/ir/be/ia32/bearch_ia32.c b/ir/be/ia32/bearch_ia32.c index 6c6c8c5a7..b0a378565 100644 --- a/ir/be/ia32/bearch_ia32.c +++ b/ir/be/ia32/bearch_ia32.c @@ -917,11 +917,7 @@ ia32_irn_ops_t ia32_irn_ops = { * |___/ **************************************************/ -/** - * Transforms the standard firm graph into - * an ia32 firm graph - */ -static void ia32_prepare_graph(void *self) { +static void ia32_before_abi(void *self) { ia32_code_gen_t *cg = self; ir_lower_mode_b(cg->irg, mode_Iu, 0); @@ -929,6 +925,22 @@ static void ia32_prepare_graph(void *self) { optimize_graph_df(cg->irg); if(cg->dump) be_dump(cg->irg, "-lower_modeb", dump_ir_block_graph_sched); +} + +/** + * Transforms the standard firm graph into + * an ia32 firm graph + */ +static void ia32_prepare_graph(void *self) { + ia32_code_gen_t *cg = self; + + /* TODO: we often have dead code reachable through out-edges here. So for + * now we rebuild edges (as we need correct user count for code selection) + */ +#if 1 + edges_deactivate(cg->irg); + edges_activate(cg->irg); +#endif /* transform nodes into assembler instructions */ ia32_transform_graph(cg); @@ -945,7 +957,7 @@ static void ia32_prepare_graph(void *self) { if (cg->dump) be_dump(cg->irg, "-am", dump_ir_block_graph_sched); - /* do code placement, to optimize the position of constants */ + /* do code placement, (optimize position of constants and argument loads) */ place_code(cg->irg); if (cg->dump) @@ -1451,7 +1463,7 @@ static void *ia32_cg_init(be_irg_t *birg); static const arch_code_generator_if_t ia32_code_gen_if = { ia32_cg_init, - NULL, /* before abi introduce hook */ + ia32_before_abi, /* before abi introduce hook */ ia32_prepare_graph, NULL, /* spill */ ia32_before_sched, /* before scheduling hook */ -- 2.20.1