renamed phase_t to ir_phase
[libfirm] / ir / ana / phiclass.h
1 /**
2  * Analysis to compute phi congruence classes.
3  * @author Daniel Grund
4  * @cvsid  $Id$
5  * @date   15.01.2005
6  */
7
8 #ifndef _PHICLASS_H_
9 #define _PHICLASS_H_
10
11 #include "pset.h"
12 #include "irgraph.h"
13 #include "irnode.h"
14 #include "irnodeset.h"
15
16 typedef struct _phi_classes_t phi_classes_t;
17
18 /**
19  * Return the array containing all nodes assigned to the same Phi class as @p irn.
20  */
21 ir_node **get_phi_class(phi_classes_t *pc, ir_node *irn);
22
23 /**
24  * Assigns a new array of nodes representing the new Phi class to @p irn.
25  */
26 void set_phi_class(phi_classes_t *pc, ir_node *irn, ir_node **cls);
27
28 /**
29  * Returns a set containing all computed Phi classes.
30  */
31 pset *get_all_phi_classes(phi_classes_t *pc);
32
33 /**
34  * Builds the Phi classes for all Phis in @p irg.
35  * @param irg               The irg the classes should be build for
36  * @param pure_phi_classes  Set to one if Phi classes should only contain Phi nodes.
37  *                          Beware: This might result in different (more) Phi classes as if not set
38  * @return The Phi class object for the @p irg.
39  */
40 phi_classes_t *phi_class_new_from_irg(ir_graph *irg, int pure_phi_classes);
41
42 /**
43  * Builds all Phi classes for the given set of Phis.
44  * @param irg               The irg, the Phis are from
45  * @param all_phis          An ir_nodeset containing all Phis nodes to build the classes for
46  * @param pure_phi_classes  Set to one if Phi classes should only contain Phi nodes.
47  *                          Beware: This might result in different (more) Phi classes as if not set
48  * @return The Phis class object for @p all_phis.
49  */
50 phi_classes_t *phi_class_new_from_set(ir_graph *irg, ir_nodeset_t *all_phis, int pure_phi_classes);
51
52 /**
53  * Free all allocated data.
54  */
55 void phi_class_free(phi_classes_t *pc);
56
57 #endif /* _PHICLASS_H_ */