X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeschedmris.c;h=371616a91b9b333b75be9f491e289f576d5c007f;hb=dc391bb4fe93d03bb702d3ed7a7b13bf516c863a;hp=d0b1addf87455f94fd9197c10ba47c60a8f18a6b;hpb=fe38209ec98906bdf35f078d1582e72ecec25ac4;p=libfirm diff --git a/ir/be/beschedmris.c b/ir/be/beschedmris.c index d0b1addf8..371616a91 100644 --- a/ir/be/beschedmris.c +++ b/ir/be/beschedmris.c @@ -1,10 +1,33 @@ +/* + * Copyright (C) 1995-2007 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. + */ + /** + * @file + * @brief Implements a list scheduler for the MRIS algorithm. + * @author Sebastian Hack + * @date 04.04.2006 + * @version $Id$ + * * Implements a list scheduler for the MRIS algorithm in: * Govindarajan, Yang, Amaral, Zhang, Gao * Minimum Register Instruction Sequencing to Reduce Register Spills * in out-of-order issue superscalar architectures - * @author Sebastian Hack - * @date 04.04.2006 */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -24,16 +47,16 @@ #include "irgwalk.h" #include "irtools.h" #include "irbitset.h" - #include "height.h" #include "benode_t.h" #include "besched_t.h" #include "beschedmris.h" #include "benodesets.h" +#include "beirg.h" struct _mris_env_t { - ir_phase ph; + ir_phase ph; heights_t *heights; const arch_env_t *aenv; ir_graph *irg; @@ -60,6 +83,7 @@ typedef struct _mris_irn_t { static void *mris_irn_data_init(ir_phase *ph, ir_node *irn, void *data) { mris_irn_t *mi = data ? data : phase_alloc(ph, sizeof(mi[0])); + (void) irn; memset(mi, 0, sizeof(mi[0])); INIT_LIST_HEAD(&mi->lineage_list); return mi; @@ -487,17 +511,18 @@ void dump_ir_block_graph_mris(mris_env_t *env, const char *suffix) { mris_env_t *be_sched_mris_preprocess(const be_irg_t *birg) { mris_env_t *env = xmalloc(sizeof(env[0])); + ir_graph *irg = be_get_birg_irg(birg); - phase_init(&env->ph, "mris", birg->irg, 2 * PHASE_DEFAULT_GROWTH, mris_irn_data_init); - env->aenv = birg->main_env->arch_env; - env->irg = birg->irg; + phase_init(&env->ph, "mris", irg, 2 * PHASE_DEFAULT_GROWTH, mris_irn_data_init, NULL); + env->aenv = be_get_birg_arch_env(birg); + env->irg = irg; env->visited = 0; - env->heights = heights_new(birg->irg); + env->heights = heights_new(irg); INIT_LIST_HEAD(&env->lineage_head); FIRM_DBG_REGISTER(env->dbg, "firm.be.sched.mris"); obstack_init(&env->obst); - irg_walk_graph(env->irg, firm_clear_link, NULL, NULL); - irg_block_walk_graph(birg->irg, block_walker, NULL, env); + irg_walk_graph(irg, firm_clear_link, NULL, NULL); + irg_block_walk_graph(irg, block_walker, NULL, env); obstack_free(&env->obst, NULL); // dump_ir_block_graph_mris(env, "-mris"); return env;