public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Couple of debug dump improvements to scheduler (no code-gen changes)
@ 2019-08-29 17:02 Maxim Kuvyrkov
  2019-08-30  6:18 ` Jeff Law
  0 siblings, 1 reply; 3+ messages in thread
From: Maxim Kuvyrkov @ 2019-08-29 17:02 UTC (permalink / raw)
  To: GCC Patches

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

Hi,

The first patch adds ranking statistics for autoprefetcher heuristic.

The second one makes it easier to diff scheduler debug dumps by adding more context lines for diff at clock increments.

OK to commit?

--
Maxim Kuvyrkov
www.linaro.org



[-- Attachment #2: 0002-Add-missing-entry-for-rank_for_schedule-stats.patch --]
[-- Type: application/octet-stream, Size: 1903 bytes --]

From 8770052fbf3e585bb873354d265182affb9a7797 Mon Sep 17 00:00:00 2001
From: Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>
Date: Thu, 29 Aug 2019 15:24:37 +0000
Subject: [PATCH 2/3] Add missing entry for rank_for_schedule stats.

	* haifa-sched.c (enum rfs_decision, rfs_str): Add RFS_AUTOPREF.
	(rank_for_schedule): Use it.

Change-Id: I376841101c2528814adc37c76ea94cdf12095d72
---
 gcc/haifa-sched.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 1bb968776f40..51ea1cb1b80e 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -2540,7 +2540,7 @@ model_set_excess_costs (rtx_insn **insns, int count)
 enum rfs_decision {
   RFS_LIVE_RANGE_SHRINK1, RFS_LIVE_RANGE_SHRINK2,
   RFS_SCHED_GROUP, RFS_PRESSURE_DELAY, RFS_PRESSURE_TICK,
-  RFS_FEEDS_BACKTRACK_INSN, RFS_PRIORITY, RFS_SPECULATION,
+  RFS_FEEDS_BACKTRACK_INSN, RFS_PRIORITY, RFS_AUTOPREF, RFS_SPECULATION,
   RFS_SCHED_RANK, RFS_LAST_INSN, RFS_PRESSURE_INDEX,
   RFS_DEP_COUNT, RFS_TIE, RFS_FUSION, RFS_COST, RFS_N };
 
@@ -2548,7 +2548,7 @@ enum rfs_decision {
 static const char *rfs_str[RFS_N] = {
   "RFS_LIVE_RANGE_SHRINK1", "RFS_LIVE_RANGE_SHRINK2",
   "RFS_SCHED_GROUP", "RFS_PRESSURE_DELAY", "RFS_PRESSURE_TICK",
-  "RFS_FEEDS_BACKTRACK_INSN", "RFS_PRIORITY", "RFS_SPECULATION",
+  "RFS_FEEDS_BACKTRACK_INSN", "RFS_PRIORITY", "RFS_AUTOPREF", "RFS_SPECULATION",
   "RFS_SCHED_RANK", "RFS_LAST_INSN", "RFS_PRESSURE_INDEX",
   "RFS_DEP_COUNT", "RFS_TIE", "RFS_FUSION", "RFS_COST" };
 
@@ -2717,7 +2717,7 @@ rank_for_schedule (const void *x, const void *y)
     {
       int autopref = autopref_rank_for_schedule (tmp, tmp2);
       if (autopref != 0)
-	return autopref;
+	return rfs_result (RFS_AUTOPREF, autopref, tmp, tmp2);
     }
 
   /* Prefer speculative insn with greater dependencies weakness.  */
-- 
2.17.1


[-- Attachment #3: 0003-Improve-diff-ability-of-scheduler-logs.patch --]
[-- Type: application/octet-stream, Size: 1053 bytes --]

From ecacfc96c044d91fa6a2fccbd4e6068fd24ddfe6 Mon Sep 17 00:00:00 2001
From: Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>
Date: Thu, 29 Aug 2019 15:27:30 +0000
Subject: [PATCH 3/3] Improve diff-ability of scheduler logs

	* haifa-sched.c (advance_one_cycle): Output more context-synchronization
	lines for diff.

Change-Id: I7de4ca32a2063ed6c063eb2e5171d81a6362db61
---
 gcc/haifa-sched.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 51ea1cb1b80e..8ad3d53c2c43 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -3157,9 +3157,11 @@ advance_state (state_t state)
 HAIFA_INLINE static void
 advance_one_cycle (void)
 {
+  int i;
+
   advance_state (curr_state);
-  if (sched_verbose >= 4)
-    fprintf (sched_dump, ";;\tAdvance the current state.\n");
+  for (i = 4; i <= sched_verbose; ++i)
+    fprintf (sched_dump, ";;\tAdvance the current state: %d.\n", clock_var);
 }
 
 /* Update register pressure after scheduling INSN.  */
-- 
2.17.1


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

* Re: [PATCH] Couple of debug dump improvements to scheduler (no code-gen changes)
  2019-08-29 17:02 [PATCH] Couple of debug dump improvements to scheduler (no code-gen changes) Maxim Kuvyrkov
@ 2019-08-30  6:18 ` Jeff Law
  2021-08-17  9:46   ` Maxim Kuvyrkov
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Law @ 2019-08-30  6:18 UTC (permalink / raw)
  To: Maxim Kuvyrkov, GCC Patches

On 8/29/19 9:44 AM, Maxim Kuvyrkov wrote:
> Hi,
> 
> The first patch adds ranking statistics for autoprefetcher heuristic.
> 
> The second one makes it easier to diff scheduler debug dumps by adding more context lines for diff at clock increments.
> 
> OK to commit?
OK for both.
jeff

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

* Re: [PATCH] Couple of debug dump improvements to scheduler (no code-gen changes)
  2019-08-30  6:18 ` Jeff Law
@ 2021-08-17  9:46   ` Maxim Kuvyrkov
  0 siblings, 0 replies; 3+ messages in thread
From: Maxim Kuvyrkov @ 2021-08-17  9:46 UTC (permalink / raw)
  To: Jeff Law; +Cc: GCC Patches

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

Hi Jeff,

I've forgotten to commit these patches when they were approved 2 years
ago.  They still apply cleanly to the current mainline and I've retested
them (bootstrap+regtest) on aarch64-linux-gnu and arm-linux-gnueabihf with
no regressions.

I'll commit these shortly.

Regards,

On Fri, 30 Aug 2019 at 01:57, Jeff Law <law@redhat.com> wrote:

> On 8/29/19 9:44 AM, Maxim Kuvyrkov wrote:
> > Hi,
> >
> > The first patch adds ranking statistics for autoprefetcher heuristic.
> >
> > The second one makes it easier to diff scheduler debug dumps by adding
> more context lines for diff at clock increments.
> >
> > OK to commit?
> OK for both.
> jeff
>


-- 
Maxim Kuvyrkov
www.linaro.org

[-- Attachment #2: 0003-Improve-diff-ability-of-scheduler-logs.patch --]
[-- Type: application/octet-stream, Size: 1019 bytes --]

From 0517ef89bdaaa75805560ddfb1e7959590d0eed6 Mon Sep 17 00:00:00 2001
From: Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>
Date: Thu, 29 Aug 2019 15:27:30 +0000
Subject: [PATCH 3/3] Improve diff-ability of scheduler logs

	* haifa-sched.c (advance_one_cycle): Output more context-synchronization
	lines for diff.

Change-Id: I7de4ca32a2063ed6c063eb2e5171d81a6362db61
---
 gcc/haifa-sched.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index dac27fd7c29c..e14051f4c074 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -3155,9 +3155,11 @@ advance_state (state_t state)
 HAIFA_INLINE static void
 advance_one_cycle (void)
 {
+  int i;
+
   advance_state (curr_state);
-  if (sched_verbose >= 4)
-    fprintf (sched_dump, ";;\tAdvance the current state.\n");
+  for (i = 4; i <= sched_verbose; ++i)
+    fprintf (sched_dump, ";;\tAdvance the current state: %d.\n", clock_var);
 }
 
 /* Update register pressure after scheduling INSN.  */
-- 
2.25.1


[-- Attachment #3: 0002-Add-missing-entry-for-rank_for_schedule-stats.patch --]
[-- Type: application/octet-stream, Size: 1856 bytes --]

From 014f0a22f28ebb8f5c804a90ba0d93ea0a6de18b Mon Sep 17 00:00:00 2001
From: Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>
Date: Thu, 29 Aug 2019 15:24:37 +0000
Subject: [PATCH 2/3] Add missing entry for rank_for_schedule stats.

	* haifa-sched.c (enum rfs_decision, rfs_str): Add RFS_AUTOPREF.
	(rank_for_schedule): Use it.

Change-Id: I376841101c2528814adc37c76ea94cdf12095d72
---
 gcc/haifa-sched.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 5048dd4a5a32..dac27fd7c29c 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -2538,7 +2538,7 @@ model_set_excess_costs (rtx_insn **insns, int count)
 enum rfs_decision {
   RFS_LIVE_RANGE_SHRINK1, RFS_LIVE_RANGE_SHRINK2,
   RFS_SCHED_GROUP, RFS_PRESSURE_DELAY, RFS_PRESSURE_TICK,
-  RFS_FEEDS_BACKTRACK_INSN, RFS_PRIORITY, RFS_SPECULATION,
+  RFS_FEEDS_BACKTRACK_INSN, RFS_PRIORITY, RFS_AUTOPREF, RFS_SPECULATION,
   RFS_SCHED_RANK, RFS_LAST_INSN, RFS_PRESSURE_INDEX,
   RFS_DEP_COUNT, RFS_TIE, RFS_FUSION, RFS_COST, RFS_N };
 
@@ -2546,7 +2546,7 @@ enum rfs_decision {
 static const char *rfs_str[RFS_N] = {
   "RFS_LIVE_RANGE_SHRINK1", "RFS_LIVE_RANGE_SHRINK2",
   "RFS_SCHED_GROUP", "RFS_PRESSURE_DELAY", "RFS_PRESSURE_TICK",
-  "RFS_FEEDS_BACKTRACK_INSN", "RFS_PRIORITY", "RFS_SPECULATION",
+  "RFS_FEEDS_BACKTRACK_INSN", "RFS_PRIORITY", "RFS_AUTOPREF", "RFS_SPECULATION",
   "RFS_SCHED_RANK", "RFS_LAST_INSN", "RFS_PRESSURE_INDEX",
   "RFS_DEP_COUNT", "RFS_TIE", "RFS_FUSION", "RFS_COST" };
 
@@ -2715,7 +2715,7 @@ rank_for_schedule (const void *x, const void *y)
     {
       int autopref = autopref_rank_for_schedule (tmp, tmp2);
       if (autopref != 0)
-	return autopref;
+	return rfs_result (RFS_AUTOPREF, autopref, tmp, tmp2);
     }
 
   /* Prefer speculative insn with greater dependencies weakness.  */
-- 
2.25.1


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

end of thread, other threads:[~2021-08-17  9:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-29 17:02 [PATCH] Couple of debug dump improvements to scheduler (no code-gen changes) Maxim Kuvyrkov
2019-08-30  6:18 ` Jeff Law
2021-08-17  9:46   ` Maxim Kuvyrkov

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