This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix inlining checks wrt optimize attribute


On 01/22/2015 11:33 AM, Richard Biener wrote:
> On Thu, 22 Jan 2015, Christian Bruel wrote:
> 
>> Hi Richard,
>>
>> I thought one of my current issue would be solved by this patch, but it is not
>> : I have some inlining failures with the attribute target on ARM. (e.g
>> inline-3.c) where obvious early inline fails with because we fail into the
>> last can_inline_edge_p case:
>>
>> opt_for_fn (callee->decl, optimize)
>> 		   >= opt_for_fn (caller->decl, optimize)))
>>
>> when callee and caller are both -O2 and targetm.target_option.can_inline_p was
>> true, they should be inlined as in the general case (no
>> DECL_FUNCTION_SPECIFIC_OPTIMIZATION)
>>
>> I'm currently testing this additional change:
>>
>> Index: ipa-inline.c
>> ===================================================================
>> --- ipa-inline.c	(revision 219989)
>> +++ ipa-inline.c	(working copy)
>> @@ -489,7 +489,7 @@
>>        else if (opt_for_fn (callee->decl, optimize_size)
>>  	       < opt_for_fn (caller->decl, optimize_size)
>>  	       || (opt_for_fn (callee->decl, optimize)
>> -		   >= opt_for_fn (caller->decl, optimize)))
>> +		   > opt_for_fn (caller->decl, optimize)))
>>  	{
>>  	  if (estimate_edge_time (e)
>>  	      >= 20 + inline_edge_summary (e)->call_stmt_time)
>>
>> Since this is a hot topic for you, I though you would have useful comments on
>> this before I ask for a commit (when stage 4 close) ?
> 
> Yeah - the above looks like an obvious change to me.  Thus,
> approved if it passes bootstrap/regtest.
> 
> Thanks,
> Richard.
> 

thanks, sorry for the delay (stage1 blocked)

committed with the Changelog:

* ipa-inline.c (can_inline_edge_p): Allow inlining of functions with
same attributes.

This frees the road for

 - [PATCH, x86] [PR target/64835] Add
TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE hook
 https://gcc.gnu.org/ml/gcc-patches/2015-04/msg00594.html

 and

 - [PATCH, ARM] attribute target (thumb,arm) [0-6]
  https://gcc.gnu.org/ml/gcc-patches/2015-04/msg00706.html

with new regressions tests.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]