X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fberaextern.c;h=36305a6584d48545759a1f4b7904a87402569adb;hb=9276447aec4972df060349e162f583c4898dfec8;hp=d10e455be4382779d09dd5e6d7a449e4fd628d20;hpb=8535fe8732b0acf822be252812a7158ce5b8134a;p=libfirm diff --git a/ir/be/beraextern.c b/ir/be/beraextern.c index d10e455be..36305a658 100644 --- a/ir/be/beraextern.c +++ b/ir/be/beraextern.c @@ -1,10 +1,28 @@ -/** - * Author: Daniel Grund - * Date: 17.01.2006 - * Copyright: (c) Universitaet Karlsruhe - * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. +/* + * 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. * - * Implementation of the RA-Interface for an external, (non-SSA) register allocator. + * 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 Implementation of the RA-Interface for an external, (non-SSA) register allocator. + * @author Daniel Grund + * @date 17.01.2006 + * @version $Id$ * * The external register allocator is a program: * PROG -i INPUTFILE -o OUTPUTFILE @@ -51,20 +69,12 @@ allocs ::= 'allocs' alloc* . alloc ::= node-nr reg-nr . - -******** End of file format docu ********/ - +*/ +#ifdef NOT_PORTED #ifdef HAVE_CONFIG_H #include "config.h" #endif -#ifdef HAVE_MALLOC_H - #include -#endif -#ifdef HAVE_ALLOCA_H - #include -#endif - #include #include #include @@ -76,6 +86,7 @@ alloc ::= node-nr reg-nr . #include "pmap.h" #include "bitset.h" #include "raw_bitset.h" +#include "xmalloc.h" #include "irprintf_t.h" #include "irnode_t.h" @@ -86,9 +97,8 @@ alloc ::= node-nr reg-nr . #include "phiclass.h" #include "bemodule.h" -#include "beraextern.h" #include "beabi.h" -#include "bearch.h" +#include "bearch_t.h" #include "benode_t.h" #include "beirgmod.h" #include "besched_t.h" @@ -419,7 +429,7 @@ static void dump_affinities_walker(ir_node *irn, void *env) { req = arch_get_register_req(raenv->aenv, irn, pos); if (arch_register_req_is(req, should_be_same)) { - ir_node *other = get_irn_n(irn, req->other_same); + ir_node *other = get_irn_n(skip_Proj(irn), req->other_same); if(arch_irn_is(raenv->aenv, other, ignore)) { vi2 = be_get_var_info(other); @@ -544,7 +554,7 @@ static INLINE void var_add_spills_and_reloads(be_raext_env_t *raenv, int var_nr) mode = get_irn_mode(get_irn_n(spill, be_pos_Spill_val)); /* insert reloads and wire them arbitrary*/ - pset_foreach(vi->values, irn) + pset_foreach(vi->values, irn) { foreach_out_edge_safe(irn, edge, ne) { ir_node *reload, *src = edge->src; if (is_Phi(src) || be_is_Spill(src)) @@ -558,9 +568,10 @@ static INLINE void var_add_spills_and_reloads(be_raext_env_t *raenv, int var_nr) /* remember the reload */ pset_insert_ptr(reloads, reload); } + } /* correct the reload->spill pointers... */ - be_ssa_constr_set(dom_front, lv, spills); + be_ssa_constr_set_ignore(dom_front, lv, spills, NULL); /****** correct the variable <--> values mapping: ****** @@ -754,7 +765,7 @@ static void be_ra_extern_main(be_irg_t *birg) { dump_to_file(&raenv, out); execute(callee, out, in); done = read_and_apply_results(&raenv, in); - be_abi_fix_stack_nodes(birg->abi, birg->lv); + be_abi_fix_stack_nodes(birg->abi); ir_snprintf(in, sizeof(in), "-extern-%s-round-%d", raenv.cls->name, round); be_dump(irg, in, dump_ir_block_graph_sched); @@ -817,3 +828,5 @@ void be_init_raextern(void) { be_register_allocator("ext", &be_ra_external_allocator); } BE_REGISTER_MODULE_CONSTRUCTOR(be_init_raextern); + +#endif /* NOT_PORTED */