2 * This file is part of libFirm.
3 * Copyright (C) 2012 University of Karlsruhe.
8 * @brief Compute an estimate of basic block executions.
9 * @author Adam M. Szalkowski
12 #ifndef FIRM_ANA_EXECFREQ_H
13 #define FIRM_ANA_EXECFREQ_H
15 #include "firm_types.h"
20 * @defgroup execfreq Basic Block Execution Frequency
22 * Execution frequencies specify how often a basic block is expected to get
23 * executed during execution of a function.
24 * For example the start block has a natural execution frequency of 1.0, the
25 * two branches of a simple if 0.5, nodes in a simple loop 10.0 ...
26 * Execution frequencies can either get estimated based on the structure of the
27 * control flow graph or can be calculated based on profile information.
31 /** Estimates execution frequency of a graph.
32 * You can query the frequencies with get_block_execfreq().
34 FIRM_API void ir_estimate_execfreq(ir_graph *irg);
36 /** Returns execution frequency of block @p block. */
37 FIRM_API double get_block_execfreq(const ir_node *block);