This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: avoiding multiple passes on RTL in init_alias_analysis
- From: Richard Henderson <rth at redhat dot com>
- To: "Sanjiv Kumar Gupta, Noida" <sanjivg at noida dot hcltech dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 25 Nov 2002 16:52:17 -0800
- Subject: Re: avoiding multiple passes on RTL in init_alias_analysis
- References: <E04CF3F88ACBD5119EFE00508BBB21210537540D@exch-01.noida.hcltech.com>
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;