Added new arch interface
[libfirm] / ir / be / bechordal_t.h
1
2 /**
3  * Internal datastructures for the chordal register allocator.
4  * @author Sebastian Hack
5  * @date 25.1.2005
6  */
7
8 #ifndef _BECHORDAL_T_H
9 #define _BECHORDAL_T_H
10
11 #define BUILD_GRAPH
12
13 /**
14  * A liveness interval border.
15  */
16 typedef struct _border_t {
17 #ifdef DEBUG_libfirm
18         unsigned magic;                                                         /**< A magic number for checking. */
19 #endif
20         struct list_head list;                          /**< list head for queuing. */
21         struct _border_t *other_end;    /**< The other end of the border. */
22         ir_node *irn;                                                 /**< The node. */
23         unsigned step;                                                          /**< The number equal to the interval border. */
24         unsigned pressure;                                              /**< The pressure at this interval border.
25                                                                                                                                         (The border itself is counting). */
26         unsigned is_def : 1;                                    /**< Does this border denote a use or a def. */
27         unsigned is_real : 1;                                   /**< Is the def/use real? Or is it just inserted
28                                                                                                                                         at block beginnings or ends to ensure that inside
29                                                                                                                                         a block, each value has one begin and one end. */
30 } border_t;
31
32 #ifdef BUILD_GRAPH
33 typedef struct _if_node_t {
34         int nnr;
35         pset *neighb;
36 } if_node_t;
37
38 typedef struct _if_edge_t {
39         int src, tgt;
40 } if_edge_t;
41
42 set *be_ra_get_ifg(ir_graph *irg); /**< Deprecated. Use be_ra_get_ifg_edges. */
43 set *be_ra_get_ifg_edges(ir_graph *irg);
44 set *be_ra_get_ifg_nodes(ir_graph *irg);
45 int ifg_has_edge(const ir_graph *irg, if_node_t *n1, if_node_t* n2);
46 #define ifn_get_degree(ifnode) pset_count(ifnode->neighb)
47 #define foreach_neighb(ifnode, curr) \
48                         for(curr=pset_first(ifnode->neighb); curr; curr=pset_next(ifnode->neighb))
49 #endif
50
51 extern void be_ra_chordal_spill(ir_graph *irg);
52
53 #endif /* _BECHORDAL_T_H */