3 * @brief Introduce several copies for one node.
4 * @author Sebastian Hack, Daniel Grund, Matthias Braun, Christian Wuerdig
7 * Copyright: (c) Universitaet Karlsruhe
8 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
10 * A copy in this context means, that you want to introduce several new
11 * abstract values (in Firm: nodes) for which you know, that they
12 * represent the same concrete value. This is the case if you
18 * This function reroutes all uses of the original value to the copies in the
19 * corresponding dominance subtrees and creates Phi functions where necessary.
21 #ifndef FIRM_BE_SSACONSTR_H
22 #define FIRM_BE_SSACONSTR_H
25 #include "bedomfront.h"
27 #include "irnodeset.h"
32 typedef struct be_ssa_construction_env_t {
34 const be_dom_front_info_t *domfronts;
37 const ir_nodeset_t *ignore_uses;
39 int iterated_domfront_calculated;
40 } be_ssa_construction_env_t;
43 * Initializes an ssa construction environment.
45 void be_ssa_construction_init(be_ssa_construction_env_t *env, be_irg_t *birg);
47 void be_ssa_construction_add_copy(be_ssa_construction_env_t *env,
50 void be_ssa_construction_add_copies(be_ssa_construction_env_t *env,
51 ir_node **copies, size_t copies_len);
53 void be_ssa_construction_set_ignore_uses(be_ssa_construction_env_t *env,
54 const ir_nodeset_t *ignore_uses);
57 * Reconstructs the ssa form for all users of node @p node
59 void be_ssa_construction_fix_users(be_ssa_construction_env_t *env,
62 void be_ssa_construction_fix_users_array(be_ssa_construction_env_t *env,
63 ir_node **nodes, size_t nodes_len);
66 * Recompute the liveness of the inserted phis.
67 * @note Remember that you have to call update_liveness on the copies yourself
69 void be_ssa_construction_update_liveness_phis(be_ssa_construction_env_t *env,
72 ir_node **be_ssa_construction_get_new_phis(be_ssa_construction_env_t *env);
75 * Destroys an ssa construction environment.
77 void be_ssa_construction_destroy(be_ssa_construction_env_t *env);