X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbessaconstr.h;h=ab08c76e8ba783668892c265c8c487813fd90eea;hb=c1fdf770d4d000dd5cf22daead32369342c5f5d1;hp=d92640493e575f559dceb0aecc844cfb789aa128;hpb=4d5c3365a58cba59993045a9e08e686d8ae079a7;p=libfirm diff --git a/ir/be/bessaconstr.h b/ir/be/bessaconstr.h index d92640493..ab08c76e8 100644 --- a/ir/be/bessaconstr.h +++ b/ir/be/bessaconstr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -19,13 +19,22 @@ /** * @file - * @brief Introduce several copies for one node. - * @author Sebastian Hack, Daniel Grund, Matthias Braun, Christian Wuerdig - * @date 30.03.2007 - * @version $Id$ - * Copyright: (c) Universitaet Karlsruhe - * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. - + * @brief SSA construction for a set of nodes + * @author Sebastian Hack, Daniel Grund, Matthias Braun, Christian Wuerdig + * @date 30.03.2007 + * @version $Id$ + * + * The problem: Given a value and a set of "copies" that are known to + * represent the same abstract value, rewire all usages of the original value + * to their closest copy while introducing phis as necessary. + * + * Algorithm: Mark all blocks in the iterated dominance frontiers of the value + * and it's copies. Link the copies ordered by dominance to the blocks. Then + * we search for each use all definitions in the current block, if none is + * found, then we search one in the immediate dominator. If we are in a block + * of the dominance frontier, create a phi and do the same search for all + * phi arguments. + * * A copy in this context means, that you want to introduce several new * abstract values (in Firm: nodes) for which you know, that they * represent the same concrete value. This is the case if you @@ -37,29 +46,32 @@ * This function reroutes all uses of the original value to the copies in the * corresponding dominance subtrees and creates Phi functions where necessary. */ -#ifndef FIRM_BE_SSACONSTR_H -#define FIRM_BE_SSACONSTR_H +#ifndef FIRM_BE_BESSACONSTR_H +#define FIRM_BE_BESSACONSTR_H -#include +#include "firm_types.h" #include "bedomfront.h" -#include "irnode.h" #include "irnodeset.h" #include "belive.h" +#include "bitset.h" #include "beirg.h" #include "pdeq.h" typedef struct be_ssa_construction_env_t { - ir_graph *irg; - const be_dom_front_info_t *domfronts; - ir_mode *mode; - waitq *worklist; - const ir_nodeset_t *ignore_uses; + ir_graph *irg; + const be_dom_front_info_t *domfronts; + ir_mode *mode; + waitq *worklist; + const ir_nodeset_t *ignore_uses; ir_node **new_phis; - int iterated_domfront_calculated; + int iterated_domfront_calculated; } be_ssa_construction_env_t; /** - * Initializes an ssa construction environment. + * Initializes an SSA construction environment. + * + * @param env an SSA empty construction environment + * @param birg */ void be_ssa_construction_init(be_ssa_construction_env_t *env, be_irg_t *birg); @@ -95,4 +107,4 @@ ir_node **be_ssa_construction_get_new_phis(be_ssa_construction_env_t *env); */ void be_ssa_construction_destroy(be_ssa_construction_env_t *env); -#endif +#endif /* FIRM_BE_BESSACONSTR_H */