2 * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
4 * This file is part of libFirm.
6 * This file may be distributed and/or modified under the terms of the
7 * GNU General Public License version 2 as published by the Free Software
8 * Foundation and appearing in the file LICENSE.GPL included in the
9 * packaging of this file.
11 * Licensees holding valid libFirm Professional Edition licenses may use
12 * this file in accordance with the libFirm Commercial License.
13 * Agreement provided with the Software.
15 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * @brief Decompost control flow graph into acylic, hierarchic intervals.
23 * @author Goetz Lindenmaier
27 * Decompost control flow graph into acylic, hierarchic intervals.
29 * The analysis is based on the control flow looptree. An intervall
30 * are basically all nodes in a single ir_loop entry, i.e., basic
31 * blocks and inner loop nodes. The analysis computes a new set of
32 * edges that link all nodes of a loop to an acyclic graph.
34 * The interval analysis counts the number of exception control flow
35 * operations leaving a block. This depends on stuff computed in
36 * execution_freqencies.
38 #ifndef FIRM_ANA_INTERVAL_ANALYSIS_H
39 #define FIRM_ANA_INTERVAL_ANALYSIS_H
41 #include "firm_types.h"
45 /** The ins of regions: regions are loops or blocks. */
46 FIRM_API int get_region_n_ins(void *region);
47 FIRM_API void *get_region_in(void *region, int pos);
48 FIRM_API void add_region_in(void *region, void *in);
51 /** The number of out edges of a region.
53 * This number is useful for evaluation of execution frequencies.
55 FIRM_API int get_region_n_outs(void *region);
57 /** The number of exception out edges of a region.
59 * This number is useful for evaluation of execution frequencies.
61 FIRM_API int get_region_n_exc_outs(void *region);
63 /** The control flow operation corresponding to the loop-region in at
66 FIRM_API void *get_loop_cfop(void *region, int pos);
69 /** The algorithm to construct the interval graph.
71 * Constructs the cf loop tree and leaves a valid version of it.
73 FIRM_API void construct_intervals(ir_graph *irg);
75 /** frees interval information of all graphs. */
76 FIRM_API void free_intervals(void);
78 /** dump a vcg graph with the intervals */
79 FIRM_API void dump_interval_graph(FILE *out, ir_graph *irg);