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