public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PR43656] skip debug insns in -fsched-pressure
@ 2010-06-11 19:42 Alexandre Oliva
  0 siblings, 0 replies; only message in thread
From: Alexandre Oliva @ 2010-06-11 19:42 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 640 bytes --]

We didn't take debug insns into account when initializing register
pressure computations, but updates would sometimes take reg uses in
debug insns into account.  This patch fixes this, so that we get the
same scheduling.

Bootstrapped the compiler, along with the just-posted patch for PR44181,
on x86_64-linux-gnu, with the following options:

-O2 -g -fschedule-insns -fsched-pressure -funroll-loops -fgraphite-identity

for stage2 and stage3 host, and for stage3 libs (also -fcompare-debug)

I got build failures on zlib and libada, presumably because of this
unusual combination of flags, but no -fcompare-debug errors.

Ok to install?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: vta-sched-pressure-pr43656.patch --]
[-- Type: text/x-diff, Size: 1770 bytes --]

for  gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	PR debug/43656
	* haifa-sched.c (setup_insn_reg_pressure_info,
	update_register_pressure): Reject debug insns.
	(ready_sort): Don't setup reg pressure for debug insns.
	(schedule_insn): Don't update reg pressure for debug insns.

Index: gcc/haifa-sched.c
===================================================================
--- gcc/haifa-sched.c.orig	2010-06-11 10:56:20.000000000 -0300
+++ gcc/haifa-sched.c	2010-06-11 10:56:21.000000000 -0300
@@ -1124,6 +1124,8 @@ setup_insn_reg_pressure_info (rtx insn)
   struct reg_use_data *use;
   static int death[N_REG_CLASSES];
 
+  gcc_checking_assert (!DEBUG_INSN_P (insn));
+
   excess_cost_change = 0;
   for (i = 0; i < ira_reg_class_cover_size; i++)
     death[ira_reg_class_cover[i]] = 0;
@@ -1500,7 +1502,8 @@ ready_sort (struct ready_list *ready)
   if (sched_pressure_p)
     {
       for (i = 0; i < ready->n_ready; i++)
-	setup_insn_reg_pressure_info (first[i]);
+	if (!DEBUG_INSN_P (first[i]))
+	  setup_insn_reg_pressure_info (first[i]);
     }
   SCHED_SORT (first, ready->n_ready);
 }
@@ -1564,6 +1567,8 @@ update_register_pressure (rtx insn)
   struct reg_use_data *use;
   struct reg_set_data *set;
 
+  gcc_checking_assert (!DEBUG_INSN_P (insn));
+
   for (use = INSN_REG_USE_LIST (insn); use != NULL; use = use->next_insn_use)
     if (dying_use_p (use) && bitmap_bit_p (curr_reg_live, use->regno))
       mark_regno_birth_or_death (use->regno, false);
@@ -1684,7 +1689,7 @@ schedule_insn (rtx insn)
       fputc ('\n', sched_dump);
     }
 
-  if (sched_pressure_p)
+  if (sched_pressure_p && !DEBUG_INSN_P (insn))
     update_reg_and_insn_max_reg_pressure (insn);
 
   /* Scheduling instruction should have all its dependencies resolved and

[-- Attachment #3: Type: text/plain, Size: 257 bytes --]


-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-06-11 19:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-11 19:42 [PR43656] skip debug insns in -fsched-pressure Alexandre Oliva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).