Misc changes
[libfirm] / ir / be / beirgmod.h
1
2 /**
3  * IRG modifications for be routines.
4  * @date 4.5.2005
5  *
6  * Copyright (C) 2005 Universitaet Karlsruhe.
7  * Released under the GPL.
8  */
9
10 #ifndef _BEIRGMOD_H
11 #define _BEIRGMOD_H
12
13 /*
14  * Forward type declaration.
15  */
16 typedef struct _dom_front_info_t dom_front_info_t;
17
18 /**
19  * Compute the dominance frontiers for a given graph.
20  * @param  irg The graphs.
21  * @return A pointer to the dominance frontier information.
22  */
23 dom_front_info_t *be_compute_dominance_frontiers(ir_graph *irg);
24
25 /**
26  * Get the dominance frontier of a block.
27  * @param info  A pointer to the dominance frontier information.
28  * @param block The block whose dominance frontier you want.
29  * @return A set containing the all blocks in the dominance frontier of @p block.
30  */
31 pset *be_get_dominance_frontier(dom_front_info_t *info, ir_node *block);
32
33 /**
34  * Free some dominance frontier information.
35  * @param info Some dominance frontier information.
36  */
37 void be_free_dominance_frontiers(dom_front_info_t *info);
38
39 /**
40  * Introduce several copies for one node.
41  *
42  * A copy in this context means, that you want to introduce several new
43  * abstract values (in Firm: nodes) for which you know, that they
44  * represent the same concrete value. This is the case if you
45  * - copy
46  * - spill and reload
47  * - rematerialize
48  * a value.
49  *
50  * This function reroutes all uses of the original value to the copies in the
51  * corresponding dominance subtrees and creates Phi functions if neccessary.
52  *
53  * @param info          Dominance frontier information.
54  * @param orig          The node for which you want to introduce copies.
55  * @param n                     The number of copies ypu introduce.
56  * @param copies        An array of nodes which are copies of @p orig.
57  */
58 void be_introduce_copies_ignore(dom_front_info_t *info, ir_node *orig,
59     int n, ir_node *copies[], pset *irgore_uses);
60
61 void be_introduce_copies(dom_front_info_t *info, ir_node *orig,
62     int n, ir_node *copies[]);
63 #endif