PATCH: New optimization, partitioning hot/cold basic blocks

Andrew Pinski pinskia@physics.uc.edu
Sat Apr 10 22:39:00 GMT 2004


On Apr 10, 2004, at 18:12, Mike Stump wrote:

> On Saturday, April 10, 2004, at 02:00  PM, Andrew Pinski wrote:
>> This patch implements my suggestions and I tested on i686-openbsd3.1 
>> which does not support .section.
>
>> @@ -221,15 +222,15 @@ unlikely_text_section (void)
>>        &&  (in_section != in_named
>>  	   || strcmp (in_named_name, UNLIKELY_EXECUTED_TEXT_SECTION_NAME) 
>> != 0))
>>      {
>> -#ifdef TARGET_ASM_NAMED_SECTION
>> -	
>> +      if (targetm.have_named_sections)
>>        named_section (NULL_TREE, UNLIKELY_EXECUTED_TEXT_SECTION_NAME, 
>> 0);
>> -
>> -#else
>> +      else
>> +	{
>>        in_section = in_unlikely_executed_text;
>> -      fprintf (asm_out_file, SECTION_FORMAT_STRING,
>> -	       UNLIKELY_EXECUTED_TEXT_SECTION_NAME);
>> -#endif /* ifdef TARGET_ASM_NAMED_SECTION */
>> +	  ASM_OUTPUT_ALIGN (asm_out_file, 2);
>> +	  fprintf (asm_out_file, "%s\n", TEXT_SECTION_ASM_OP);
>> +	}
>> +
>
> I don't favor tracking this case in in_section.  See 
> readonly_data_section for an example of status quo.  It it were to be 
> tracked, it should be tracked when UNLIKELY_SECTION_ASM_OP is defined 
> on the platform, and only then, just like all the other ones, see 
> in_section for what I mean.

I was just trying to keep the same way as Caroline had it, also in your 
patch you removed the
use of SECTION_FORMAT_STRING and UNLIKELY_EXECUTED_TEXT_SECTION_NAME 
but you did not delete
the documentation for them.  Also your patch does this:

   int
   in_unlikely_text_section (void)
   {
!   return in_section == in_named
!     && strcmp (in_named_name, UNLIKELY_EXECUTED_TEXT_SECTION_NAME) != 
0;
   }

Which is wrong for targets which do not have .section still.
It needs to be really:
if ((!targetm.have_named_sections && in_section == in_text)
     || (in_section == in_named && !strcmp (in_named_name, 
UNLIKELY_EXECUTED_TEXT_SECTION_NAME)))


Also you patch does not add the alignment which Caroline said she 
needed on x86.


Thanks,
Andrew Pinski



More information about the Gcc-patches mailing list