Fix typos in comments: s/wether/whether/ and related corrections.
[libfirm] / ir / be / bestat.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       Provides several statistic functions for the backend.
23  * @author      Christian Wuerdig, Matthias Braun
24  * @version     $Id$
25  */
26 #ifndef FIRM_BE_BESTAT_H
27 #define FIRM_BE_BESTAT_H
28
29 #include "firm_types.h"
30 #include "irnodeset.h"
31
32 #include "beirg.h"
33 #include "bestatevent.h"
34 #include "bearch.h"
35
36 typedef enum be_stat_tag_t {
37         BE_STAT_FIRST,
38         BE_STAT_PHIS = BE_STAT_FIRST, /**< phi count (excluding mem-phis) */
39         BE_STAT_MEM_PHIS,             /**< memory-phi count */
40         BE_STAT_COPIES,               /**< copies */
41         BE_STAT_PERMS,                /**< perms */
42         BE_STAT_SPILLS,               /**< spills (also folded spills) */
43         BE_STAT_RELOADS,              /**< reloads (also folded reloads) */
44         BE_STAT_REMATS,               /**< rematerialized nodes */
45         BE_STAT_COUNT
46 } be_stat_tag_t;
47 ENUM_COUNTABLE(be_stat_tag_t)
48 typedef unsigned long be_node_stats_t[BE_STAT_COUNT];
49
50 /**
51  * Collect statistics about node types
52  */
53 void be_collect_node_stats(be_node_stats_t *stats, ir_graph *irg);
54
55 void be_subtract_node_stats(be_node_stats_t *stats, be_node_stats_t *sub);
56
57 void be_copy_node_stats(be_node_stats_t *dest, be_node_stats_t *src);
58
59 void be_emit_node_stats(be_node_stats_t *stats, const char *prefix);
60
61 /**
62  * Collects statistics information about register pressure.
63  * @param irg    The irg
64  */
65 void be_do_stat_reg_pressure(ir_graph *irg, const arch_register_class_t *cls);
66
67 /**
68  * Gives a cost estimate for the program (based on execution frequencies)
69  * and backend op_estimated_cost
70  */
71 double be_estimate_irg_costs(ir_graph *irg, ir_exec_freq *execfreqs);
72
73 /**
74  * return number of "instructions" (=nodes without some virtual nodes like Proj,
75  * Start, End)
76  */
77 unsigned long be_count_insns(ir_graph *irg);
78
79 /**
80  * return number of basic blocks (without the end block)
81  */
82 unsigned long be_count_blocks(ir_graph *irg);
83
84
85 #endif