3 * File name: ir/stat/firmstat.h
4 * Purpose: Statistics for Firm.
8 * Copyright: (c) 2004 Universität Karlsruhe
9 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
22 * Finish the statistics.
23 * Never called from libFirm should be called from user.
25 void stat_finish(void);
27 #ifdef FIRM_STATISTICS
30 STAT_OPT_STG, /**< straightening optimization */
31 STAT_OPT_IFSIM, /**< if simplification */
32 STAT_OPT_ALGSIM, /**< algebraic simplification */
33 STAT_OPT_PHI, /**< Phi optmization */
34 STAT_OPT_WAW, /**< Write-After-Write optimization */
35 STAT_OPT_WAR, /**< Write-After-Read optimization */
36 STAT_OPT_RAW, /**< Read-After-Write optimization */
37 STAT_OPT_TUPLE, /**< Tuple optimization */
38 STAT_OPT_ID, /**< ID optimization */
39 STAT_OPT_CONST_EVAL, /**< constant evaluation */
40 STAT_LOWERED, /**< lowered */
46 * initialize the statistics module.
51 * A new IR op is registered.
53 void stat_new_ir_op(const ir_op *op);
58 void stat_free_ir_op(const ir_op *op);
61 * A new node is created.
63 void stat_new_node(const ir_node *node);
66 * A node is changed into a Id node
68 void stat_turn_into_id(const ir_node *node);
71 * A new graph was created
73 void stat_new_graph(ir_graph *irg, entity *ent);
78 void stat_free_graph(ir_graph *irg);
81 * A walk over a graph is initiated
83 void stat_irg_walk(ir_graph *irg, void *pre, void *post);
86 * A walk over a graph in block-wise order is initiated
88 void stat_irg_walk_blkwise(ir_graph *irg, void *pre, void *post);
91 * A walk over the graph's blocks is initiated
93 void stat_irg_block_walk(ir_graph *irg, const ir_node *node, void *pre, void *post);
96 * Some nodes were optimized into some others due to an optimization
98 void stat_merge_nodes(
99 ir_node **new_node_array, int new_num_entries,
100 ir_node **old_node_array, int old_num_entries,
104 * A node was lowered into other nodes
106 void stat_lower(ir_node *node);
109 * A graph was inlined
111 void stat_inline(ir_node *call, ir_graph *irg);
114 * A graph with tail-recursions was optimized.
116 void stat_tail_rec(ir_graph *irg);
119 * Start the dead node elimination.
121 void stat_dead_node_elim_start(ir_graph *irg);
124 * Stops the dead node elimination.
126 void stat_dead_node_elim_stop(ir_graph *irg);
129 * helper: get an ir_op from an opcode
131 * @param code the opcode
133 * @return The associated ir_op or NULL if the opcode could not be found.
135 ir_op *stat_get_op_from_opcode(opcode code);
140 #define stat_new_ir_op(op)
141 #define stat_free_ir_op(op)
142 #define stat_new_node(node)
143 #define stat_turn_into_id(node)
144 #define stat_new_graph(irg, ent)
145 #define stat_free_graph(irg)
146 #define stat_irg_walk(irg, pre, post)
147 #define stat_irg_walk_blkwise(irg, pre, post)
148 #define stat_irg_block_walk(irg, node, pre, post)
149 #define stat_merge_nodes(new_node_array, new_num_entries, old_node_array, old_num_entries, opt)
150 #define stat_lower(node)
151 #define stat_inline(call, irg)
152 #define stat_tail_rec(irg)
153 #define stat_dead_node_elim_start(irg)
154 #define stat_dead_node_elim_stop(irg)
158 #endif /* _FIRMSTAT_H_ */