create execution frequencies from profile data
[libfirm] / ir / ana / execfreq.h
1 #ifndef EXECFREQ_H_
2 #define EXECFREQ_H_
3 /*
4  * Project:     libFIRM
5  * File name:   ir/ana/execfreq.h
6  * Purpose:     Compute an estimate of basic block executions.
7  * Author:      Adam M. Szalkowski
8  * Modified by:
9  * Created:     28.05.2006
10  * CVS-ID:      $Id$
11  * Copyright:   (c) 2006 Universitaet Karlsruhe
12  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
13  */
14 #include "firm_types.h"
15
16 struct _exec_freq_t;
17 typedef struct _exec_freq_t exec_freq_t;
18
19 /**
20  * Create execfreq structure (to be used with set_execfreq)
21  */
22 exec_freq_t *create_execfreq(ir_graph *irg);
23
24 /**
25  * Set execution frequency of a basic block
26  */
27 void set_execfreq(exec_freq_t *ef, const ir_node *block, double freq);
28
29 /**
30  * Create execfreq structure and initialze with estimated frequencies
31  */
32 exec_freq_t *compute_execfreq(ir_graph *irg, double loop_weight);
33
34 void free_execfreq(exec_freq_t *ef);
35
36 double get_block_execfreq(const exec_freq_t *ef, const ir_node * irn);
37 unsigned long get_block_execfreq_ulong(const exec_freq_t *ef, const ir_node *bb);
38
39 #endif /* EXECFREQ_H_ */