execfreq.h 1.52 KB
Newer Older
Michael Beck's avatar
Michael Beck committed
1
/*
2
 * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
Matthias Braun's avatar
Matthias Braun committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 *
 * This file is part of libFirm.
 *
 * This file may be distributed and/or modified under the terms of the
 * GNU General Public License version 2 as published by the Free Software
 * Foundation and appearing in the file LICENSE.GPL included in the
 * packaging of this file.
 *
 * Licensees holding valid libFirm Professional Edition licenses may use
 * this file in accordance with the libFirm Commercial License.
 * Agreement provided with the Software.
 *
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE.
Michael Beck's avatar
Michael Beck committed
18
 */
Matthias Braun's avatar
Matthias Braun committed
19
20
21
22
23
24
25
26
27
28
29

/**
 * @file
 * @brief       Compute an estimate of basic block executions.
 * @author      Adam M. Szalkowski
 * @date        28.05.2006
 * @version     $Id$
 */
#ifndef FIRM_ANA_EXECFREQ_H
#define FIRM_ANA_EXECFREQ_H

Michael Beck's avatar
Michael Beck committed
30
#include "firm_types.h"
31

32
struct ir_exec_freq;
Michael Beck's avatar
Michael Beck committed
33

34
35
36
/**
 * Create execfreq structure (to be used with set_execfreq)
 */
37
ir_exec_freq *create_execfreq(ir_graph *irg);
38
39
40
41

/**
 * Set execution frequency of a basic block
 */
42
void set_execfreq(ir_exec_freq *ef, const ir_node *block, double freq);
43
44

/**
45
 * Create execfreq structure and initialize with estimated frequencies
46
 */
47
ir_exec_freq *compute_execfreq(ir_graph *irg, double loop_weight);
48

49
void free_execfreq(ir_exec_freq *ef);
50

51
52
double get_block_execfreq(const ir_exec_freq *ef, const ir_node *block);
unsigned long get_block_execfreq_ulong(const ir_exec_freq *ef, const ir_node *block);
53

Matthias Braun's avatar
Matthias Braun committed
54
#endif