X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fana%2Firdom.h;h=38307fe53c42b4c2601825f280d1957fe61958d5;hb=d0d85962ef52c14950db90e5981a7bea36023ab3;hp=3806135708abaa82e3a6a334f3f4652e28391745;hpb=dced6fdc8948497e65093b3de3b818f1ecc59c6a;p=libfirm diff --git a/ir/ana/irdom.h b/ir/ana/irdom.h index 380613570..38307fe53 100644 --- a/ir/ana/irdom.h +++ b/ir/ana/irdom.h @@ -129,6 +129,28 @@ ir_node *get_Block_dominated_next(const ir_node *dom); */ int block_dominates(const ir_node *a, const ir_node *b); +/** + * Returns the smallest common dominator block of two nodes. + * @param a A node. + * @param b Another node. + * @return The first block dominating @p a and @p b + */ +ir_node *node_smallest_common_dominator(ir_node *a, ir_node *b); + +/** + * Returns the smallest common dominator block of all users of a node + * BEWARE: @p irn must not be a block + * If on or more users are Phi nodes, one can request special handling + * with @p handle_phi = 1. In this case the cfg predecessor block + * corresponding to the position of the irn in the argument list of the + * Phi is determined and treated as user. + * + * @param irn A node. + * @param handle_phi 1 if Phis should be handled different + * @return The first block dominating all users of @irn + */ +ir_node *node_users_smallest_common_dominator(ir_node *irn, int handle_phi); + /** * Check, if a block post dominates another block. * @param a The first block. @@ -200,6 +222,9 @@ void postdom_tree_walk_irg(ir_graph *irg, irg_walk_func *pre, */ void compute_doms(ir_graph *irg); +/** Computes the dominator trees on demand */ +void assure_doms(ir_graph *irg); + /** Computes the post dominator trees. * * Sets a flag in irg to "dom_consistent". @@ -217,6 +242,9 @@ void compute_doms(ir_graph *irg); */ void compute_postdoms(ir_graph *irg); +/** Computes the dominator trees on demand */ +void assure_postdoms(ir_graph *irg); + /** Frees the dominator data structures. Sets the flag in irg to "dom_none". */ void free_dom(ir_graph *irg);