avoiding multiple passes on RTL in init_alias_analysis

Richard Henderson rth@redhat.com
Mon Nov 25 16:52:00 GMT 2002


On Wed, Oct 30, 2002 at 03:35:29PM +0530, Sanjiv Kumar Gupta, Noida wrote:
> I populate new_reg_base_value using the previously recorded bases in itself,
> in the same pass. This reduces the number of passes to 1 in most cases and
> results in improved compilation speed, with no changes in the generated
> assembly.

Cool.

I've committed the following variant of your patch.


r~

        * alias.c (find_base_value): Use new_reg_base_value if it's live.

Index: alias.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/alias.c,v
retrieving revision 1.180
diff -c -p -d -u -r1.180 alias.c
--- alias.c	14 Oct 2002 21:19:04 -0000	1.180
+++ alias.c	26 Nov 2002 00:47:56 -0000
@@ -781,9 +781,16 @@ find_base_value (src)
 	 The test above is not sufficient because the scheduler may move
 	 a copy out of an arg reg past the NOTE_INSN_FUNCTION_BEGIN.  */
       if ((regno >= FIRST_PSEUDO_REGISTER || fixed_regs[regno])
-	  && regno < reg_base_value_size
-	  && reg_base_value[regno])
-	return reg_base_value[regno];
+	  && regno < reg_base_value_size)
+	{
+	  /* If we're inside init_alias_analysis, use new_reg_base_value
+	     to reduce the number of relaxation iterations.  */
+	  if (new_reg_base_value && new_reg_base_value[regno])
+	    return new_reg_base_value[regno];
+
+	  if (reg_base_value[regno])
+	    return reg_base_value[regno];
+	}
 
       return src;
 



More information about the Gcc-patches mailing list