From 88752fd7e976139dc02990c064695f3345612c3d Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Mon, 7 May 2007 20:44:40 +0000 Subject: [PATCH] spill-slot coalescing added [r13703] --- ir/be/arm/bearch_arm.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ir/be/arm/bearch_arm.c b/ir/be/arm/bearch_arm.c index 7a281c1bf..efb1123be 100644 --- a/ir/be/arm/bearch_arm.c +++ b/ir/be/arm/bearch_arm.c @@ -51,6 +51,7 @@ #include "../beilpsched.h" #include "../bemodule.h" #include "../beirg_t.h" +#include "../bespillslots.h" #include "../begnuas.h" #include "bearch_arm_t.h" @@ -304,6 +305,14 @@ static void arm_before_ra(void *self) { /* Some stuff you need to do immediately after register allocation */ } +/** + * We transform Spill and Reload here. This needs to be done before + * stack biasing otherwise we would miss the corrected offset for these nodes. + */ +static void arm_after_ra(void *self) { + arm_code_gen_t *cg = self; + be_coalesce_spillslots(cg->birg); +} /** * Emits the code, closes the output file and frees @@ -311,7 +320,7 @@ static void arm_before_ra(void *self) { */ static void arm_emit_and_done(void *self) { arm_code_gen_t *cg = self; - ir_graph *irg = cg->irg; + ir_graph *irg = cg->irg; dump_ir_block_graph_sched(irg, "-arm-finished"); arm_gen_routine(cg, irg); @@ -525,7 +534,7 @@ static const arch_code_generator_if_t arm_code_gen_if = { NULL, /* spill */ arm_before_sched, /* before scheduling hook */ arm_before_ra, /* before register allocation hook */ - NULL, /* after register allocation */ + arm_after_ra, arm_finish_irg, arm_emit_and_done, }; -- 2.20.1