X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbelive.h;h=ff0deb75157e612ab4cdc7476515e2260015126a;hb=6e3e499d6c68aee0c6a9ada6a99f16c4f6f8445b;hp=0b100f97817a7995c5b0d7db574c6893ecfd6c2a;hpb=9b060a71a2667ced8d103023eda0ff710e799867;p=libfirm diff --git a/ir/be/belive.h b/ir/be/belive.h index 0b100f978..ff0deb751 100644 --- a/ir/be/belive.h +++ b/ir/be/belive.h @@ -7,6 +7,10 @@ #ifndef _BELIVE_H #define _BELIVE_H +#include "firm_types.h" +#include "pset.h" +#include "bearch_t.h" + #include /** @@ -20,7 +24,14 @@ void be_liveness(ir_graph *irg); * @param f The output. * @param irg The graph. */ -void be_liveness_dump(FILE *f, ir_graph *irg); +void be_liveness_dump(ir_graph *irg, FILE *f); + +/** + * Dump the liveness information for a graph. + * @param irg The graph. + * @param cls_name A string used as substring in the filename. + */ +void be_liveness_dumpto(ir_graph *irg, const char *cls_name); /** * Check, if a node is live in at a block. @@ -38,5 +49,51 @@ int (is_live_in)(const ir_node *block, const ir_node *irn); */ int (is_live_out)(const ir_node *block, const ir_node *irn); +/** + * Check, if a node is live at the end of a block. + * @param block The block. + * @param irn The node to check for. + * @return 1, if @p irn is live at the end of the block, 0 if not. + */ +int (is_live_end)(const ir_node *block, const ir_node *irn); + +/** + * Check, if the SSA dominance property is fulfilled. + * @param irg The graph. + */ +void be_check_dominance(ir_graph *irg); + +/** + * The liveness transfer function. + * Updates a live set over a single step from a given node to its predecessor. + * Everything defined at the node is removed from the set, the uses of the node get inserted. + * @param arch_env The architecture environment. + * @param cls The register class to consider. + * @param irn The node at which liveness should be computed. + * @param live The set of nodes live before @p irn. This set gets modified by updating it to + * the nodes live after irn. + * @return live. + */ +pset *be_liveness_transfer(const arch_env_t *arch_env, const arch_register_class_t *cls, ir_node *irn, pset *live); + +/** + * Put all node live at the end of a block into a set. + * @param arch_env The architecture environment. + * @param cls The register class to consider. + * @param bl The block. + * @param live The set to put them into. + * @return live. + */ +pset *be_liveness_end_of_block(const arch_env_t *arch_env, const arch_register_class_t *cls, const ir_node *bl, pset *live); + +/** + * Compute a set of nodes which are live at another node. + * @param arch_env The architecture environment. + * @param cls The register class to consider. + * @param pos The node. + * @param live The set to put them into. + * @return live. + */ +pset *be_liveness_nodes_live_at(const arch_env_t *arch_env, const arch_register_class_t *cls, const ir_node *pos, pset *live); -#endif +#endif /* _BELIVE_H */