projects
/
libfirm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3079cf3
)
- give bonus to small functions and leaves
author
Michael Beck
<beck@ipd.info.uni-karlsruhe.de>
Fri, 9 May 2008 02:40:17 +0000
(
02:40
+0000)
committer
Michael Beck
<beck@ipd.info.uni-karlsruhe.de>
Fri, 9 May 2008 02:40:17 +0000
(
02:40
+0000)
[r19572]
ir/opt/opt_inline.c
patch
|
blob
|
history
diff --git
a/ir/opt/opt_inline.c
b/ir/opt/opt_inline.c
index
e33e3f7
..
fef6a96
100644
(file)
--- a/
ir/opt/opt_inline.c
+++ b/
ir/opt/opt_inline.c
@@
-1916,11
+1916,20
@@
static int calc_inline_benefice(ir_node *call, ir_graph *callee, unsigned *local
if (callee_env->n_blocks == 1)
weight = weight * 3 / 2;
if (callee_env->n_blocks == 1)
weight = weight * 3 / 2;
+ /* and one for small functions: we want them to be inlined in mostly every case */
+ else if (callee_env->n_nodes < 20)
+ weight += 5000;
+
+ /* and finally for leaves: they do not increase the register pressure
+ because of callee safe registers */
+ else if (callee_env->n_call_nodes == 0)
+ weight += 25;
+
return weight;
}
/**
return weight;
}
/**
- * Heuristic inliner. Calculates a ben
i
fice value for every call and inlines
+ * Heuristic inliner. Calculates a ben
e
fice value for every call and inlines
* those calls with a value higher than the threshold.
*/
void inline_functions(int maxsize, int inline_threshold) {
* those calls with a value higher than the threshold.
*/
void inline_functions(int maxsize, int inline_threshold) {