diff mbox

[PR,10474] Take two on splitting live-ranges of function arguments to help shrink-wrapping

Message ID 20131114182224.GK10643@virgil.suse
State New
Headers show

Commit Message

Martin Jambor Nov. 14, 2013, 6:22 p.m. UTC
Hi,

On Thu, Nov 14, 2013 at 12:18:24PM +0000, Matthew Leach wrote:
> Martin Jambor <mjambor@suse.cz> writes:
> 
> > Hi,
> 
> Hi Martin,
> 
> [...]
> 
> >
> > 2013-11-04  Martin Jambor  <mjambor@suse.cz>
> >
> >         PR rtl-optimization/10474
> >         * ira.c (interesting_dest_for_shprep): New function.
> >         (split_live_ranges_for_shrink_wrap): Likewise.
> >         (find_moveable_pseudos): Move calculation of dominance info,
> >         df_analysios and the final anlyses to...
> >         (ira): ...here, call split_live_ranges_for_shrink_wrap.
> >
> > testsuite/
> >         * gcc.dg/pr10474.c: New testcase.
> >         * gcc.dg/ira-shrinkwrap-prep-1.c: Likewise.
> >         * gcc.dg/ira-shrinkwrap-prep-2.c: Likewise.
> 
> This patch seems to breaks stage-3 bootstrap for
> armv7l-unknown-linux-gnueabihf. genmddeps and genhooks seem to be in
> an infinite loop (I've left them running for approx 1h 30m now).
> 
> My configure flags are:
> 
> ../gcc/configure --with-cpu=cortex-a15 --with-tune=cortex-a15 --disable-nla --enable-shared --with-float=hard --with-fpu=neon-vfpv4
> 

I hope all the issues are just different manisfestations of PR 59099.
I hope to have fixed that by the patch below but I've just only
started bootstrapping it (and I'd like to do that on multiple
platforms before proposing it).  But of course everybody can test if
it helps with their issues (and does not create new ones), I'd be
grateful if you do.

The problem in that PR was with reload (or perhaps I should say LRA)
getting confused by information in array ira_reg_equiv which was not
updated by my patch.  Rather than updating it, I have decided to move
the transformation before its computation.

The reason my previous attempts t this failed was that I use
ira_create_new_reg which resizes that array too and so I needed to
move its allocation upwards as well (what a stupid thing to debug for
a couple of hours, sigh).

Thanks and sorry again, but it is a tough area for me,

Martin


2013-11-14  Martin Jambor  <mjambor@suse.cz>

	* ira.c (find_moveable_pseudos): Put back various analyses from ira()
	here.
	(ira): Move init_reg_equiv and call to
	split_live_ranges_for_shrink_wrap up, remove analyses around call
	to find_moveable_pseudos.

Comments

Matthew Leach Nov. 15, 2013, 9:22 a.m. UTC | #1
Martin Jambor <mjambor@suse.cz> writes:

> Hi,
>
> On Thu, Nov 14, 2013 at 12:18:24PM +0000, Matthew Leach wrote:
>> Martin Jambor <mjambor@suse.cz> writes:
>> 
>> > Hi,
>> 
>> Hi Martin,
>> 
>> [...]
>> 
>> >
>> > 2013-11-04  Martin Jambor  <mjambor@suse.cz>
>> >
>> >         PR rtl-optimization/10474
>> >         * ira.c (interesting_dest_for_shprep): New function.
>> >         (split_live_ranges_for_shrink_wrap): Likewise.
>> >         (find_moveable_pseudos): Move calculation of dominance info,
>> >         df_analysios and the final anlyses to...
>> >         (ira): ...here, call split_live_ranges_for_shrink_wrap.
>> >
>> > testsuite/
>> >         * gcc.dg/pr10474.c: New testcase.
>> >         * gcc.dg/ira-shrinkwrap-prep-1.c: Likewise.
>> >         * gcc.dg/ira-shrinkwrap-prep-2.c: Likewise.
>> 
>> This patch seems to breaks stage-3 bootstrap for
>> armv7l-unknown-linux-gnueabihf. genmddeps and genhooks seem to be in
>> an infinite loop (I've left them running for approx 1h 30m now).
>> 
>> My configure flags are:
>> 
>> ../gcc/configure --with-cpu=cortex-a15 --with-tune=cortex-a15 --disable-nla --enable-shared --with-float=hard --with-fpu=neon-vfpv4
>> 
>
> I hope all the issues are just different manisfestations of PR 59099.
> I hope to have fixed that by the patch below but I've just only
> started bootstrapping it (and I'd like to do that on multiple
> platforms before proposing it).  But of course everybody can test if
> it helps with their issues (and does not create new ones), I'd be
> grateful if you do.

I've put this patch through a bootstrap on an ARM chromebook and it
seems to fix the problem I was seeing..

Thanks,
Matt
diff mbox

Patch

diff --git a/gcc/ira.c b/gcc/ira.c
index 2ef69cb..a171761 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -4515,6 +4515,9 @@  find_moveable_pseudos (void)
   pseudo_replaced_reg.release ();
   pseudo_replaced_reg.safe_grow_cleared (max_regs);
 
+  df_analyze ();
+  calculate_dominance_info (CDI_DOMINATORS);
+
   i = 0;
   bitmap_initialize (&live, 0);
   bitmap_initialize (&used, 0);
@@ -4827,6 +4830,14 @@  find_moveable_pseudos (void)
   free (bb_moveable_reg_sets);
 
   last_moveable_pseudo = max_reg_num ();
+
+  fix_reg_equiv_init ();
+  expand_reg_info ();
+  regstat_free_n_sets_and_refs ();
+  regstat_free_ri ();
+  regstat_init_n_sets_and_refs ();
+  regstat_compute_ri ();
+  free_dominance_info (CDI_DOMINATORS);
 }
 
 
@@ -5187,7 +5198,19 @@  ira (FILE *f)
 #endif
   df_analyze ();
 
+  init_reg_equiv ();
+  if (ira_conflicts_p)
+    {
+      calculate_dominance_info (CDI_DOMINATORS);
+
+      if (split_live_ranges_for_shrink_wrap ())
+	df_analyze ();
+
+      free_dominance_info (CDI_DOMINATORS);
+    }
+
   df_clear_flags (DF_NO_INSN_RESCAN);
+
   regstat_init_n_sets_and_refs ();
   regstat_compute_ri ();
 
@@ -5205,7 +5228,6 @@  ira (FILE *f)
   if (resize_reg_info () && flag_ira_loop_pressure)
     ira_set_pseudo_classes (true, ira_dump_file);
 
-  init_reg_equiv ();
   rebuild_p = update_equiv_regs ();
   setup_reg_equiv ();
   setup_reg_equiv_init ();
@@ -5228,22 +5250,7 @@  ira (FILE *f)
      allocation because of -O0 usage or because the function is too
      big.  */
   if (ira_conflicts_p)
-    {
-      df_analyze ();
-      calculate_dominance_info (CDI_DOMINATORS);
-
-      find_moveable_pseudos ();
-      if (split_live_ranges_for_shrink_wrap ())
-	df_analyze ();
-
-      fix_reg_equiv_init ();
-      expand_reg_info ();
-      regstat_free_n_sets_and_refs ();
-      regstat_free_ri ();
-      regstat_init_n_sets_and_refs ();
-      regstat_compute_ri ();
-      free_dominance_info (CDI_DOMINATORS);
-    }
+    find_moveable_pseudos ();
 
   max_regno_before_ira = max_reg_num ();
   ira_setup_eliminable_regset (true);