public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/PR98739-drop-profile-reproducibility-v2)] Consider time profilers only when -fprofile-reproducible=serial.
@ 2021-01-21  8:25 Martin Liska
  0 siblings, 0 replies; only message in thread
From: Martin Liska @ 2021-01-21  8:25 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:fb4bc6f4b4b106d38fbf710f87e128d26fc1b988

commit fb4bc6f4b4b106d38fbf710f87e128d26fc1b988
Author: Martin Liska <mliska@suse.cz>
Date:   Thu Jan 21 09:22:45 2021 +0100

    Consider time profilers only when -fprofile-reproducible=serial.
    
    gcc/ChangeLog:
    
            PR gcov-profile/98739
            * cgraphunit.c (expand_all_functions): Consider tp_first_run
            only when -fprofile-reproducible=serial.
    
    gcc/lto/ChangeLog:
    
            PR gcov-profile/98739
            * lto-partition.c (lto_balanced_map): Consider tp_first_run
            only when -fprofile-reproducible=serial.

Diff:
---
 gcc/cgraphunit.c        | 5 +++--
 gcc/lto/lto-partition.c | 3 ++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index b401f0817a3..042c03d819e 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -1961,8 +1961,9 @@ expand_all_functions (void)
       }
 
   /* First output functions with time profile in specified order.  */
-  qsort (tp_first_run_order, tp_first_run_order_pos,
-	 sizeof (cgraph_node *), tp_first_run_node_cmp);
+  if (flag_profile_reproducible == PROFILE_REPRODUCIBILITY_SERIAL)
+    qsort (tp_first_run_order, tp_first_run_order_pos,
+	   sizeof (cgraph_node *), tp_first_run_node_cmp);
   for (i = 0; i < tp_first_run_order_pos; i++)
     {
       node = tp_first_run_order[i];
diff --git a/gcc/lto/lto-partition.c b/gcc/lto/lto-partition.c
index 15761ac9eb5..f9e632776e6 100644
--- a/gcc/lto/lto-partition.c
+++ b/gcc/lto/lto-partition.c
@@ -509,7 +509,8 @@ lto_balanced_map (int n_lto_partitions, int max_partition_size)
      unit tends to import a lot of global trees defined there.  We should
      get better about minimizing the function bounday, but until that
      things works smoother if we order in source order.  */
-  order.qsort (tp_first_run_node_cmp);
+  if (flag_profile_reproducible == PROFILE_REPRODUCIBILITY_SERIAL)
+    order.qsort (tp_first_run_node_cmp);
   noreorder.qsort (node_cmp);
 
   if (dump_file)


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

only message in thread, other threads:[~2021-01-21  8:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-21  8:25 [gcc(refs/users/marxin/heads/PR98739-drop-profile-reproducibility-v2)] Consider time profilers only when -fprofile-reproducible=serial Martin Liska

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