- add block Phi list resource
[libfirm] / include / libfirm / phiclass.h
1 /*
2  * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
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.
10  *
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.
14  *
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
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief   Analysis to compute phi congruence classes.
23  * @author  Daniel Grund
24  * @version $Id$
25  * @date    15.01.2005
26  */
27 #ifndef FIRM_ANA_PHICLASS_H
28 #define FIRM_ANA_PHICLASS_H
29
30 #include "pset.h"
31 #include "irgraph.h"
32 #include "irnode.h"
33 #include "irnodeset.h"
34
35 typedef struct _phi_classes_t phi_classes_t;
36
37 /**
38  * Return the array containing all nodes assigned to the same Phi class as @p irn.
39  */
40 ir_node **get_phi_class(phi_classes_t *pc, ir_node *irn);
41
42 /**
43  * Assigns a new array of nodes representing the new Phi class to @p irn.
44  */
45 void set_phi_class(phi_classes_t *pc, ir_node *irn, ir_node **cls);
46
47 /**
48  * Returns a set containing all computed Phi classes.
49  */
50 pset *get_all_phi_classes(phi_classes_t *pc);
51
52 /**
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.
58  */
59 phi_classes_t *phi_class_new_from_irg(ir_graph *irg, int pure_phi_classes);
60
61 /**
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.
68  */
69 phi_classes_t *phi_class_new_from_set(ir_graph *irg, ir_nodeset_t *all_phis, int pure_phi_classes);
70
71 /**
72  * Free all allocated data.
73  */
74 void phi_class_free(phi_classes_t *pc);
75
76 #endif