2 * Interblock liveness analysis.
3 * @author Sebastian Hack
10 #include "firm_types.h"
17 * Compute the inter block liveness for a graph.
18 * @param irg The graph.
20 void be_liveness(ir_graph *irg);
23 * Dump the liveness information for a graph.
24 * @param f The output.
25 * @param irg The graph.
27 void be_liveness_dump(ir_graph *irg, FILE *f);
30 * Dump the liveness information for a graph.
31 * @param irg The graph.
32 * @param cls_name A string used as substring in the filename.
34 void be_liveness_dumpto(ir_graph *irg, const char *cls_name);
37 * Check, if a node is live in at a block.
38 * @param block The block.
39 * @param irn The node to check for.
40 * @return 1, if @p irn is live at the entrance of @p block, 0 if not.
42 int (is_live_in)(const ir_node *block, const ir_node *irn);
45 * Check, if a node is live out at a block.
46 * @param block The block.
47 * @param irn The node to check for.
48 * @return 1, if @p irn is live at the exit of @p block, 0 if not.
50 int (is_live_out)(const ir_node *block, const ir_node *irn);
53 * Check, if a node is live at the end of a block.
54 * @param block The block.
55 * @param irn The node to check for.
56 * @return 1, if @p irn is live at the end of the block, 0 if not.
58 int (is_live_end)(const ir_node *block, const ir_node *irn);
61 * Check, if the SSA dominance property is fulfilled.
62 * @param irg The graph.
64 void be_check_dominance(ir_graph *irg);
67 * The liveness transfer function.
68 * Updates a live set over a single step from a given node to its predecessor.
69 * Everything defined at the node is removed from the set, the uses of the node get inserted.
70 * @param arch_env The architecture environment.
71 * @param cls The register class to consider.
72 * @param irn The node at which liveness should be computed.
73 * @param live The set of nodes live before @p irn. This set gets modified by updating it to
74 * the nodes live after irn.
77 pset *be_liveness_transfer(const arch_env_t *arch_env, const arch_register_class_t *cls, ir_node *irn, pset *live);
80 * Put all node live at the end of a block into a set.
81 * @param arch_env The architecture environment.
82 * @param cls The register class to consider.
83 * @param bl The block.
84 * @param live The set to put them into.
87 pset *be_liveness_end_of_block(const arch_env_t *arch_env, const arch_register_class_t *cls, const ir_node *bl, pset *live);
90 * Compute a set of nodes which are live at another node.
91 * @param arch_env The architecture environment.
92 * @param cls The register class to consider.
93 * @param pos The node.
94 * @param live The set to put them into.
97 pset *be_liveness_nodes_live_at(const arch_env_t *arch_env, const arch_register_class_t *cls, const ir_node *pos, pset *live);
99 #endif /* _BELIVE_H */