From 6db21e55b6bd30eee19a2ccdf316449c92c5d8a0 Mon Sep 17 00:00:00 2001 From: Sebastian Hack Date: Wed, 5 Jan 2005 14:06:30 +0000 Subject: [PATCH] Merged with checked in stuff. --- ir/be/bemain.c | 9 ++++++--- ir/be/benumb_t.h | 2 +- ir/be/beutil.h | 13 +++++++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/ir/be/bemain.c b/ir/be/bemain.c index 2f43b0a79..7679c9de9 100644 --- a/ir/be/bemain.c +++ b/ir/be/bemain.c @@ -22,6 +22,8 @@ #include "belistsched.h" #include "belive_t.h" #include "beutil.h" +#include "bephicongr_t.h" +#include "bechordal.h" #include "bechordal.h" #include "bephiopt.h" #include "phistat.h" @@ -95,7 +97,8 @@ void be_init(void) be_liveness_init(); be_numbering_init(); be_ra_init(); - be_phi_opt_init(); + be_ra_chordal_init(); + be_phi_congr_class_init(); } extern void be_ra_chordal(ir_graph *irg); @@ -107,14 +110,14 @@ static void be_main_loop(void) for(i = 0, n = get_irp_n_irgs(); i < n; ++i) { ir_graph *irg = get_irp_irg(i); + localize_consts(irg); be_numbering(irg); list_sched(irg, trivial_selector, NULL); be_liveness(irg); be_ra_chordal(irg); be_phi_opt(irg); - - //dump_allocated_irg(irg); + // dump_allocated_irg(irg); #ifndef DO_STATISTICS be_ra_chordal_done(irg); diff --git a/ir/be/benumb_t.h b/ir/be/benumb_t.h index 0c9dd488d..8318e1072 100644 --- a/ir/be/benumb_t.h +++ b/ir/be/benumb_t.h @@ -71,7 +71,7 @@ static INLINE int __get_graph_node_count(const ir_graph *irg) static INLINE ir_node *__get_irn_for_graph_nr(const ir_graph *irg, int nr) { ir_node **map = get_irg_numbering_const(irg)->reverse_map; - assert(nr >= 0 && nr < __get_graph_node_count(irg) && map[nr] != NULL); + assert(nr >= 0 && nr <= __get_graph_node_count(irg) && map[nr] != NULL); return map[nr]; } diff --git a/ir/be/beutil.h b/ir/be/beutil.h index 3c2c50e24..a32cc59a5 100644 --- a/ir/be/beutil.h +++ b/ir/be/beutil.h @@ -37,7 +37,20 @@ static INLINE int is_data_node(const ir_node *irn) return 0; } +/** + * Make each constant local to its use. + * This duplicates all constants in order to simulate a realistic + * register pressure. + * @param irg The graph. + */ +void localize_consts(ir_graph *irg); +/** + * Dump a vcg graph containing the controlflow graph, the schedule and + * allocated registers. + * @param irg The irg. Note that scheduling, register allocation must + * have been performed. + */ void dump_allocated_irg(ir_graph *irg); #endif -- 2.20.1