verify: Clarify assertion message.
[libfirm] / ir / ir / irprofile.h
1 /*
2  * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
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.
10  *
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.
14  *
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
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief       Code instrumentation and execution count profiling.
23  * @author      Adam M. Szalkowski
24  * @date        06.04.2006
25  */
26 #ifndef FIRM_BE_BEPROFILE_H
27 #define FIRM_BE_BEPROFILE_H
28
29 #include <stdbool.h>
30 #include <stdint.h>
31 #include "irgraph.h"
32 #include "irnode.h"
33
34 /**
35  * Instruments all irgs in the program with profile code.
36  * The final code will have a counter for each basic block which is
37  * incremented in that block. After the program has run the info is written
38  * to @p filename.
39  */
40 ir_graph *ir_profile_instrument(const char *filename);
41
42 /**
43  * Reads the corresponding profile info file if it exists and returns a
44  * profile info struct
45  * @param filename The name of the file containing profile information
46  */
47 bool ir_profile_read(const char *filename);
48
49 /**
50  * Frees the profile info
51  */
52 void ir_profile_free(void);
53
54 /**
55  * Get block execution count as determined be profiling
56  */
57 uint32_t ir_profile_get_block_execcount(const ir_node *block);
58
59 /**
60  * Initializes exec_freq structure for an irg based on profile data
61  */
62 void ir_create_execfreqs_from_profile(void);
63
64 #endif