assert that in and out entities of memperms have the same size, we produce such buggy...
[libfirm] / ir / be / beirgmod.h
1 /**
2  * @file
3  * @brief
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)
8  *
9  * @author      Sebastian Hack, Daniel Grund, Matthias Braun, Christian Wuerdig
10  * @date        04.05.2005
11  * @version     $Id$
12  * Copyright:   (c) Universitaet Karlsruhe
13  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
14  */
15 #ifndef _FIRM_BE_IRGMOD_H_
16 #define _FIRM_BE_IRGMOD_H_
17
18 #include "irnode.h"
19 #include "beirg.h"
20
21 #if 0
22 /**
23  * Introduce several copies for one node.
24  *
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
28  * - copy
29  * - spill and reload
30  * - re-materialize
31  * a value.
32  *
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.
35  *
36  * @note The visited flag and link fields are used.
37  *
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,
45  *                    may be NULL
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.
49  */
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);
53
54 /** @deprecated */
55 void be_ssa_constr_set_ignore(const be_dom_front_info_t *info, be_lv_t *lv,
56                               pset *nodes, pset *ignores);
57 #endif
58
59 /**
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.
65  */
66 ir_node *insert_Perm_after(be_irg_t *birg, const arch_register_class_t *cls,
67                                                    ir_node *irn);
68
69 /**
70  * Removes basic blocks that only contain a jump instruction
71  * (this will potentially create critical edges).
72  *
73  * @param irg  the graph that will be changed
74  *
75  * @return non-zero if the graph was changed, zero else
76  */
77 int be_remove_empty_blocks(ir_graph *irg);
78
79 #endif /* _BEIRGMOD_H */