Frederic Riss sent me IRA dump files for an in-house GCC back-end which helped to find a bug in coloring in presence of multi-register allocnos. The bug resulted in making allocno colorable too earlier and as a consequence in worse code. The problem was in preventing processing of all conflicting objects of an allocno although the impact of each object was taken as 1. It was my mistake in merging code for IRA coloring without cover classes and Bernd's work on multi-object allocnos.

The following patch changes SPEC2000 code on x86 (32-bit mode) for vpr, gcc, crafty, parser, and vortex and improves scores (up to 0.7% for crafty) and decrease code size (up to 0.5% for crafty) for these benchmarks. Frederic Riss also reported considerable improvements for his back-end.


The patch was successfully bootstrapped on x86/x86-64 and committed as rev. 185971.

2012-03-29  Vladimir Makarov <vmaka...@redhat.com>

    * ira-color.c (setup_left_conflict_sizes_p): Process all
    conflicting objects.



Index: ira-color.c
===================================================================
--- ira-color.c	(revision 185967)
+++ ira-color.c	(working copy)
@@ -821,7 +821,6 @@ setup_left_conflict_sizes_p (ira_allocno
   node_preorder_num = node->preorder_num;
   COPY_HARD_REG_SET (node_set, node->hard_regs->set);
   node_check_tick++;
-  curr_allocno_process++;
   for (k = 0; k < nobj; k++)
     {
       ira_object_t obj = ALLOCNO_OBJECT (a, k);
@@ -838,12 +837,10 @@ setup_left_conflict_sizes_p (ira_allocno
 
 	  conflict_data = ALLOCNO_COLOR_DATA (conflict_a);
 	  if (! ALLOCNO_COLOR_DATA (conflict_a)->in_graph_p
-	      || conflict_data->last_process == curr_allocno_process
 	      || ! hard_reg_set_intersect_p (profitable_hard_regs,
 					     conflict_data
 					     ->profitable_hard_regs))
 	    continue;
-	  conflict_data->last_process = curr_allocno_process;
 	  conflict_node = conflict_data->hard_regs_node;
 	  COPY_HARD_REG_SET (conflict_node_set, conflict_node->hard_regs->set);
 	  if (hard_reg_set_subset_p (node_set, conflict_node_set))

Reply via email to