From 9cf6223aa6356b752d000117aaeb7913701e1638 Mon Sep 17 00:00:00 2001 From: Daniel Grund Date: Fri, 22 Jul 2005 11:28:07 +0000 Subject: [PATCH] Change to copy costs instead of number of copies. --- ir/be/becopyoptmain.c | 35 +++++++++++++++++------------------ ir/be/becopyoptmain.h | 4 ++-- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/ir/be/becopyoptmain.c b/ir/be/becopyoptmain.c index ee0954e73..a6480641e 100644 --- a/ir/be/becopyoptmain.c +++ b/ir/be/becopyoptmain.c @@ -30,43 +30,42 @@ void be_copy_opt_init(void) { void be_copy_opt(be_chordal_env_t *chordal_env) { copy_opt_t *co; - int lb, copies; + int lb, copy_costs; - co = new_copy_opt(chordal_env); + co = new_copy_opt(chordal_env, get_costs_loop_depth); DBG((dbg, LEVEL_1, "===> %s <===\n", co->name)); - co_check_allocation(co); #ifdef DO_STAT - copies = co_get_copy_count(co); - curr_vals[I_COPIES_INIT] += copies; - DBG((dbg, LEVEL_1, "Init copies: %3d\n", copies)); + copy_costs = co_get_copy_costs(co); + curr_vals[I_COPIES_INIT] += copy_costs; + DBG((dbg, LEVEL_1, "Init costs: %3d\n", copy_costs)); #endif #ifdef DO_HEUR co_heur_opt(co); - co_check_allocation(co); + be_ra_chordal_check(chordal_env); #ifdef DO_STAT - copies = co_get_copy_count(co); - curr_vals[I_COPIES_HEUR] += copies; - DBG((dbg, LEVEL_1, "Heur copies: %3d\n", copies)); + copy_costs = co_get_copy_costs(co); + curr_vals[I_COPIES_HEUR] += copy_costs; + DBG((dbg, LEVEL_1, "Heur costs: %3d\n", copy_costs)); #endif #endif #ifdef DO_ILP lb = co_get_lower_bound(co); - copies = co_get_copy_count(co); - assert(copies>=lb && "At least one computation of these two is boooogy"); + copy_costs = co_get_copy_costs(co); + assert(copy_costs>=lb && "At least one computation of these two is boooogy"); - if (copies > lb) { + if (copy_costs > lb) { co_ilp_opt(co); - co_check_allocation(co); + be_ra_chordal_check(chordal_env); } #ifdef DO_STAT - copies = co_get_copy_count(co); - curr_vals[I_COPIES_OPT] += copies; - DBG((dbg, LEVEL_1, "Opt copies: %3d\n", copies)); - assert(copies>=lb && "At least one computation of these two is boooogy"); + copy_costs = co_get_copy_costs(co); + curr_vals[I_COPIES_OPT] += copy_costs; + DBG((dbg, LEVEL_1, "Opt costs: %3d\n", copy_costs)); + assert(copy_costs>=lb && "At least one computation of these two is boooogy"); #endif #endif diff --git a/ir/be/becopyoptmain.h b/ir/be/becopyoptmain.h index 9bf9c0be1..51d2cb10e 100644 --- a/ir/be/becopyoptmain.h +++ b/ir/be/becopyoptmain.h @@ -4,10 +4,9 @@ * Copyright: (c) Universitaet Karlsruhe * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. - * Main header for the optimization reducing the copies needed for: + * Main header for the optimization reducing the copy costs needed for: * - phi coalescing * - register-constrained nodes - * */ #ifndef _BECOPYOPTMAIN_H @@ -20,5 +19,6 @@ void be_copy_opt_init(void); void be_copy_opt(be_chordal_env_t *chordal_env); +void be_copy_opt_verify(be_chordal_env_t *chordal_env); #endif -- 2.20.1