/*
- * 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.
*/
/**
} 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);
* 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++;
}
}
static ir_node *reg_pressure_select(void *block_env, ir_nodeset_t *ready_set)
{
- ir_nodeset_iterator_t iter;
reg_pressure_selector_env_t *env = (reg_pressure_selector_env_t*)block_env;
- ir_node *irn, *res = NULL;
- int curr_cost = INT_MAX;
+ ir_node *res = NULL;
+ int curr_cost = INT_MAX;
assert(ir_nodeset_size(ready_set) > 0);