public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/PR98739-drop-profile-reproducibility)] Drop profile reproducibility flag as it is not used.
@ 2021-01-20 16:18 Martin Liska
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Liska @ 2021-01-20 16:18 UTC (permalink / raw)
  To: gcc-cvs

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

commit ffbd2fe90dd3bfceecfeefb679572ca2f6b5f333
Author: Martin Liska <mliska@suse.cz>
Date:   Tue Jan 19 15:43:31 2021 +0100

    Drop profile reproducibility flag as it is not used.
    
    gcc/ChangeLog:
    
            PR gcov-profile/98739
            * common.opt: Drop -fprofile-reproducibility flag.
            * coretypes.h (enum profile_reproducibility): Drop the enum.
            * doc/invoke.texi: Remove documentation.
            * value-prof.c (get_nth_most_common_value): Drop usage of
            flag_profile_reproducible.

Diff:
---
 gcc/common.opt      | 16 ++--------------
 gcc/coretypes.h     |  7 -------
 gcc/doc/invoke.texi | 30 ------------------------------
 gcc/value-prof.c    | 15 +++------------
 4 files changed, 5 insertions(+), 63 deletions(-)

diff --git a/gcc/common.opt b/gcc/common.opt
index bde1711870d..863e9681aea 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -2236,21 +2236,9 @@ fprofile-exclude-files=
 Common Joined RejectNegative Var(flag_profile_exclude_files)
 Instrument only functions from files whose name does not match any of the regular expressions (separated by semi-colons).
 
-Enum
-Name(profile_reproducibility) Type(enum profile_reproducibility) UnknownError(unknown profile reproducibility method %qs)
-
-EnumValue
-Enum(profile_reproducibility) String(serial) Value(PROFILE_REPRODUCIBILITY_SERIAL)
-
-EnumValue
-Enum(profile_reproducibility) String(parallel-runs) Value(PROFILE_REPRODUCIBILITY_PARALLEL_RUNS)
-
-EnumValue
-Enum(profile_reproducibility) String(multithreaded) Value(PROFILE_REPRODUCIBILITY_MULTITHREADED)
-
 fprofile-reproducible
-Common Joined RejectNegative Var(flag_profile_reproducible) Enum(profile_reproducibility) Init(PROFILE_REPRODUCIBILITY_SERIAL)
--fprofile-reproducible=[serial|parallel-runs|multithreaded]	Control level of reproducibility of profile gathered by -fprofile-generate.
+Common Ignore Joined RejectNegative
+Does nothing. Preserved for backward compatibility.
 
 Enum
 Name(profile_update) Type(enum profile_update) UnknownError(unknown profile update method %qs)
diff --git a/gcc/coretypes.h b/gcc/coretypes.h
index 406572e947d..3a67061a483 100644
--- a/gcc/coretypes.h
+++ b/gcc/coretypes.h
@@ -212,13 +212,6 @@ enum profile_update {
   PROFILE_UPDATE_PREFER_ATOMIC
 };
 
-/* Type of profile reproducibility methods.  */
-enum profile_reproducibility {
-    PROFILE_REPRODUCIBILITY_SERIAL,
-    PROFILE_REPRODUCIBILITY_PARALLEL_RUNS,
-    PROFILE_REPRODUCIBILITY_MULTITHREADED
-};
-
 /* Type of -fstack-protector-*.  */
 enum stack_protector {
   SPCT_FLAG_DEFAULT = 1,
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 5f4a06625eb..c66ba2a62ad 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -582,7 +582,6 @@ Objective-C and Objective-C++ Dialects}.
 -fprofile-note=@var{path} -fprofile-prefix-path=@var{path} @gol
 -fprofile-update=@var{method} -fprofile-filter-files=@var{regex} @gol
 -fprofile-exclude-files=@var{regex} @gol
--fprofile-reproducible=@r{[}multithreaded@r{|}parallel-runs@r{|}serial@r{]} @gol
 -fsanitize=@var{style}  -fsanitize-recover  -fsanitize-recover=@var{style} @gol
 -fasan-shadow-offset=@var{number}  -fsanitize-sections=@var{s1},@var{s2},... @gol
 -fsanitize-undefined-trap-on-error  -fbounds-check @gol
@@ -14640,35 +14639,6 @@ any of the regular expressions (separated by semi-colons).
 For example, @option{-fprofile-exclude-files=/usr/.*} will prevent instrumentation
 of all files that are located in the @file{/usr/} folder.
 
-@item -fprofile-reproducible=@r{[}multithreaded@r{|}parallel-runs@r{|}serial@r{]}
-@opindex fprofile-reproducible
-Control level of reproducibility of profile gathered by
-@code{-fprofile-generate}.  This makes it possible to rebuild program
-with same outcome which is useful, for example, for distribution
-packages.
-
-With @option{-fprofile-reproducible=serial} the profile gathered by
-@option{-fprofile-generate} is reproducible provided the trained program
-behaves the same at each invocation of the train run, it is not
-multi-threaded and profile data streaming is always done in the same
-order.  Note that profile streaming happens at the end of program run but
-also before @code{fork} function is invoked.
-
-Note that it is quite common that execution counts of some part of
-programs depends, for example, on length of temporary file names or
-memory space randomization (that may affect hash-table collision rate).
-Such non-reproducible part of programs may be annotated by
-@code{no_instrument_function} function attribute. @command{gcov-dump} with
-@option{-l} can be used to dump gathered data and verify that they are
-indeed reproducible.
-
-With @option{-fprofile-reproducible=parallel-runs} collected profile
-stays reproducible regardless the order of streaming of the data into
-gcda files.  This setting makes it possible to run multiple instances of
-instrumented program in parallel (such as with @code{make -j}). This
-reduces quality of gathered data, in particular of indirect call
-profiling.
-
 @item -fsanitize=address
 @opindex fsanitize=address
 Enable AddressSanitizer, a fast memory error detector.
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index 4c916f4994f..1b174006941 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -745,13 +745,10 @@ gimple_divmod_fixed_value (gassign *stmt, tree value, profile_probability prob,
 
    Counters have the following meaning.
 
-   abs (counters[0]) is the number of executions
+   counters[0] is the number of executions
    for i in 0 ... TOPN-1
      counters[2 * i + 1] is target
-     abs (counters[2 * i + 2]) is corresponding hitrate counter.
-
-   Value of counters[0] negative when counter became
-   full during merging and some values are lost.  */
+     counters[2 * i + 2] is corresponding hitrate counter.  */
 
 bool
 get_nth_most_common_value (gimple *stmt, const char *counter_type,
@@ -765,17 +762,11 @@ get_nth_most_common_value (gimple *stmt, const char *counter_type,
   *count = 0;
   *value = 0;
 
-  gcov_type read_all = abs_hwi (hist->hvalue.counters[0]);
+  gcov_type read_all = hist->hvalue.counters[0];
 
   gcov_type v = hist->hvalue.counters[2 * n + 2];
   gcov_type c = hist->hvalue.counters[2 * n + 3];
 
-  if (hist->hvalue.counters[0] < 0
-      && (flag_profile_reproducible == PROFILE_REPRODUCIBILITY_PARALLEL_RUNS
-	  || (flag_profile_reproducible
-	      == PROFILE_REPRODUCIBILITY_MULTITHREADED)))
-    return false;
-
   /* Indirect calls can't be verified.  */
   if (stmt
       && check_counter (stmt, counter_type, &c, &read_all,


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

* [gcc(refs/users/marxin/heads/PR98739-drop-profile-reproducibility)] Drop profile reproducibility flag as it is not used.
@ 2021-01-20 11:00 Martin Liska
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Liska @ 2021-01-20 11:00 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:1ec9b679f98b31ac0b319d0d4d727fb8aa83321c

commit 1ec9b679f98b31ac0b319d0d4d727fb8aa83321c
Author: Martin Liska <mliska@suse.cz>
Date:   Tue Jan 19 15:43:31 2021 +0100

    Drop profile reproducibility flag as it is not used.
    
    gcc/ChangeLog:
    
            PR gcov-profile/98739
            * common.opt: Drop -fprofile-reproducibility flag.
            * coretypes.h (enum profile_reproducibility): Drop the enum.
            * doc/invoke.texi: Remove documentation.
            * value-prof.c (get_nth_most_common_value): Drop usage of
            flag_profile_reproducible.

Diff:
---
 gcc/common.opt      | 16 ----------------
 gcc/coretypes.h     |  7 -------
 gcc/doc/invoke.texi | 30 ------------------------------
 gcc/value-prof.c    |  6 ------
 4 files changed, 59 deletions(-)

diff --git a/gcc/common.opt b/gcc/common.opt
index bde1711870d..89dc3129074 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -2236,22 +2236,6 @@ fprofile-exclude-files=
 Common Joined RejectNegative Var(flag_profile_exclude_files)
 Instrument only functions from files whose name does not match any of the regular expressions (separated by semi-colons).
 
-Enum
-Name(profile_reproducibility) Type(enum profile_reproducibility) UnknownError(unknown profile reproducibility method %qs)
-
-EnumValue
-Enum(profile_reproducibility) String(serial) Value(PROFILE_REPRODUCIBILITY_SERIAL)
-
-EnumValue
-Enum(profile_reproducibility) String(parallel-runs) Value(PROFILE_REPRODUCIBILITY_PARALLEL_RUNS)
-
-EnumValue
-Enum(profile_reproducibility) String(multithreaded) Value(PROFILE_REPRODUCIBILITY_MULTITHREADED)
-
-fprofile-reproducible
-Common Joined RejectNegative Var(flag_profile_reproducible) Enum(profile_reproducibility) Init(PROFILE_REPRODUCIBILITY_SERIAL)
--fprofile-reproducible=[serial|parallel-runs|multithreaded]	Control level of reproducibility of profile gathered by -fprofile-generate.
-
 Enum
 Name(profile_update) Type(enum profile_update) UnknownError(unknown profile update method %qs)
 
diff --git a/gcc/coretypes.h b/gcc/coretypes.h
index 406572e947d..3a67061a483 100644
--- a/gcc/coretypes.h
+++ b/gcc/coretypes.h
@@ -212,13 +212,6 @@ enum profile_update {
   PROFILE_UPDATE_PREFER_ATOMIC
 };
 
-/* Type of profile reproducibility methods.  */
-enum profile_reproducibility {
-    PROFILE_REPRODUCIBILITY_SERIAL,
-    PROFILE_REPRODUCIBILITY_PARALLEL_RUNS,
-    PROFILE_REPRODUCIBILITY_MULTITHREADED
-};
-
 /* Type of -fstack-protector-*.  */
 enum stack_protector {
   SPCT_FLAG_DEFAULT = 1,
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 5f4a06625eb..c66ba2a62ad 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -582,7 +582,6 @@ Objective-C and Objective-C++ Dialects}.
 -fprofile-note=@var{path} -fprofile-prefix-path=@var{path} @gol
 -fprofile-update=@var{method} -fprofile-filter-files=@var{regex} @gol
 -fprofile-exclude-files=@var{regex} @gol
--fprofile-reproducible=@r{[}multithreaded@r{|}parallel-runs@r{|}serial@r{]} @gol
 -fsanitize=@var{style}  -fsanitize-recover  -fsanitize-recover=@var{style} @gol
 -fasan-shadow-offset=@var{number}  -fsanitize-sections=@var{s1},@var{s2},... @gol
 -fsanitize-undefined-trap-on-error  -fbounds-check @gol
@@ -14640,35 +14639,6 @@ any of the regular expressions (separated by semi-colons).
 For example, @option{-fprofile-exclude-files=/usr/.*} will prevent instrumentation
 of all files that are located in the @file{/usr/} folder.
 
-@item -fprofile-reproducible=@r{[}multithreaded@r{|}parallel-runs@r{|}serial@r{]}
-@opindex fprofile-reproducible
-Control level of reproducibility of profile gathered by
-@code{-fprofile-generate}.  This makes it possible to rebuild program
-with same outcome which is useful, for example, for distribution
-packages.
-
-With @option{-fprofile-reproducible=serial} the profile gathered by
-@option{-fprofile-generate} is reproducible provided the trained program
-behaves the same at each invocation of the train run, it is not
-multi-threaded and profile data streaming is always done in the same
-order.  Note that profile streaming happens at the end of program run but
-also before @code{fork} function is invoked.
-
-Note that it is quite common that execution counts of some part of
-programs depends, for example, on length of temporary file names or
-memory space randomization (that may affect hash-table collision rate).
-Such non-reproducible part of programs may be annotated by
-@code{no_instrument_function} function attribute. @command{gcov-dump} with
-@option{-l} can be used to dump gathered data and verify that they are
-indeed reproducible.
-
-With @option{-fprofile-reproducible=parallel-runs} collected profile
-stays reproducible regardless the order of streaming of the data into
-gcda files.  This setting makes it possible to run multiple instances of
-instrumented program in parallel (such as with @code{make -j}). This
-reduces quality of gathered data, in particular of indirect call
-profiling.
-
 @item -fsanitize=address
 @opindex fsanitize=address
 Enable AddressSanitizer, a fast memory error detector.
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index 4c916f4994f..5c6d2048aff 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -770,12 +770,6 @@ get_nth_most_common_value (gimple *stmt, const char *counter_type,
   gcov_type v = hist->hvalue.counters[2 * n + 2];
   gcov_type c = hist->hvalue.counters[2 * n + 3];
 
-  if (hist->hvalue.counters[0] < 0
-      && (flag_profile_reproducible == PROFILE_REPRODUCIBILITY_PARALLEL_RUNS
-	  || (flag_profile_reproducible
-	      == PROFILE_REPRODUCIBILITY_MULTITHREADED)))
-    return false;
-
   /* Indirect calls can't be verified.  */
   if (stmt
       && check_counter (stmt, counter_type, &c, &read_all,


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

* [gcc(refs/users/marxin/heads/PR98739-drop-profile-reproducibility)] Drop profile reproducibility flag as it is not used.
@ 2021-01-19 14:43 Martin Liska
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Liska @ 2021-01-19 14:43 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:6a6d93654bc4f522eb33d96dee2a447f83d23f9a

commit 6a6d93654bc4f522eb33d96dee2a447f83d23f9a
Author: Martin Liska <mliska@suse.cz>
Date:   Tue Jan 19 15:43:31 2021 +0100

    Drop profile reproducibility flag as it is not used.

Diff:
---
 gcc/common.opt      | 16 ----------------
 gcc/coretypes.h     |  7 -------
 gcc/doc/invoke.texi | 30 ------------------------------
 gcc/value-prof.c    |  6 ------
 4 files changed, 59 deletions(-)

diff --git a/gcc/common.opt b/gcc/common.opt
index bde1711870d..89dc3129074 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -2236,22 +2236,6 @@ fprofile-exclude-files=
 Common Joined RejectNegative Var(flag_profile_exclude_files)
 Instrument only functions from files whose name does not match any of the regular expressions (separated by semi-colons).
 
-Enum
-Name(profile_reproducibility) Type(enum profile_reproducibility) UnknownError(unknown profile reproducibility method %qs)
-
-EnumValue
-Enum(profile_reproducibility) String(serial) Value(PROFILE_REPRODUCIBILITY_SERIAL)
-
-EnumValue
-Enum(profile_reproducibility) String(parallel-runs) Value(PROFILE_REPRODUCIBILITY_PARALLEL_RUNS)
-
-EnumValue
-Enum(profile_reproducibility) String(multithreaded) Value(PROFILE_REPRODUCIBILITY_MULTITHREADED)
-
-fprofile-reproducible
-Common Joined RejectNegative Var(flag_profile_reproducible) Enum(profile_reproducibility) Init(PROFILE_REPRODUCIBILITY_SERIAL)
--fprofile-reproducible=[serial|parallel-runs|multithreaded]	Control level of reproducibility of profile gathered by -fprofile-generate.
-
 Enum
 Name(profile_update) Type(enum profile_update) UnknownError(unknown profile update method %qs)
 
diff --git a/gcc/coretypes.h b/gcc/coretypes.h
index 406572e947d..3a67061a483 100644
--- a/gcc/coretypes.h
+++ b/gcc/coretypes.h
@@ -212,13 +212,6 @@ enum profile_update {
   PROFILE_UPDATE_PREFER_ATOMIC
 };
 
-/* Type of profile reproducibility methods.  */
-enum profile_reproducibility {
-    PROFILE_REPRODUCIBILITY_SERIAL,
-    PROFILE_REPRODUCIBILITY_PARALLEL_RUNS,
-    PROFILE_REPRODUCIBILITY_MULTITHREADED
-};
-
 /* Type of -fstack-protector-*.  */
 enum stack_protector {
   SPCT_FLAG_DEFAULT = 1,
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 5f4a06625eb..c66ba2a62ad 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -582,7 +582,6 @@ Objective-C and Objective-C++ Dialects}.
 -fprofile-note=@var{path} -fprofile-prefix-path=@var{path} @gol
 -fprofile-update=@var{method} -fprofile-filter-files=@var{regex} @gol
 -fprofile-exclude-files=@var{regex} @gol
--fprofile-reproducible=@r{[}multithreaded@r{|}parallel-runs@r{|}serial@r{]} @gol
 -fsanitize=@var{style}  -fsanitize-recover  -fsanitize-recover=@var{style} @gol
 -fasan-shadow-offset=@var{number}  -fsanitize-sections=@var{s1},@var{s2},... @gol
 -fsanitize-undefined-trap-on-error  -fbounds-check @gol
@@ -14640,35 +14639,6 @@ any of the regular expressions (separated by semi-colons).
 For example, @option{-fprofile-exclude-files=/usr/.*} will prevent instrumentation
 of all files that are located in the @file{/usr/} folder.
 
-@item -fprofile-reproducible=@r{[}multithreaded@r{|}parallel-runs@r{|}serial@r{]}
-@opindex fprofile-reproducible
-Control level of reproducibility of profile gathered by
-@code{-fprofile-generate}.  This makes it possible to rebuild program
-with same outcome which is useful, for example, for distribution
-packages.
-
-With @option{-fprofile-reproducible=serial} the profile gathered by
-@option{-fprofile-generate} is reproducible provided the trained program
-behaves the same at each invocation of the train run, it is not
-multi-threaded and profile data streaming is always done in the same
-order.  Note that profile streaming happens at the end of program run but
-also before @code{fork} function is invoked.
-
-Note that it is quite common that execution counts of some part of
-programs depends, for example, on length of temporary file names or
-memory space randomization (that may affect hash-table collision rate).
-Such non-reproducible part of programs may be annotated by
-@code{no_instrument_function} function attribute. @command{gcov-dump} with
-@option{-l} can be used to dump gathered data and verify that they are
-indeed reproducible.
-
-With @option{-fprofile-reproducible=parallel-runs} collected profile
-stays reproducible regardless the order of streaming of the data into
-gcda files.  This setting makes it possible to run multiple instances of
-instrumented program in parallel (such as with @code{make -j}). This
-reduces quality of gathered data, in particular of indirect call
-profiling.
-
 @item -fsanitize=address
 @opindex fsanitize=address
 Enable AddressSanitizer, a fast memory error detector.
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index 4c916f4994f..5c6d2048aff 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -770,12 +770,6 @@ get_nth_most_common_value (gimple *stmt, const char *counter_type,
   gcov_type v = hist->hvalue.counters[2 * n + 2];
   gcov_type c = hist->hvalue.counters[2 * n + 3];
 
-  if (hist->hvalue.counters[0] < 0
-      && (flag_profile_reproducible == PROFILE_REPRODUCIBILITY_PARALLEL_RUNS
-	  || (flag_profile_reproducible
-	      == PROFILE_REPRODUCIBILITY_MULTITHREADED)))
-    return false;
-
   /* Indirect calls can't be verified.  */
   if (stmt
       && check_counter (stmt, counter_type, &c, &read_all,


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

end of thread, other threads:[~2021-01-20 16:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20 16:18 [gcc(refs/users/marxin/heads/PR98739-drop-profile-reproducibility)] Drop profile reproducibility flag as it is not used Martin Liska
  -- strict thread matches above, loose matches on Subject: below --
2021-01-20 11:00 Martin Liska
2021-01-19 14:43 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).