public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH]: Allow TARGET_SCHED_ADJUST_PRIORITY hook to reduce priority
@ 2018-09-03 14:32 John David Anglin
  2018-09-06 17:05 ` Jeff Law
  0 siblings, 1 reply; 11+ messages in thread
From: John David Anglin @ 2018-09-03 14:32 UTC (permalink / raw)
  To: GCC Patches; +Cc: Jeff Law

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

The documentation for TARGET_SCHED_ADJUST_PRIORITY indicates that the 
hook can
reduce the priority of INSN to execute it later.  The hppa hook only 
reduces the priority
and it has been this way for years.  However, the assert in 
sel_target_adjust_priority()
prevents reduction of the priority.

The attached change revises the assert to allow the priority to be 
reduced to zero.

This fixes PR rtl-optimization/85458.

Tested on hppa-unknown-linux-gnu, hppa2.0w-hp-hpux11.11 and 
hppa64-hp-hpux11.11.

I must admit that this happens so infrequently that I have to wonder if 
the hook provides
any benefit on hppa.  It was supposed to keep addil instructions close 
to the following instruction
to reduce pressure on register %r1.

Okay?

Dave

-- 
John David Anglin  dave.anglin@bell.net


[-- Attachment #2: sel-sched.c.d --]
[-- Type: text/plain, Size: 805 bytes --]

2018-09-03  John David Anglin  <danglin@gcc.gnu.org>

	PR rtl-optimization/85458
	* sel-sched.c (sel_target_adjust_priority): Allow backend adjust
	priority hook to reduce the priority of EXPR.

Index: sel-sched.c
===================================================================
--- sel-sched.c	(revision 264045)
+++ sel-sched.c	(working copy)
@@ -3330,11 +3330,11 @@
   else
     new_priority = priority;
 
+  gcc_assert (new_priority >= 0);
+
   /* If the priority has changed, adjust EXPR_PRIORITY_ADJ accordingly.  */
   EXPR_PRIORITY_ADJ (expr) = new_priority - EXPR_PRIORITY (expr);
 
-  gcc_assert (EXPR_PRIORITY_ADJ (expr) >= 0);
-
   if (sched_verbose >= 4)
     sel_print ("sel_target_adjust_priority: insn %d,  %d+%d = %d.\n",
 	       INSN_UID (EXPR_INSN_RTX (expr)), EXPR_PRIORITY (expr),

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-09-20  1:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-03 14:32 [PATCH]: Allow TARGET_SCHED_ADJUST_PRIORITY hook to reduce priority John David Anglin
2018-09-06 17:05 ` Jeff Law
2018-09-10 12:35   ` Andreas Schwab
2018-09-10 14:10     ` John David Anglin
2018-09-17  9:13       ` Andreas Schwab
2018-09-17 14:07         ` John David Anglin
2018-09-17 14:25           ` Andreas Schwab
2018-09-17 19:34         ` Jeff Law
2018-09-18  8:00           ` Andreas Schwab
2018-09-18 13:51             ` Jeff Law
2018-09-20  1:51   ` [PATCH] hppa: Remove TARGET_SCHED_ADJUST_PRIORITY hook John David Anglin

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).