added trivial access function
[libfirm] / ir / ana / execution_frequency.h
1 /*
2  * Project:     libFIRM
3  * File name:   ir/ana/execution_frequency.h
4  * Purpose:     Compute an estimate of basic block executions.
5  * Author:      Goetz Lindenmaier
6  * Modified by:
7  * Created:     5.11.2004
8  * CVS-ID:      $Id$
9  * Copyright:   (c) 2004 Universität Karlsruhe
10  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
11  */
12
13 #ifndef _EXECUTION_FREQUENCY_H_
14 #define _EXECUTION_FREQUENCY_H_
15
16 /** @file execution_frequency.h
17  *
18  * Estimate exectution freqencies of blocks.
19  *
20  * @author Goetz Lindenmaier
21  *
22  * We assume the start block of a procedure is executed once.  Based on this we
23  * compute the execution freqency of all blocks.
24  *
25  *
26  */
27
28 #include "irnode.h"
29 #include "irgraph.h"
30
31
32 /** Returns the number of times the block/region is executed according to
33  *  our estimate. */
34 double get_irn_exec_freq(ir_node *n);
35 double get_Block_exec_freq (ir_node *b);
36 double get_region_exec_freq(void *reg);
37
38 /** Compute the execution frequency for all blocks in the given
39  *  graph.
40  *
41  * @param irg                  The graph to be analyzed.
42  * @param default_loop_weight  The default number of executions of a loop.
43  */
44 void compute_execution_frequency(ir_graph *irg, int default_loop_weight, double exception_probability);
45 void compute_execution_frequencies(int default_loop_weight, double exception_probability);
46
47 /** Free occupied memory, reset. */
48 void free_execution_frequency(void);
49
50
51 #endif /* _EXECUTION_FREQUENCY_H_ */