From 4c96713146f32c2b3fefcd9c21151487b2ca6033 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Fri, 4 Apr 2008 16:55:30 +0000 Subject: [PATCH] calculate benefice on real callee [r19130] --- ir/opt/opt_inline.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ir/opt/opt_inline.c b/ir/opt/opt_inline.c index 990a32416..f376c752d 100644 --- a/ir/opt/opt_inline.c +++ b/ir/opt/opt_inline.c @@ -1753,6 +1753,10 @@ void inline_functions(int inline_threshold) { call = entry->call; callee = entry->callee; + /* calculate the benifice on the original call to prevent excessive inlining */ + benefice = calc_inline_benefice(call, callee); + DB((dbg, SET_LEVEL_2, "In %+F Call %+F has benefice %d\n", current_ir_graph, callee, benefice)); + e = pmap_find(copied_graphs, callee); if (e != NULL) { /* @@ -1762,10 +1766,7 @@ void inline_functions(int inline_threshold) { callee = e->value; } - benefice = calc_inline_benefice(call, callee); - DB((dbg, SET_LEVEL_2, "In %+F Call %+F has benefice %d\n", current_ir_graph, callee, benefice)); - - if (benefice > inline_threshold || + if (benefice > -inline_threshold || (get_irg_inline_property(callee) >= irg_inline_forced)) { if (current_ir_graph == callee) { /* -- 2.20.1