4 * This file contains the following IRG modifications for be routines:
5 * - insertion of Perm nodes
6 * - empty block elimination
7 * - a simple dead node elimination (set inputs of unreachable nodes to BAD)
9 * @author Sebastian Hack, Daniel Grund, Matthias Braun, Christian Wuerdig
12 * Copyright: (c) Universitaet Karlsruhe
13 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
15 #ifndef _FIRM_BE_IRGMOD_H_
16 #define _FIRM_BE_IRGMOD_H_
23 * Introduce several copies for one node.
25 * A copy in this context means, that you want to introduce several new
26 * abstract values (in Firm: nodes) for which you know, that they
27 * represent the same concrete value. This is the case if you
33 * This function reroutes all uses of the original value to the copies in the
34 * corresponding dominance subtrees and creates Phi functions where necessary.
36 * @note The visited flag and link fields are used.
38 * @param info Dominance frontier information.
39 * @param lv Liveness information to be updated. If NULL, no liveness
40 * updating is performed.
41 * @param value The value that has been duplicated.
42 * @param copies_len the length of the copies array
43 * @param copie an array holding all copies of the value
44 * @param phis An ARR_F where all newly created phis will be inserted,
46 * @param ignore_uses A set of nodes probably using one of the nodes in
47 * @p nodes. Their usage will not adjusted. They remain
48 * untouched by this function. May be NULL.
50 ir_node **be_ssa_construction(const be_dom_front_info_t *info, be_lv_t *lv,
51 ir_node *value, int copies_len, ir_node **copies,
52 const ir_nodeset_t *ignore_uses, int need_new_phis);
55 void be_ssa_constr_set_ignore(const be_dom_front_info_t *info, be_lv_t *lv,
56 pset *nodes, pset *ignores);
60 * Insert a Perm which permutes all (non-ignore) live values of a given register class
61 * after a certain instruction.
62 * @param lv Liveness Information.
63 * @param irn The node to insert the Perm after.
64 * @return The Perm or NULL if nothing was live before @p irn.
66 ir_node *insert_Perm_after(be_irg_t *birg, const arch_register_class_t *cls,
70 * Removes basic blocks that only contain a jump instruction
71 * (this will potentially create critical edges).
73 * @param irg the graph that will be changed
75 * @return non-zero if the graph was changed, zero else
77 int be_remove_empty_blocks(ir_graph *irg);
79 #endif /* _BEIRGMOD_H */