X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeschedregpress.c;h=a77640935599dcf98c9dee696eb9a3ee9cfd721f;hb=46b1210ed70f149727d212d7bae741ac0ed96028;hp=f2767af89927bc6ef720d138507f0feafec52b3b;hpb=8924d174c51bc58493a17b5ab0675a9c2c959815;p=libfirm diff --git a/ir/be/beschedregpress.c b/ir/be/beschedregpress.c index f2767af89..a77640935 100644 --- a/ir/be/beschedregpress.c +++ b/ir/be/beschedregpress.c @@ -1,20 +1,6 @@ /* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. - * * This file is part of libFirm. - * - * This file may be distributed and/or modified under the terms of the - * GNU General Public License version 2 as published by the Free Software - * Foundation and appearing in the file LICENSE.GPL included in the - * packaging of this file. - * - * Licensees holding valid libFirm Professional Edition licenses may use - * this file in accordance with the libFirm Commercial License. - * Agreement provided with the Software. - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE. + * Copyright (C) 2012 University of Karlsruhe. */ /** @@ -54,34 +40,6 @@ typedef struct { } reg_pressure_selector_env_t; -#if 0 -/* -* Ugly global variable for the compare function -* since qsort(3) does not pass an extra pointer. -*/ -static ir_node *curr_bl = NULL; - -static int cmp_usage(const void *a, const void *b) -{ - struct trivial_sched_env *env; - const ir_node *p = a; - const ir_node *q = b; - int res = 0; - - res = is_live_end(env->curr_bl, a) - is_live_end(env->curr_bl, b); - - /* - * One of them is live at the end of the block. - * Then, that one shall be scheduled at after the other - */ - if (res != 0) - return res; - - - return res; -} -#endif - static inline usage_stats_t *get_or_set_usage_stats(reg_pressure_selector_env_t *env, ir_node *irn) { usage_stats_t *us = (usage_stats_t*)get_irn_link(irn); @@ -185,19 +143,9 @@ static void *reg_pressure_block_init(void *graph_env, ir_node *bl) * Collect usage statistics. */ sched_foreach(bl, irn) { - int i, n; - if (is_Proj(irn) - || (arch_get_irn_flags(irn) & arch_irn_flags_not_scheduled)) - continue; - - for (i = 0, n = get_irn_arity(irn); i < n; ++i) { + for (int i = 0, n = get_irn_arity(irn); i < n; ++i) { usage_stats_t *us = get_or_set_usage_stats(env, irn); -#if 0 /* Liveness is not computed here! */ - if (is_live_end(bl, op)) - us->uses_in_block = 99999; - else -#endif - us->uses_in_block++; + us->uses_in_block++; } }