projects
/
libfirm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f9b358a
)
better count constants as operands of instructions
author
Michael Beck
<beck@ipd.info.uni-karlsruhe.de>
Sun, 24 Aug 2008 12:48:08 +0000
(12:48 +0000)
committer
Michael Beck
<beck@ipd.info.uni-karlsruhe.de>
Sun, 24 Aug 2008 12:48:08 +0000
(12:48 +0000)
[r21407]
ir/stat/firmstat.c
patch
|
blob
|
history
diff --git
a/ir/stat/firmstat.c
b/ir/stat/firmstat.c
index
f665ee9
..
e1d6fa1
100644
(file)
--- a/
ir/stat/firmstat.c
+++ b/
ir/stat/firmstat.c
@@
-989,12
+989,6
@@
static void update_node_stat(ir_node *node, void *env)
/* handle statistics for special node types */
switch (op->code) {
/* handle statistics for special node types */
switch (op->code) {
- case iro_Const:
- if (status->stat_options & FIRMSTAT_COUNT_CONSTS) {
- /* check properties of constants */
- stat_update_const(status, node, graph);
- } /* if */
- break;
case iro_Call:
/* check for properties that depends on calls like recursion/leaf/indirect call */
stat_update_call(node, graph);
case iro_Call:
/* check for properties that depends on calls like recursion/leaf/indirect call */
stat_update_call(node, graph);
@@
-1010,6
+1004,20
@@
static void update_node_stat(ir_node *node, void *env)
default:
;
} /* switch */
default:
;
} /* switch */
+
+ /* we want to count the constant IN nodes, not the CSE'ed constant's itself */
+ if (status->stat_options & FIRMSTAT_COUNT_CONSTS) {
+ int i;
+
+ for (i = get_irn_arity(node) - 1; i >= 0; --i) {
+ ir_node *pred = get_irn_n(node, i);
+
+ if (is_Const(pred)) {
+ /* check properties of constants */
+ stat_update_const(status, pred, graph);
+ } /* if */
+ } /* for */
+ } /* if */
} /* update_node_stat */
/**
} /* update_node_stat */
/**