extended functionality
[libfirm] / ir / ana / phiclass_t.h
1 /**
2  * Analysis to conmpute phi congruence classes.
3  * @author Daniel Grund
4  * @date 09.12.2004
5  */
6
7 #ifndef _BEPHICONGR_T_H
8 #define _BEPHICONGR_T_H
9
10 #include "phiclass.h"
11
12 typedef struct _phi_info_t {
13         ir_node *phi;           /**< For all nodes of a phi class points to a phi node
14                                                          representing the phi class and holding the ptr to
15                                                          the pset phi_class      or NULL */
16         pset *phi_class;        /**< Only set in phi nodes. A set containing the members
17                                                          of the phi congruence class this phi node represents */
18 } phi_info_t;
19
20 extern size_t phi_irn_data_offset;
21
22 #define get_irn_phi_info(irn)   get_irn_data(irn, phi_info_t, phi_irn_data_offset)
23
24 /**
25  * Setting this to 0 will treat const nodes like
26  * all other nodes when computing phi congruence classes.
27  * A non zero value results in splitting phi congruence
28  * classes at all const nodes (except they do share
29  * some non-const nodes too)
30  *
31  * If constants are localized this is irrelevant. Set to 0 in this case.
32  */
33 #define CONSTS_SPLIT_PHI_CLASSES 0
34
35 /**
36  * Computes all phi classes of an irg. All phi nodes of this irg must be
37  * contained in @p all_phi_nodes. Otherwise the results will be incorrect.
38  * @param all_phi_nodes All phi nodes of an irg.
39  * @return A set containing all phi classes as psets
40  */
41 pset *phi_class_compute_by_phis(pset *all_phi_nodes);
42
43
44 #endif