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 Compute an estimate of basic block executions.
23 * @author Adam M. Szalkowski
26 #ifndef FIRM_ANA_EXECFREQ_H
27 #define FIRM_ANA_EXECFREQ_H
29 #include "firm_types.h"
34 * @defgroup execfreq Basic Block Execution Frequency
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.
45 /** Estimates execution frequency of a graph.
46 * You can query the frequencies with get_block_execfreq().
48 FIRM_API void ir_estimate_execfreq(ir_graph *irg);
50 /** Returns execution frequency of block @p block. */
51 FIRM_API double get_block_execfreq(const ir_node *block);