Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
2e329cd9
Commit
2e329cd9
authored
Nov 14, 2005
by
Michael Beck
Browse files
estimated node count added
[r6912]
parent
1231c62d
Changes
3
Hide whitespace changes
Inline
Side-by-side
ir/ir/irgraph.c
View file @
2e329cd9
...
...
@@ -235,6 +235,7 @@ new_r_ir_graph (entity *ent, int n_loc)
add_immBlock_pred
(
first_block
,
projX
);
res
->
method_execution_frequency
=
-
1
;
res
->
estimated_node_count
=
0
;
return
res
;
}
...
...
@@ -809,6 +810,11 @@ void *get_irg_loc_description(ir_graph *irg, int n)
return
irg
->
loc_descriptions
?
irg
->
loc_descriptions
[
n
]
:
NULL
;
}
/* Returns a estimated node count of the irg. */
unsigned
(
get_irg_estimated_node_cnt
)(
const
ir_graph
*
irg
)
{
return
_get_irg_estimated_node_cnt
(
irg
);
}
/* register additional space in an IR graph */
size_t
register_additional_graph_data
(
size_t
size
)
{
...
...
ir/ir/irgraph.h
View file @
2e329cd9
...
...
@@ -459,6 +459,11 @@ void set_irg_loc_description(ir_graph *irg, int n, void *description);
/** get the description for local value n */
void
*
get_irg_loc_description
(
ir_graph
*
irg
,
int
n
);
/** Returns a estimated node count of the irg. This count is updated
* after every irg_walk_graph().
*/
unsigned
get_irg_estimated_node_cnt
(
const
ir_graph
*
irg
);
/**
* Access custom graph data.
* The data must have been registered with
...
...
ir/ir/irgraph_t.h
View file @
2e329cd9
...
...
@@ -135,14 +135,16 @@ struct ir_graph {
every time someone walks through
the graph */
unsigned
long
block_visited
;
/**< same as visited, for a complete block */
unsigned
estimated_node_count
;
/**< estimated number of nodes in this graph,
updated after every walk */
#if FIRM_EDGES_INPLACE
irg_edge_info_t
edge_info
;
/**< edge info for automatic outs */
#endif
#ifdef DEBUG_libfirm
int
graph_nr
;
/**< a unique graph number for each graph to make output
readable. */
#endif
#if FIRM_EDGES_INPLACE
irg_edge_info_t
edge_info
;
/**< edge info for automatic outs */
#endif
};
/**
...
...
@@ -498,6 +500,11 @@ _inc_irg_block_visited(ir_graph *irg) {
++
irg
->
block_visited
;
}
static
INLINE
unsigned
_get_irg_estimated_node_cnt
(
const
ir_graph
*
irg
)
{
return
irg
->
estimated_node_count
;
}
#define get_interprocedural_view() _get_interprocedural_view()
#define is_ir_graph(thing) _is_ir_graph(thing)
#define get_irg_start_block(irg) _get_irg_start_block(irg)
...
...
@@ -555,5 +562,6 @@ _inc_irg_block_visited(ir_graph *irg) {
#define get_irg_block_visited(irg) _get_irg_block_visited(irg)
#define set_irg_block_visited(irg, v) _set_irg_block_visited(irg, v)
#define inc_irg_block_visited(irg) _inc_irg_block_visited(irg)
#define get_irg_estimated_node_cnt(irg) _get_irg_estimated_node_cnt(irg)
# endif
/* _IRGRAPH_T_H_ */
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment