3 * File name: ir/ana/execution_frequency.h
4 * Purpose: Compute an estimate of basic block executions.
5 * Author: Goetz Lindenmaier
9 * Copyright: (c) 2004 Universität Karlsruhe
10 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
13 #ifndef _EXECUTION_FREQUENCY_H_
14 #define _EXECUTION_FREQUENCY_H_
16 /** @file execution_frequency.h
18 * Estimate exectution freqencies of blocks.
20 * @author Goetz Lindenmaier
22 * We assume the start block of a procedure is executed once. Based on this we
23 * compute the execution freqency of all blocks.
25 * The computation of the freqencies depends on the count of exception control
26 * flow computed during the interval analysis. The interval analysis again
27 * depends on stuff computed here.
33 /* A proj from a Cond that goes to an exception handler. */
34 int is_fragile_Proj(ir_node *n);
36 /** Returns the number of times the block/region is executed according to
37 * our estimate. Gives a number relative to the Start node of the procedure
38 * the block is in, which is weighted with 1. */
39 double get_irn_exec_freq (ir_node *n);
40 double get_Block_exec_freq (ir_node *b);
41 double get_region_exec_freq(void *reg);
43 /** Compute the execution frequency for all blocks in the given
46 * @param irg The graph to be analyzed.
47 * @param default_loop_weight The default number of executions of a loop.
48 * @param exception_probability The probability that a fragile operation causes an exception.
52 void compute_execution_frequency(ir_graph *irg, int default_loop_weight, double exception_probability);
54 /** Compute the execution frequency for all graphs.
56 * @param default_loop_weight The default number of executions of a loop.
57 * @param exception_probability The probability that a fragile operation causes an exception.
60 void compute_execution_frequencies(int default_loop_weight, double exception_probability);
62 /** Free occupied memory, reset. */
63 void free_execution_frequency(void);
66 #endif /* _EXECUTION_FREQUENCY_H_ */