used xcalloc instead of calloc
[libfirm] / ir / be / bephicongr_t.h
1 /**
2  * @author Daniel Grund
3  * @date 09.12.2004
4  */
5
6 #ifndef _BEPHICONGR_T_H
7 #define _BEPHICONGR_T_H
8
9 #include "irnode.h"
10 #include "pset.h"
11
12 /**
13  * Setting this to 0 will treat const nodes like
14  * all other nodes when computing phi congruence classes.
15  * A non zero value results in splitting phi congruence
16  * classes at all const nodes (except they do share
17  * some non-const nodes too)
18  */
19 #define CONSTS_SPLIT_PHI_CLASSES 1
20
21
22 typedef struct _phi_info_t {
23         ir_node *phi;                              /* only set in args of phi nodes (which could be a phi itslef). Points to a phi node or NULL */
24         pset *phi_class;               /* only set in phi nodes. A set containing the members of the phi congruence class this phi node belongs to */
25         int interf_pairs;
26         int interf_vals;
27 } phi_info_t;
28
29 extern size_t phi_irn_data_offset;
30
31 #define get_irn_phi_info(irn)   get_irn_data(irn, phi_info_t, phi_irn_data_offset)
32 /* Only for phi nodes */
33 #define get_phi_class(irn)      get_irn_phi_info(irn)->phi_class
34 #define get_phi_class_size(irn) (get_phi_class(irn)==NULL ? 0 : pset_count(get_phi_class(irn)))
35
36 void be_phi_congr_class_init(void);
37
38 /**
39  * Determines the phi congruence classes of
40  * all phi nodes in a graph
41  */
42 void be_phi_congr_classes(ir_graph *irg);
43
44 #endif