simplify and cleanup execfreq API
[libfirm] / include / libfirm / execfreq.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       Compute an estimate of basic block executions.
23  * @author      Adam M. Szalkowski
24  * @date        28.05.2006
25  */
26 #ifndef FIRM_ANA_EXECFREQ_H
27 #define FIRM_ANA_EXECFREQ_H
28
29 #include "firm_types.h"
30 #include "begin.h"
31
32 /**
33  * @ingroup irana
34  * @defgroup execfreq Basic Block Execution Frequency
35  *
36  * Execution frequencies specify how often a basic block is expected to get
37  * executed during execution of a function.
38  * For example the start block has a natural execution frequency of 1.0, the
39  * two branches of a simple if 0.5, nodes in a simple loop 10.0 ...
40  * Execution frequencies can either get estimated based on the structure of the
41  * control flow graph or can be calculated based on profile information.
42  * @{
43  */
44
45 /** Estimates execution frequency of a graph.
46  * You can query the frequencies with get_block_execfreq().
47  */
48 FIRM_API void ir_estimate_execfreq(ir_graph *irg);
49
50 /** Returns execution frequency of block @p block. */
51 FIRM_API double get_block_execfreq(const ir_node *block);
52
53 /** @} */
54
55 #include "end.h"
56
57 #endif