2 * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
4 * This file is part of libFirm.
6 * This file may be distributed and/or modified under the terms of the
7 * GNU General Public License version 2 as published by the Free Software
8 * Foundation and appearing in the file LICENSE.GPL included in the
9 * packaging of this file.
11 * Licensees holding valid libFirm Professional Edition licenses may use
12 * this file in accordance with the libFirm Commercial License.
13 * Agreement provided with the Software.
15 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * @brief Analysis to compute phi congruence classes.
23 * @author Daniel Grund
27 #ifndef FIRM_ANA_PHICLASS_H
28 #define FIRM_ANA_PHICLASS_H
33 #include "irnodeset.h"
35 typedef struct _phi_classes_t phi_classes_t;
38 * Return the array containing all nodes assigned to the same Phi class as @p irn.
40 ir_node **get_phi_class(phi_classes_t *pc, ir_node *irn);
43 * Assigns a new array of nodes representing the new Phi class to @p irn.
45 void set_phi_class(phi_classes_t *pc, ir_node *irn, ir_node **cls);
48 * Returns a set containing all computed Phi classes.
50 pset *get_all_phi_classes(phi_classes_t *pc);
53 * Builds the Phi classes for all Phis in @p irg.
54 * @param irg The irg the classes should be build for
55 * @param pure_phi_classes Set to one if Phi classes should only contain Phi nodes.
56 * Beware: This might result in different (more) Phi classes as if not set
57 * @return The Phi class object for the @p irg.
59 phi_classes_t *phi_class_new_from_irg(ir_graph *irg, int pure_phi_classes);
62 * Builds all Phi classes for the given set of Phis.
63 * @param irg The irg, the Phis are from
64 * @param all_phis An ir_nodeset containing all Phis nodes to build the classes for
65 * @param pure_phi_classes Set to one if Phi classes should only contain Phi nodes.
66 * Beware: This might result in different (more) Phi classes as if not set
67 * @return The Phis class object for @p all_phis.
69 phi_classes_t *phi_class_new_from_set(ir_graph *irg, ir_nodeset_t *all_phis, int pure_phi_classes);
72 * Free all allocated data.
74 void phi_class_free(phi_classes_t *pc);