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]

[ira] small fixes in comments and names


2008-07-07 Vladimir Makarov <vmakarov@redhat.com>

   * ira-color.c, ira-conflics.c, ira-lives.c, ira-emit.c,
   ira-build.c (IRA_ALLOCNO_TOTAL_CONFLICT_HARD_REGS,
   IRA_ALLOCNO_TOTAL_NO_STACK_REG_P): Rename to
   IRA_ALLOCNO_TOTAL_CONFLICT_HARD_REGS,
   IRA_ALLOCNO_TOTAL_NO_STACK_REG_P.

* ira.h: Ditto. Fix comment for max_point.

* reload1.c (reload): Add comment for ira_sort_insn_chain.


Index: ira-conflicts.c
===================================================================
--- ira-conflicts.c	(revision 137481)
+++ ira-conflicts.c	(working copy)
@@ -622,7 +622,8 @@ build_allocno_conflicts (void)
 	      conflict_bit_vec_words_num = 0;
 	    else
 	      conflict_bit_vec_words_num
-		= (ALLOCNO_MAX (a) - ALLOCNO_MIN (a) + IRA_INT_BITS) / IRA_INT_BITS;
+		= ((ALLOCNO_MAX (a) - ALLOCNO_MIN (a) + IRA_INT_BITS)
+		   / IRA_INT_BITS);
 	    ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE (a)
 	      = conflict_bit_vec_words_num * sizeof (IRA_INT_TYPE);
 	  }
@@ -748,7 +749,7 @@ print_conflicts (FILE *file, bool reg_p)
 	      }
 	  }
       COPY_HARD_REG_SET (conflicting_hard_regs,
-			 IRA_ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a));
+			 ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a));
       AND_COMPL_HARD_REG_SET (conflicting_hard_regs, ira_no_alloc_regs);
       AND_HARD_REG_SET (conflicting_hard_regs,
 			reg_class_contents[ALLOCNO_COVER_CLASS (a)]);
@@ -800,7 +801,7 @@ ira_build_conflicts (void)
 	continue;
       if (! flag_caller_saves)
 	{
-	  IOR_HARD_REG_SET (IRA_ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a),
+	  IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a),
 			    call_used_reg_set);
 	  if (ALLOCNO_CALLS_CROSSED_NUM (a) != 0)
 	    IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a),
@@ -808,7 +809,7 @@ ira_build_conflicts (void)
 	}
       else
 	{
-	  IOR_HARD_REG_SET (IRA_ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a),
+	  IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a),
 			    no_caller_save_reg_set);
 	  if (ALLOCNO_CALLS_CROSSED_NUM (a) != 0)
 	    IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a),
Index: ira-int.h
===================================================================
--- ira-int.h	(revision 137481)
+++ ira-int.h	(working copy)
@@ -197,11 +197,13 @@ struct ira_allocno_live_range
   allocno_live_range_t start_next, finish_next;
 };
 
-/* Program points are enumerated by number from range
+/* Program points are enumerated by numbers from range
    0..IRA_MAX_POINT-1.  There are approximately two times more program
-   points than insns.  One program points correspond points between
-   subsequent insns and other ones correspond to points after usage of
-   input operands but before setting the output operands in insns.  */
+   points than insns.  Program points are places in the program where
+   liveness info can be changed.  In most general case (there are more
+   complicated cases too) some program points correspond places where
+   input operand dies and other ones correspond to places where output
+   operands are born.  */
 extern int ira_max_point;
 
 /* Arrays of size IRA_MAX_POINT mapping a program point to the allocno
@@ -420,7 +422,7 @@ struct ira_allocno
 #define ALLOCNO_CONFLICT_ALLOCNOS_NUM(A) \
   ((A)->conflict_allocnos_num)
 #define ALLOCNO_CONFLICT_HARD_REGS(A) ((A)->conflict_hard_regs)
-#define IRA_ALLOCNO_TOTAL_CONFLICT_HARD_REGS(A) ((A)->total_conflict_hard_regs)
+#define ALLOCNO_TOTAL_CONFLICT_HARD_REGS(A) ((A)->total_conflict_hard_regs)
 #define ALLOCNO_NREFS(A) ((A)->nrefs)
 #define ALLOCNO_FREQ(A) ((A)->freq)
 #define ALLOCNO_HARD_REGNO(A) ((A)->hard_regno)
@@ -434,7 +436,7 @@ struct ira_allocno
 #define ALLOCNO_DONT_REASSIGN_P(A) ((A)->dont_reassign_p)
 #ifdef STACK_REGS
 #define ALLOCNO_NO_STACK_REG_P(A) ((A)->no_stack_reg_p)
-#define IRA_ALLOCNO_TOTAL_NO_STACK_REG_P(A) ((A)->total_no_stack_reg_p)
+#define ALLOCNO_TOTAL_NO_STACK_REG_P(A) ((A)->total_no_stack_reg_p)
 #endif
 #define ALLOCNO_IN_GRAPH_P(A) ((A)->in_graph_p)
 #define ALLOCNO_ASSIGNED_P(A) ((A)->assigned_p)
@@ -1106,7 +1108,7 @@ ira_allocno_conflict_iter_next (ira_allo
    instance of ira_allocno_conflict_iterator used to iterate the
    conflicts.  */
 #define FOR_EACH_ALLOCNO_CONFLICT(ALLOCNO, A, ITER)			\
-  for (ira_allocno_conflict_iter_init (&(ITER), (ALLOCNO));			\
+  for (ira_allocno_conflict_iter_init (&(ITER), (ALLOCNO));		\
        ira_allocno_conflict_iter_cond (&(ITER), &(A));			\
        ira_allocno_conflict_iter_next (&(ITER)))
 
Index: ira-color.c
===================================================================
--- ira-color.c	(revision 137481)
+++ ira-color.c	(working copy)
@@ -274,12 +274,12 @@ assign_hard_reg (ira_allocno_t allocno, 
     {
       mem_cost += ALLOCNO_UPDATED_MEMORY_COST (a);
       IOR_HARD_REG_SET (conflicting_regs,
-			IRA_ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a));
+			ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a));
       ira_allocate_and_copy_costs (&ALLOCNO_UPDATED_HARD_REG_COSTS (a),
 				   cover_class, ALLOCNO_HARD_REG_COSTS (a));
       a_costs = ALLOCNO_UPDATED_HARD_REG_COSTS (a);
 #ifdef STACK_REGS
-      no_stack_reg_p = no_stack_reg_p || IRA_ALLOCNO_TOTAL_NO_STACK_REG_P (a);
+      no_stack_reg_p = no_stack_reg_p || ALLOCNO_TOTAL_NO_STACK_REG_P (a);
 #endif
       for (cost = ALLOCNO_COVER_CLASS_COST (a), i = 0; i < class_size; i++)
 	if (a_costs != NULL)
@@ -711,7 +711,8 @@ push_ira_allocno_to_stack (ira_allocno_t
 		      (uncolorable_allocnos_splay_tree[cover_class],
 		       (splay_tree_key) conflict_allocno);
 		    ALLOCNO_SPLAY_REMOVED_P (conflict_allocno) = true;
-		    VEC_safe_push (ira_allocno_t, heap, removed_splay_allocno_vec,
+		    VEC_safe_push (ira_allocno_t, heap,
+				   removed_splay_allocno_vec,
 				   conflict_allocno);
 		  }
 		ALLOCNO_LEFT_CONFLICTS_NUM (conflict_allocno) = conflicts_num;
@@ -1163,7 +1164,7 @@ setup_allocno_available_regs_num (ira_al
   for (a = ALLOCNO_NEXT_COALESCED_ALLOCNO (allocno);;
        a = ALLOCNO_NEXT_COALESCED_ALLOCNO (a))
     {
-      IOR_HARD_REG_SET (temp_set, IRA_ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a));
+      IOR_HARD_REG_SET (temp_set, ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a));
       if (a == allocno)
 	break;
     }
@@ -1193,7 +1194,7 @@ setup_allocno_left_conflicts_num (ira_al
   for (a = ALLOCNO_NEXT_COALESCED_ALLOCNO (allocno);;
        a = ALLOCNO_NEXT_COALESCED_ALLOCNO (a))
     {
-      IOR_HARD_REG_SET (temp_set, IRA_ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a));
+      IOR_HARD_REG_SET (temp_set, ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a));
       if (a == allocno)
 	break;
     }
@@ -2409,10 +2410,9 @@ allocno_reload_assign (ira_allocno_t a, 
   enum reg_class cover_class;
   int regno = ALLOCNO_REGNO (a);
 
-  IOR_HARD_REG_SET (IRA_ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a), forbidden_regs);
+  IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a), forbidden_regs);
   if (! flag_caller_saves && ALLOCNO_CALLS_CROSSED_NUM (a) != 0)
-    IOR_HARD_REG_SET (IRA_ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a),
-		      call_used_reg_set);
+    IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a), call_used_reg_set);
   ALLOCNO_ASSIGNED_P (a) = false;
   ira_assert (ALLOCNO_UPDATED_HARD_REG_COSTS (a) == NULL);
   ira_assert (ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS (a) == NULL);
@@ -2623,7 +2623,8 @@ ira_reuse_stack_slot (int regno, unsigne
 				    FIRST_PSEUDO_REGISTER, i, bi)
 	    {
 	      another_allocno = ira_regno_allocno_map[i];
-	      if (ira_allocno_live_ranges_intersect_p (allocno, another_allocno))
+	      if (ira_allocno_live_ranges_intersect_p (allocno,
+						       another_allocno))
 		goto cont;
 	    }
 	  for (cost = 0, cp = ALLOCNO_COPIES (allocno);
Index: ira-lives.c
===================================================================
--- ira-lives.c	(revision 137481)
+++ ira-lives.c	(working copy)
@@ -91,8 +91,9 @@ make_regno_born (int regno)
       SET_HARD_REG_BIT (hard_regs_live, regno);
       EXECUTE_IF_SET_IN_SPARSESET (allocnos_live, i)
         {
-	  SET_HARD_REG_BIT (ALLOCNO_CONFLICT_HARD_REGS (ira_allocnos[i]), regno);
-	  SET_HARD_REG_BIT (IRA_ALLOCNO_TOTAL_CONFLICT_HARD_REGS (ira_allocnos[i]),
+	  SET_HARD_REG_BIT (ALLOCNO_CONFLICT_HARD_REGS (ira_allocnos[i]),
+			    regno);
+	  SET_HARD_REG_BIT (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (ira_allocnos[i]),
 			    regno);
 	}
       return;
@@ -175,7 +176,7 @@ set_allocno_live (ira_allocno_t a)
     return;
   sparseset_set_bit (allocnos_live, ALLOCNO_NUM (a));
   IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a), hard_regs_live);
-  IOR_HARD_REG_SET (IRA_ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a), hard_regs_live);
+  IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a), hard_regs_live);
   cover_class = ALLOCNO_COVER_CLASS (a);
   nregs = ira_reg_class_nregs[cover_class][ALLOCNO_MODE (a)];
   curr_reg_pressure[cover_class] += nregs;
@@ -375,7 +376,8 @@ mark_reg_death (rtx reg)
 		    {
 		      EXECUTE_IF_SET_IN_SPARSESET (allocnos_live, i)
 			{
-			  update_allocno_pressure_excess_length (ira_allocnos[i]);
+			  update_allocno_pressure_excess_length
+			    (ira_allocnos[i]);
 			}
 		      high_pressure_start_point[cover_class] = -1;
 		    }
@@ -602,7 +604,7 @@ process_single_reg_class_operands (bool 
 		 because it will be spilled in reload in anyway.  */
 	      IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a),
 				reg_class_contents[cl]);
-	      IOR_HARD_REG_SET (IRA_ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a),
+	      IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a),
 				reg_class_contents[cl]);
 	    }
 	}
@@ -697,7 +699,7 @@ process_bb_node_lives (ira_loop_tree_nod
 	  EXECUTE_IF_SET_IN_SPARSESET (allocnos_live, px)
 	    {
 	      ALLOCNO_NO_STACK_REG_P (ira_allocnos[px]) = true;
-	      IRA_ALLOCNO_TOTAL_NO_STACK_REG_P (ira_allocnos[px]) = true;
+	      ALLOCNO_TOTAL_NO_STACK_REG_P (ira_allocnos[px]) = true;
 	    }
 	  for (px = FIRST_STACK_REG; px <= LAST_STACK_REG; px++)
 	    make_regno_born_and_dead (px);
@@ -763,7 +765,7 @@ process_bb_node_lives (ira_loop_tree_nod
 		  if (cfun->has_nonlocal_label)
 		    {
 		      SET_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a));
-		      SET_HARD_REG_SET (IRA_ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a));
+		      SET_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a));
 		    }
 		}
 	    }
@@ -957,11 +959,11 @@ propagate_new_allocno_info (ira_allocno_
     {
       ALLOCNO_CALL_FREQ (parent_a) += ALLOCNO_CALL_FREQ (a);
 #ifdef STACK_REGS
-      if (IRA_ALLOCNO_TOTAL_NO_STACK_REG_P (a))
-	IRA_ALLOCNO_TOTAL_NO_STACK_REG_P (parent_a) = true;
+      if (ALLOCNO_TOTAL_NO_STACK_REG_P (a))
+	ALLOCNO_TOTAL_NO_STACK_REG_P (parent_a) = true;
 #endif
-      IOR_HARD_REG_SET (IRA_ALLOCNO_TOTAL_CONFLICT_HARD_REGS (parent_a),
-			IRA_ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a));
+      IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (parent_a),
+			ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a));
       if (ALLOCNO_CALLS_CROSSED_START (parent_a) < 0
 	  || (ALLOCNO_CALLS_CROSSED_START (a) >= 0
 	      && (ALLOCNO_CALLS_CROSSED_START (parent_a)
Index: ira-emit.c
===================================================================
--- ira-emit.c	(revision 137481)
+++ ira-emit.c	(working copy)
@@ -848,10 +848,9 @@ add_range_and_copies_from_move_list (mov
       bitmap_clear_bit (live_through, ALLOCNO_REGNO (to));
       IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (from), hard_regs_live);
       IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (to), hard_regs_live);
-      IOR_HARD_REG_SET (IRA_ALLOCNO_TOTAL_CONFLICT_HARD_REGS (from),
-			hard_regs_live);
-      IOR_HARD_REG_SET (IRA_ALLOCNO_TOTAL_CONFLICT_HARD_REGS (to),
+      IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (from),
 			hard_regs_live);
+      IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (to), hard_regs_live);
       update_costs (from, true, freq);
       update_costs (to, false, freq);
       cp = ira_add_allocno_copy (from, to, freq, move->insn, NULL);
Index: ira-build.c
===================================================================
--- ira-build.c	(revision 137481)
+++ ira-build.c	(working copy)
@@ -514,8 +514,7 @@ ira_create_allocno (int regno, bool cap_
   ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a) = NULL;
   ALLOCNO_CONFLICT_ALLOCNOS_NUM (a) = 0;
   COPY_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a), ira_no_alloc_regs);
-  COPY_HARD_REG_SET (IRA_ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a),
-		     ira_no_alloc_regs);
+  COPY_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a), ira_no_alloc_regs);
   ALLOCNO_NREFS (a) = 0;
   ALLOCNO_FREQ (a) = 1;
   ALLOCNO_HARD_REGNO (a) = -1;
@@ -524,7 +523,7 @@ ira_create_allocno (int regno, bool cap_
   ALLOCNO_CALLS_CROSSED_START (a) = -1;
 #ifdef STACK_REGS
   ALLOCNO_NO_STACK_REG_P (a) = false;
-  IRA_ALLOCNO_TOTAL_NO_STACK_REG_P (a) = false;
+  ALLOCNO_TOTAL_NO_STACK_REG_P (a) = false;
 #endif
   ALLOCNO_MEM_OPTIMIZED_DEST (a) = NULL;
   ALLOCNO_MEM_OPTIMIZED_DEST_P (a) = false;
@@ -572,7 +571,7 @@ ira_set_allocno_cover_class (ira_allocno
   ALLOCNO_COVER_CLASS (a) = cover_class;
   IOR_COMPL_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a),
 			  reg_class_contents[cover_class]);
-  IOR_COMPL_HARD_REG_SET (IRA_ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a),
+  IOR_COMPL_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a),
 			  reg_class_contents[cover_class]);
 }
 
@@ -883,14 +882,13 @@ propagate_info_to_cap (ira_allocno_t cap
   ALLOCNO_CALL_FREQ (cap) = ALLOCNO_CALL_FREQ (a);
   IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (cap),
 		    ALLOCNO_CONFLICT_HARD_REGS (a));
-  IOR_HARD_REG_SET (IRA_ALLOCNO_TOTAL_CONFLICT_HARD_REGS (cap),
-		    IRA_ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a));
+  IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (cap),
+		    ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a));
   ALLOCNO_CALLS_CROSSED_NUM (cap) = ALLOCNO_CALLS_CROSSED_NUM (a);
   ALLOCNO_CALLS_CROSSED_START (cap) = ALLOCNO_CALLS_CROSSED_START (a);
 #ifdef STACK_REGS
   ALLOCNO_NO_STACK_REG_P (cap) = ALLOCNO_NO_STACK_REG_P (a);
-  IRA_ALLOCNO_TOTAL_NO_STACK_REG_P (cap)
-    = IRA_ALLOCNO_TOTAL_NO_STACK_REG_P (a);
+  ALLOCNO_TOTAL_NO_STACK_REG_P (cap) = ALLOCNO_TOTAL_NO_STACK_REG_P (a);
 #endif
   /* Add copies to the cap.  */
   for (cp = ALLOCNO_COPIES (a); cp != NULL; cp = next_cp)
@@ -2008,17 +2006,17 @@ ira_flattening (int max_regno_before_emi
 	  if (propagate_p)
 	    {
 	      if (!allocno_propagated_p [ALLOCNO_NUM (parent_a)])
-		COPY_HARD_REG_SET (IRA_ALLOCNO_TOTAL_CONFLICT_HARD_REGS (parent_a),
+		COPY_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (parent_a),
 				   ALLOCNO_CONFLICT_HARD_REGS (parent_a));
-	      IOR_HARD_REG_SET (IRA_ALLOCNO_TOTAL_CONFLICT_HARD_REGS (parent_a),
-				IRA_ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a));
+	      IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (parent_a),
+				ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a));
 #ifdef STACK_REGS
 	      if (!allocno_propagated_p [ALLOCNO_NUM (parent_a)])
-		IRA_ALLOCNO_TOTAL_NO_STACK_REG_P (parent_a)
+		ALLOCNO_TOTAL_NO_STACK_REG_P (parent_a)
 		  = ALLOCNO_NO_STACK_REG_P (parent_a);
-	      IRA_ALLOCNO_TOTAL_NO_STACK_REG_P (parent_a)
-		= (IRA_ALLOCNO_TOTAL_NO_STACK_REG_P (parent_a)
-		   || IRA_ALLOCNO_TOTAL_NO_STACK_REG_P (a));
+	      ALLOCNO_TOTAL_NO_STACK_REG_P (parent_a)
+		= (ALLOCNO_TOTAL_NO_STACK_REG_P (parent_a)
+		   || ALLOCNO_TOTAL_NO_STACK_REG_P (a));
 #endif
 	      allocno_propagated_p [ALLOCNO_NUM (parent_a)] = true;
 	    }
Index: reload1.c
===================================================================
--- reload1.c	(revision 137481)
+++ reload1.c	(working copy)
@@ -1120,8 +1120,8 @@ reload (rtx first, int global)
     }
 
   if (flag_ira && optimize)
-    /* Restore the original insn chain order for correct reload
-       work.  */
+    /* Restore the original insn chain order for correct reload work
+       (e.g. for correct inheritance).  */
     ira_sort_insn_chain (false);
 
   /* If global-alloc was run, notify it of any register eliminations we have

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