backend can report back float point arithmetic mode
[libfirm] / include / libfirm / interval_analysis.h
1 /*
2  * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
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.
10  *
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.
14  *
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
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief      Decompost control flow graph into acylic, hierarchic intervals.
23  * @author     Goetz Lindenmaier
24  * @date       5.11.2004
25  * @version    $Id$
26  * @summary
27  *  Decompost control flow graph into acylic, hierarchic intervals.
28  *
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.
33  *
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.
37  */
38 #ifndef FIRM_ANA_INTERVAL_ANALYSIS_H
39 #define FIRM_ANA_INTERVAL_ANALYSIS_H
40
41 #include "firm_types.h"
42
43 /** The ins of regions:  regions are loops or blocks.
44  *
45  *  @todo: we should make a type for the regions, or reuse loop_element.
46  */
47 int   get_region_n_ins(void *region);
48 void *get_region_in   (void *region, int pos);
49 void  add_region_in   (void *region, void *in);
50
51
52 /** The number of out edges of a region.
53  *
54  *  This number is useful for evaluation of execution frequencies.
55  */
56 int get_region_n_outs(void *region);
57
58 /** The number of exception out edges of a region.
59  *
60  *  This number is useful for evaluation of execution frequencies.
61  */
62 int get_region_n_exc_outs(void *region);
63
64 /** The control flow operation corresponding to the loop-region in at
65  *  position pos.
66  */
67 void *get_loop_cfop(void *region, int pos);
68
69
70 /** The algorithm to construct the interval graph.
71  *
72  *  Constructs the cf loop tree and leaves a valid version of it.
73  *
74  *  @todo: @@@ add flag that states correctness of interval analysis information
75  *  to irg.
76  **/
77 void construct_intervals(ir_graph *irg);
78
79
80 /** frees interval information of all graphs. */
81 void free_intervals(void);
82
83
84 /** dump a graph with the intervals. File name suffix "-interval". */
85 void dump_interval_graph(ir_graph *irg, const char *suffix);
86
87
88 #define DDMR(X) if(is_ir_node(X)) DDMN(X); else DDML(X)
89
90 #endif