becopyheur2: Use rbitset_copy_to_bitset().
[libfirm] / ir / be / bestat.h
1 /*
2  * This file is part of libFirm.
3  * Copyright (C) 2012 University of Karlsruhe.
4  */
5
6 /**
7  * @file
8  * @brief       Provides several statistic functions for the backend.
9  * @author      Christian Wuerdig, Matthias Braun
10  */
11 #ifndef FIRM_BE_BESTAT_H
12 #define FIRM_BE_BESTAT_H
13
14 #include "firm_types.h"
15 #include "irnodeset.h"
16
17 #include "bearch.h"
18
19 typedef enum be_stat_tag_t {
20         BE_STAT_FIRST,
21         BE_STAT_PHIS = BE_STAT_FIRST, /**< phi count (excluding mem-phis) */
22         BE_STAT_MEM_PHIS,             /**< memory-phi count */
23         BE_STAT_COPIES,               /**< copies */
24         BE_STAT_PERMS,                /**< perms */
25         BE_STAT_COUNT
26 } be_stat_tag_t;
27 ENUM_COUNTABLE(be_stat_tag_t)
28 typedef unsigned long be_node_stats_t[BE_STAT_COUNT];
29
30 /**
31  * Collect statistics about node types
32  */
33 void be_collect_node_stats(be_node_stats_t *stats, ir_graph *irg);
34
35 void be_subtract_node_stats(be_node_stats_t *stats, be_node_stats_t *sub);
36
37 void be_copy_node_stats(be_node_stats_t *dest, be_node_stats_t *src);
38
39 void be_emit_node_stats(be_node_stats_t *stats, const char *prefix);
40
41 /**
42  * Collects statistics information about register pressure.
43  * @param irg    The irg
44  */
45 void be_do_stat_reg_pressure(ir_graph *irg, const arch_register_class_t *cls);
46
47 /**
48  * Gives a cost estimate for the program (based on execution frequencies)
49  * and backend op_estimated_cost
50  */
51 double be_estimate_irg_costs(ir_graph *irg);
52
53 /**
54  * return number of "instructions" (=nodes without some virtual nodes like Proj,
55  * Start, End)
56  */
57 unsigned long be_count_insns(ir_graph *irg);
58
59 /**
60  * return number of basic blocks (without the end block)
61  */
62 unsigned long be_count_blocks(ir_graph *irg);
63
64
65 #endif