public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] New debug parameter sched-pressure-factor
@ 2014-10-23  3:37 Maxim Kuvyrkov
  2014-10-24  4:12 ` Jeff Law
  0 siblings, 1 reply; 2+ messages in thread
From: Maxim Kuvyrkov @ 2014-10-23  3:37 UTC (permalink / raw)
  To: Vladimir Makarov; +Cc: GCC Patches, Richard Sandiford

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

Hi,

For benchmarking and tuning of register-pressure scheduling I've made the following simple patch to adjust effective number of registers that scheduler has at its disposal.  Do you think this would be valuable for others to investigate performance problems or tune register-pressure scheduling?

The parameter scales number of register by the given number of percent (the default is 100, which is the current status quo).  At value of 50 the scheduler attempt to use only half of available registers, while value of 200 will cause it to assume double the number of available registers (and, likely, cause a lot of spills).

Thank you,

--
Maxim Kuvyrkov
www.linaro.org



[-- Attachment #2: 0008-Sched_pressure_factor.patch --]
[-- Type: application/octet-stream, Size: 1469 bytes --]

From 1a68bda335fe39ad04316c8a6b511cbd18bdba9c Mon Sep 17 00:00:00 2001
From: Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>
Date: Thu, 23 Oct 2014 00:29:01 +0100
Subject: [PATCH 8/8] Sched_pressure_factor

---
 gcc/haifa-sched.c |    4 ++++
 gcc/params.def    |    6 ++++++
 2 files changed, 10 insertions(+)

diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 708cc66..4877bc6 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -3861,6 +3861,10 @@ sched_pressure_start_bb (basic_block bb)
 	sched_class_regs_num[cl] = ira_class_hard_regs_num[cl];
 	sched_class_regs_num[cl]
 	  -= (call_used_regs_num[cl] * entry_freq) / bb_freq;
+
+	sched_class_regs_num[cl]
+	  = (sched_class_regs_num[cl]
+	     * PARAM_VALUE (PARAM_SCHED_PRESSURE_FACTOR)) / 100;
       }
   }
 
diff --git a/gcc/params.def b/gcc/params.def
index 34e5f59..ffda2cc 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -1064,6 +1064,12 @@ DEFPARAM (PARAM_SCHED_PRESSURE_ALGORITHM,
 	  "Which -fsched-pressure algorithm to apply",
 	  1, 1, 2)
 
+/* Increase/decrease effective number of available registers for scheduling.  */
+DEFPARAM (PARAM_SCHED_PRESSURE_FACTOR,
+	  "sched-pressure-factor",
+	  "Factor to adjust estimated number of available registers for sched",
+	  100, 0, 0)
+
 /* Maximum length of candidate scans in straight-line strength reduction.  */
 DEFPARAM (PARAM_MAX_SLSR_CANDIDATE_SCAN,
 	  "max-slsr-cand-scan",
-- 
1.7.9.5


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

* Re: [PATCH] New debug parameter sched-pressure-factor
  2014-10-23  3:37 [PATCH] New debug parameter sched-pressure-factor Maxim Kuvyrkov
@ 2014-10-24  4:12 ` Jeff Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2014-10-24  4:12 UTC (permalink / raw)
  To: Maxim Kuvyrkov, Vladimir Makarov; +Cc: GCC Patches, Richard Sandiford

On 10/22/14 21:35, Maxim Kuvyrkov wrote:
> Hi,
>
> For benchmarking and tuning of register-pressure scheduling I've made
> the following simple patch to adjust effective number of registers
> that scheduler has at its disposal.  Do you think this would be
> valuable for others to investigate performance problems or tune
> register-pressure scheduling?
>
> The parameter scales number of register by the given number of
> percent (the default is 100, which is the current status quo).  At
> value of 50 the scheduler attempt to use only half of available
> registers, while value of 200 will cause it to assume double the
> number of available registers (and, likely, cause a lot of spills).
While I like it as a tool for us as a tuning and debugging tool, I hate 
it as something we'd make available to our users.

I don't think we've ever had developer-only options, but this is 
precisely the kind of thing that would belong as a developer-only option 
IMHO.

jeff

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

end of thread, other threads:[~2014-10-24  3:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-23  3:37 [PATCH] New debug parameter sched-pressure-factor Maxim Kuvyrkov
2014-10-24  4:12 ` Jeff Law

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