On Wed, Jan 20, 2021 at 12:04 PM Martin Liška <[email protected]> wrote:
>
> Hello.
>
> For GCC 11 I've made a change in a way how we track TOP N counters:
> - dynamic allocation is used for key value pairs
> - up to 32 values are tracked in parallel
> - the counters are allocated dynamically and don't occupy so much space
> in BSS executable
>
> Having that we can track more values and the risk of not reproducibility is
> smaller.
> Apart from that, there's apparently no user (except Honza's Firefox
> experiments)
> of the option as showed in the PR (the option changing does not work).
>
> That said, I tend to remove the option.
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
The option was present on the GCC 10 branch as well so I fear we can't
simply remove it. So can you leave it as the usual Ignore entry in common.opt?
Otherwise OK, but I guess the issue can still pop up so I'm not sure whether
this is the correct thing to do. Did the option implementation not work?
Richard.
> Thanks,
> Martin
>
> 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.
> ---
> 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,
> --
> 2.30.0
>