diff mbox

[PR38711] Use DF_LIVE in IRA if it available (for -O2 and higher)

Message ID CABu31nOXQXxDOhq-4sYvPy-8NXyq7oDQukMGwn=TBjsAfw1UmQ@mail.gmail.com
State New
Headers show

Commit Message

Steven Bosscher Oct. 27, 2012, 10:07 p.m. UTC
On Sat, Oct 27, 2012 at 11:49 PM, Steven Bosscher wrote:
> So I'm going to revert this patch.

Or actually better, this lighter-weight patch. Will commit after the
usual testing.

        * ira.c (ira): Remove DF_LIVE if the problem is in the stack.
       (do_reload): Add it back at the end.

Comments

Vladimir Makarov Oct. 28, 2012, 8:14 p.m. UTC | #1
On 12-10-27 6:07 PM, Steven Bosscher wrote:
> On Sat, Oct 27, 2012 at 11:49 PM, Steven Bosscher wrote:
>> So I'm going to revert this patch.
> Or actually better, this lighter-weight patch. Will commit after the
> usual testing.
>
>
I returned to this problem several times and every time I failed to use 
LIVE info (may be I was not so persistent to solve the problem or had 
few time for this).  Your problem description helped me to remember what 
I saw many years ago.

May be this patch is even better because we don't need to spend time to 
calculate DF_LIVE although as Kenny wrote DF_LIVE might help for extreme 
tests as DF_LIVE is more compact than DF_LR.
diff mbox

Patch

Index: ira.c
===================================================================
--- ira.c       (revision 192878)
+++ ira.c       (working copy)
@@ -4399,6 +4399,16 @@  ira (FILE *f)
   setup_prohibited_mode_move_regs ();

   df_note_add_problem ();
+
+  /* DF_LIVE can't be used in the register allocator, too many other
+     parts of the compiler depend on using the "classic" liveness
+     interpretation of the DF_LR problem.  See PR38711.
+     Remove the problem, so that we don't spend time updating it in
+     any of the df_analyze() calls during IRA/LRA.  */
+  if (optimize > 1)
+    df_remove_problem (df_live);
+  gcc_checking_assert (df_live == NULL);
+
 #ifdef ENABLE_CHECKING
   df->changeable_flags |= DF_VERIFY_SCHEDULED;
 #endif
@@ -4678,6 +4688,12 @@  do_reload (void)
   df_scan_alloc (NULL);
   df_scan_blocks ();

+  if (optimize > 1)
+    {
+      df_live_add_problem ();
+      df_live_set_all_dirty ();
+    }
+
   if (optimize)
     df_analyze ();