3 * IRG modifications for be routines.
6 * Copyright (C) 2005 Universitaet Karlsruhe.
7 * Released under the GPL.
13 #include "firm_types.h"
19 * Forward type declaration.
21 typedef struct _be_dom_front_info_t be_dom_front_info_t;
24 * Compute the dominance frontiers for a given graph.
25 * @param irg The graphs.
26 * @return A pointer to the dominance frontier information.
28 be_dom_front_info_t *be_compute_dominance_frontiers(ir_graph *irg);
31 * Get the dominance frontier of a block.
32 * @param info A pointer to the dominance frontier information.
33 * @param block The block whose dominance frontier you want.
34 * @return A set containing the all blocks in the dominance frontier of @p block.
36 pset *be_get_dominance_frontier(be_dom_front_info_t *info, ir_node *block);
39 * Free some dominance frontier information.
40 * @param info Some dominance frontier information.
42 void be_free_dominance_frontiers(be_dom_front_info_t *info);
45 * Introduce several copies for one node.
47 * A copy in this context means, that you want to introduce several new
48 * abstract values (in Firm: nodes) for which you know, that they
49 * represent the same concrete value. This is the case if you
55 * This function reroutes all uses of the original value to the copies in the
56 * corresponding dominance subtrees and creates Phi functions if necessary.
58 * @param info Dominance frontier information.
59 * @param lv Liveness information to be updated. If NULL, liveness updating is simply ignored.
60 * @param n Length of nodes array.
61 * @param nodes The nodes which shall represent the same SSA value.
62 * @param phis A set to which all inserted Phis are added.
63 * @param ignore_uses A set of nodes probably using one of the nodes in @p nodes.
64 * Their usage will not adjusted. They remain untouched by this function.
66 void be_ssa_constr_phis_ignore(be_dom_front_info_t *info, be_lv_t *lv, int n, ir_node *nodes[], pset *phis, pset *ignore_uses);
69 * Same as be_ssa_constr_phis_ignore() but without the ignore set.
71 void be_ssa_constr_phis(be_dom_front_info_t *info, be_lv_t *lv, int n, ir_node *nodes[], pset *phis);
74 * Same as be_ssa_constr_phis_ignore() but without the Phi set.
76 void be_ssa_constr_ignore(be_dom_front_info_t *info, be_lv_t *lv, int n, ir_node *nodes[], pset *ignore_uses);
79 * Same as be_ssa_constr_ignore() but with empty ignore set.
81 void be_ssa_constr(be_dom_front_info_t *info, be_lv_t *lv, int n, ir_node *nodes[]);
84 * Same as be_ssa_constr_ignore() but with pset instead of array.
86 void be_ssa_constr_set_ignore(be_dom_front_info_t *df, be_lv_t *lv, pset *nodes, pset *ignore_uses);
89 * Same as be_ssa_constr() but with pset instead of array.
91 void be_ssa_constr_set(be_dom_front_info_t *info, be_lv_t *lv, pset *nodes);
94 * Same as be_ssa_constr_phis_ignore() but with set instead of array.
96 void be_ssa_constr_set_phis_ignore(be_dom_front_info_t *info, be_lv_t *lv, pset *nodes, pset *phis, pset *ignore);
99 * Same as be_ssa_constr_phis_ignore() but without ignore set.
101 void be_ssa_constr_set_phis(be_dom_front_info_t *info, be_lv_t *lv, pset *nodes, pset *phis);
104 * Insert a Perm which permutes all (non-ignore) live values of a given register class
105 * after a certain instruction.
106 * @param arch_env The architecture environment.
107 * @param lv Liveness Information.
108 * @param cls The register class.
109 * @param dom_front Dominance frontier information.
110 * @param irn The node to insert the Perm after.
111 * @return The Perm or NULL if nothing was live before @p irn.
113 ir_node *insert_Perm_after(const arch_env_t *arch_env,
115 const arch_register_class_t *cls,
116 be_dom_front_info_t *dom_front,
119 struct _be_chordal_env_t;
121 void extreme_liverange_splitting(struct _be_chordal_env_t *cenv);
124 * removes basic blocks that only contain a jump instruction
125 * (this will potentially create critical edges)
127 void be_remove_empty_blocks(ir_graph *irg);
129 #endif /* _BEIRGMOD_H */