From: Michael Beck Date: Mon, 5 May 2008 10:46:08 +0000 (+0000) Subject: add a parameter to limit the maximum size of methods when inlining, otherwise some... X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=7498ed3766f3f98604d96d1b75978a3a9e6768ed;p=libfirm add a parameter to limit the maximum size of methods when inlining, otherwise some files explode [r19511] --- diff --git a/include/libfirm/irgopt.h b/include/libfirm/irgopt.h index 30d63d2d2..91dc6ac6a 100644 --- a/include/libfirm/irgopt.h +++ b/include/libfirm/irgopt.h @@ -189,9 +189,12 @@ void inline_leave_functions(int maxsize, int leavesize, int size, int ignore_run * Heuristic inliner. Calculates a benefice value for every call and inlines * those calls with a value higher than the threshold. * + * @param maxsize Do not inline any calls if a method has more than + * maxsize firm nodes. It may reach this limit by + * inlineing. * @param threshold inlining threshold */ -void inline_functions(int inline_threshold); +void inline_functions(int maxsize, int inline_threshold); /** Code Placement. * diff --git a/ir/opt/opt_inline.c b/ir/opt/opt_inline.c index b0fde7d12..b29040602 100644 --- a/ir/opt/opt_inline.c +++ b/ir/opt/opt_inline.c @@ -1864,7 +1864,7 @@ static int calc_inline_benefice(ir_node *call, ir_graph *callee, unsigned *local * Heuristic inliner. Calculates a benifice value for every call and inlines * those calls with a value higher than the threshold. */ -void inline_functions(int inline_threshold) { +void inline_functions(int maxsize, int inline_threshold) { inline_irg_env *env; int i, n_irgs; ir_graph *rem; @@ -1916,6 +1916,8 @@ void inline_functions(int inline_threshold) { int benefice; unsigned local_adr; + if (env->n_nodes > maxsize) break; + call = entry->call; callee = entry->callee;