3 * File name: ir/ana/height.h
4 * Purpose: Compute heights of nodes inside basic blocks
5 * Author: Sebastian Hack
9 * Copyright: (c) 2006 Universität Karlsruhe
10 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
13 #ifndef _FIRM_HEIGHTS_H
14 #define _FIRM_HEIGHTS_H
16 typedef struct _heights_t heights_t;
19 * Get the height of a node inside a basic block.
20 * The height of the node is the maximal number of edges between a sink node in that block and the node itself (plus 1).
21 * @param h The heights object.
22 * @param irn The node.
23 * @return The height of the node.
25 unsigned get_irn_height(heights_t *h, const ir_node *irn);
28 * Check, if a certain node is reachable according to data dependence edges from another node.
29 * @param h The heights object.
30 * @param n The first node.
31 * @param m The other node.
32 * @return 1, if n is data dependent on m, 0 if not.
34 int heights_reachable_in_block(heights_t *h, const ir_node *n, const ir_node *m);
37 * Recompute the height information.
38 * This can be used to recompute the height information if the graph has changed since the last computation.
39 * @param h The heights object.
41 void heights_recompute(heights_t *h);
44 * Make a new heights object.
45 * This also computes the heights for each block in the graph.
46 * @param irg The graph.
48 heights_t *heights_new(ir_graph *irg);
51 * Free a heights object.
52 * @param h The heights object.
54 void heights_free(heights_t *h);
57 #endif /* _FIRM_HEIGHTS_H */