fixed some bugs
[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 #include "pset.h"
14
15 /*
16  * Forward type declaration.
17  */
18 typedef struct _dom_front_info_t dom_front_info_t;
19
20 /**
21  * Compute the dominance frontiers for a given graph.
22  * @param  irg The graphs.
23  * @return A pointer to the dominance frontier information.
24  */
25 dom_front_info_t *be_compute_dominance_frontiers(ir_graph *irg);
26
27 /**
28  * Get the dominance frontier of a block.
29  * @param info  A pointer to the dominance frontier information.
30  * @param block The block whose dominance frontier you want.
31  * @return A set containing the all blocks in the dominance frontier of @p block.
32  */
33 pset *be_get_dominance_frontier(dom_front_info_t *info, ir_node *block);
34
35 /**
36  * Free some dominance frontier information.
37  * @param info Some dominance frontier information.
38  */
39 void be_free_dominance_frontiers(dom_front_info_t *info);
40
41 /**
42  * Introduce several copies for one node.
43  *
44  * A copy in this context means, that you want to introduce several new
45  * abstract values (in Firm: nodes) for which you know, that they
46  * represent the same concrete value. This is the case if you
47  * - copy
48  * - spill and reload
49  * - re-materialize
50  * a value.
51  *
52  * This function reroutes all uses of the original value to the copies in the
53  * corresponding dominance subtrees and creates Phi functions if necessary.
54  *
55  * @param info            Dominance frontier information.
56  * @param n           Length of nodes array.
57  * @param nodes       The nodes which shall represent the same SSA value.
58  * @param phis        A set to which all inserted Phis are added.
59  * @param ignore_uses A set of nodes probably using one of the nodes in @p nodes.
60  *                    Their usage will not adjusted. They remain untouched by this function.
61  */
62 void be_ssa_constr_phis_ignore(dom_front_info_t *info, int n, ir_node *nodes[], pset *phis, pset *ignore_uses);
63
64 /**
65  * Same as be_ssa_constr_phis_ignore() but without the ignore set.
66  */
67 void be_ssa_constr_phis(dom_front_info_t *info, int n, ir_node *nodes[], pset *phis);
68
69 /**
70  * Same as be_ssa_constr_phis_ignore() but without the Phi set.
71  */
72 void be_ssa_constr_ignore(dom_front_info_t *info, int n, ir_node *nodes[], pset *ignore_uses);
73
74 /**
75  * Same as be_ssa_constr_ignore() but with empty ignore set.
76  */
77 void be_ssa_constr(dom_front_info_t *info, int n, ir_node *nodes[]);
78
79 /**
80  * Same as be_ssa_constr_ignore() but with pset instead of array.
81  */
82 void be_ssa_constr_set_ignore(dom_front_info_t *df, pset *nodes, pset *ignore_uses);
83
84 /**
85  * Same as be_ssa_constr() but with pset instead of array.
86  */
87 void be_ssa_constr_set(dom_front_info_t *info, pset *nodes);
88
89 /**
90  * Same as be_ssa_constr_phis_ignore() but with set instead of array.
91  */
92 void be_ssa_constr_set_phis_ignore(dom_front_info_t *info, pset *nodes, pset *phis, pset *ignore);
93
94 /**
95  * Same as be_ssa_constr_phis_ignore() but without ignore set.
96  */
97 void be_ssa_constr_set_phis(dom_front_info_t *info, pset *nodes, pset *phis);
98
99 #endif