RFA: patch for 37790

Vladimir Makarov vmakarov@redhat.com
Wed Nov 19 15:33:00 GMT 2008


H.J. Lu wrote:
> On Sun, Nov 16, 2008 at 11:54:09AM -0500, Vladimir Makarov wrote:
>   
>>  The following patch solves PR37790.  The problem is described on
>>
>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37790
>>
>> The patch switches stack slot coalescing from usage of bitmaps to usage  
>> of live ranges. It dramatically decreases compilation speed and memory  
>> usage for this test.   The patch also prohibits stack slot sharing and  
>> processing pseudos spilled by IRA in reload pass when the register  
>> pressure is too high (more than 10K) to guarantee IRA decent behavior in  
>> extreme cases.  The patch was successfully bootstrapped on x86/x86_64, 
>> ppc64, and itanium.
>>
>> Ok to submit?
>>
>> 2008-11-15  Vladimir Makarov  <vmakarov@redhat.com>
>>
>>    PR bootstrap/37790
>>    * ira-int.h (ira_copy_allocno_live_range_list,
>>    ira_merge_allocno_live_ranges,
>>    ira_allocno_live_ranges_intersect_p,
>>    ira_finish_allocno_live_range_list): New prototypes.
>>    (ira_allocno_live_ranges_intersect_p,
>>    ira_pseudo_live_ranges_intersect_p): Remove.
>>      * ira-conflicts.c (ira_allocno_live_ranges_intersect_p,
>>    ira_pseudo_live_ranges_intersect_p): Rename to
>>    allocnos_have_intersected_live_ranges_p and
>>    pseudos_have_intersected_live_ranges_p.  Move them from here to
>>    ...
>>
>>    * ira-color.c: ... here
>>    (coalesced_allocno_conflict_p): Use
>>    allocnos_have_intersected_live_ranges_p.
>>    (coalesced_allocnos_living_at_program_points,
>>    coalesced_allocnos_live_at_points_p,
>>    set_coalesced_allocnos_live_points): Remove.
>>    (slot_coalesced_allocnos_live_ranges,
>>    slot_coalesced_allocno_live_ranges_intersect_p,
>>    setup_slot_coalesced_allocno_live_ranges): New.
>>    (coalesce_spill_slots): Use ranges of coalesced allocnos.
>>    (ira_sort_regnos_for_alter_reg): Use
>>    allocnos_have_intersected_live_ranges_p.
>>    (ira_reuse_stack_slot): Use
>>    pseudos_have_intersected_live_ranges_p.
>>
>>    * global.c (pseudo_for_reload_consideration_p): Check
>>    flag_ira_share_spill_slots too.
>>
>>    * ira-build.c (copy_allocno_live_range_list): Rename to
>>    ira_copy_allocno_live_range_list.  Make it external.
>>    (merge_ranges): Rename to ira_merge_allocno_live_ranges.  Make it
>>    external.
>>    (ira_allocno_live_ranges_intersect_p): New.
>>    (ira_finish_allocno_live_range_list): New.
>>    (finish_allocno): Use it.
>>    (remove_unnecessary_allocnos): Use ira_merge_allocno_live_ranges.
>>    (copy_info_to_removed_store_destinations): Ditto.  Use
>>    ira_copy_allocno_live_range_list.
>>    (ira_flattening): Use ira_merge_allocno_live_ranges.
>>      * ira.c (too_high_register_pressure_p): New function.
>>    (ira): Switch off sharing spill slots if the pressure is too high.
>>     
>
>
> I need this patch on ira-merge branch.  Otherwise, gcc may error 
> pseudos_have_intersected_live_ranges_p is defined, but used.
>
>
>   
Ok, sure.  Thanks, H.J.  I've should have checked bootstrap with 
--dsiable-checking too.  As for the mainline I am going to submit your 
patch with the patch for pr37790 into the trunk today.
> H.J.
> ----
> 2008-11-18  H.J. Lu  <hongjiu.lu@intel.com>
>
> 	* ira-color.c (pseudos_have_intersected_live_ranges_p): Define
> 	only if ENABLE_IRA_CHECKING is defined.
>
> Index: ira-color.c
> ===================================================================
> --- ira-color.c	(revision 141993)
> +++ ira-color.c	(working copy)
> @@ -103,6 +103,7 @@ allocnos_have_intersected_live_ranges_p 
>  					      ALLOCNO_LIVE_RANGES (a2));
>  }
>  
> +#ifdef ENABLE_IRA_CHECKING
>  /* Return TRUE if live ranges of pseudo-registers REGNO1 and REGNO2
>     intersect.  This should be used when there is only one region.
>     Currently this is used during reload.  */
> @@ -120,6 +121,7 @@ pseudos_have_intersected_live_ranges_p (
>      return false;
>    return allocnos_have_intersected_live_ranges_p (a1, a2);
>  }
> +#endif
>   



More information about the Gcc-patches mailing list