2 * This file is part of libFirm.
3 * Copyright (C) 2012 University of Karlsruhe.
8 * @brief control dependence analysis
9 * @author Christoph Mallon
11 #ifndef FIRM_ANA_CDEP_H
12 #define FIRM_ANA_CDEP_H
14 #include "firm_types.h"
18 * @defgroup ir_cdep Control Dependence
22 /** Computes the control dependence graph for a graph. */
23 FIRM_API void compute_cdep(ir_graph *irg);
25 /** Frees the control dependence info. */
26 FIRM_API void free_cdep(ir_graph *irg);
28 /** Returns control dependent block */
29 FIRM_API ir_node *get_cdep_node(const ir_cdep *cdep);
31 /** Returns next entry in a list of cdeps */
32 FIRM_API ir_cdep *get_cdep_next(const ir_cdep *cdep);
35 * Returns a list of all control dependences of a block.
37 FIRM_API ir_cdep *find_cdep(const ir_node *block);
40 * Replaces the control dependence info of old by the info of nw.
42 FIRM_API void exchange_cdep(ir_node *old, const ir_node *nw);
45 * Checks whether dependee is (directly) control dependent on candidate.
47 * @param dependee the (possible) dependent block
48 * @param candidate the (possible) block on which dependee is dependent
50 FIRM_API int is_cdep_on(const ir_node *dependee, const ir_node *candidate);
53 * If block is control dependent on exactly one node, returns this node,
56 * @param block the block to check
58 FIRM_API ir_node *get_unique_cdep(const ir_node *block);
61 * Checks if the given block is control dependent of more than one node.
63 * @param block the block to check
65 FIRM_API int has_multiple_cdep(const ir_node *block);