X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fana%2Fphiclass.h;h=c7d0fb04b8057180fe05f1860d06b975a27a1e05;hb=95afc5aaefb484a67fb89f02b5e96cc302fe02ef;hp=44a5a264074fbf108511dd2c715260454de4f675;hpb=b5db01b639d1c10ecf815a6807213e0094fbd871;p=libfirm diff --git a/ir/ana/phiclass.h b/ir/ana/phiclass.h index 44a5a2640..c7d0fb04b 100644 --- a/ir/ana/phiclass.h +++ b/ir/ana/phiclass.h @@ -1,48 +1,76 @@ -/** - * Analysis to compute phi congruence classes. - * @author Daniel Grund - * @date 15.01.2005 +/* + * 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. */ -#ifndef _BEPHICONGR_H -#define _BEPHICONGR_H +/** + * @file + * @brief Analysis to compute phi congruence classes. + * @author Daniel Grund + * @version $Id$ + * @date 15.01.2005 + */ +#ifndef FIRM_ANA_PHICLASS_H +#define FIRM_ANA_PHICLASS_H #include "pset.h" #include "irgraph.h" #include "irnode.h" +#include "irnodeset.h" + +typedef struct _phi_classes_t phi_classes_t; + +/** + * Return the array containing all nodes assigned to the same Phi class as @p irn. + */ +ir_node **get_phi_class(phi_classes_t *pc, ir_node *irn); /** - * Initialize data structures + * Assigns a new array of nodes representing the new Phi class to @p irn. */ -void phi_class_init(void); +void set_phi_class(phi_classes_t *pc, ir_node *irn, ir_node **cls); /** - * Computes all phi classes of an irg. - * @param irg The ir-graph to compute the classes for. - * @return Sets the internal data structures. + * Returns a set containing all computed Phi classes. */ -void phi_class_compute(ir_graph *irg); +pset *get_all_phi_classes(phi_classes_t *pc); /** - * Computes all phi classes of an irg. All phi nodes of this irg must be - * contained in @p all_phi_nodes. Otherwise the results may be wrong. - * @param all_phi_nodes All phi nodes of an irg. - * @return A set containing all phi classes as psets + * Builds the Phi classes for all Phis in @p irg. + * @param irg The irg the classes should be build for + * @param pure_phi_classes Set to one if Phi classes should only contain Phi nodes. + * Beware: This might result in different (more) Phi classes as if not set + * @return The Phi class object for the @p irg. */ -pset *phi_class_compute_by_phis(pset *all_phi_nodes); +phi_classes_t *phi_class_new_from_irg(ir_graph *irg, int pure_phi_classes); /** - * Throws away all allocated memory for phi classes of an irg. - * @param irg The ir-graph to free recources for. - * @return Frees the internal data structures. + * Builds all Phi classes for the given set of Phis. + * @param irg The irg, the Phis are from + * @param all_phis An ir_nodeset containing all Phis nodes to build the classes for + * @param pure_phi_classes Set to one if Phi classes should only contain Phi nodes. + * Beware: This might result in different (more) Phi classes as if not set + * @return The Phis class object for @p all_phis. */ -void phi_class_free(ir_graph *irg); +phi_classes_t *phi_class_new_from_set(ir_graph *irg, ir_nodeset_t *all_phis, int pure_phi_classes); /** - * @param irn A node to get the phi class for - * @return A pset containing all members of the phi class @p irn belongs to. - * If @p irn is not member of a phi class NULL is returned. + * Free all allocated data. */ -pset *get_phi_class(const ir_node *irn); +void phi_class_free(phi_classes_t *pc); #endif