Successfully identified regression in *gcc* in CI configuration tcwg_bmk_gnu_tx1/gnu-release-aarch64-spec2k6-O2. So far, this commit has regressed CI configurations: - tcwg_bmk_gnu_tx1/gnu-release-aarch64-spec2k6-O2
Culprit: <cut> commit ea8dd3b6cea2a4d4dab7e2997b88a170f8093ce6 Author: Jan Hubicka jh@suse.cz Date: Tue Nov 19 19:56:26 2019 +0100
Avoid redundant computations in edge_badness.
* ipa-inline.c (inlining_speedup): New function. (edge_badness): Use it.
From-SVN: r278459 </cut>
Results regressed to (for first_bad == ea8dd3b6cea2a4d4dab7e2997b88a170f8093ce6) # reset_artifacts: -10 # build_abe binutils: -9 # build_abe stage1 -- --set gcc_override_configure=--disable-libsanitizer: -8 # build_abe linux: -7 # build_abe glibc: -6 # build_abe stage2 -- --set gcc_override_configure=--disable-libsanitizer: -5 # true: 0 # benchmark -- -O2 artifacts/build-ea8dd3b6cea2a4d4dab7e2997b88a170f8093ce6/results_id: 1 # 447.dealII,[.] _ZNK12SparseMatrixIdE5vmultI6VectorIdES3_EEvRT regressed by 116
from (for last_good == 4aa5fd8aca1140adf0917dc53397efddc7fd4c11) # reset_artifacts: -10 # build_abe binutils: -9 # build_abe stage1 -- --set gcc_override_configure=--disable-libsanitizer: -8 # build_abe linux: -7 # build_abe glibc: -6 # build_abe stage2 -- --set gcc_override_configure=--disable-libsanitizer: -5 # true: 0 # benchmark -- -O2 artifacts/build-4aa5fd8aca1140adf0917dc53397efddc7fd4c11/results_id: 1
Artifacts of last_good build: https://ci.linaro.org/job/tcwg_bmk_ci_gnu-bisect-tcwg_bmk_tx1-gnu-release-aa... Results ID of last_good: tx1_64/tcwg_bmk_gnu_tx1/bisect-gnu-release-aarch64-spec2k6-O2/3988 Artifacts of first_bad build: https://ci.linaro.org/job/tcwg_bmk_ci_gnu-bisect-tcwg_bmk_tx1-gnu-release-aa... Results ID of first_bad: tx1_64/tcwg_bmk_gnu_tx1/bisect-gnu-release-aarch64-spec2k6-O2/3979 Build top page/logs: https://ci.linaro.org/job/tcwg_bmk_ci_gnu-bisect-tcwg_bmk_tx1-gnu-release-aa...
Configuration details:
Reproduce builds: <cut> mkdir investigate-gcc-ea8dd3b6cea2a4d4dab7e2997b88a170f8093ce6 cd investigate-gcc-ea8dd3b6cea2a4d4dab7e2997b88a170f8093ce6
git clone https://git.linaro.org/toolchain/jenkins-scripts
mkdir -p artifacts/manifests curl -o artifacts/manifests/build-baseline.sh https://ci.linaro.org/job/tcwg_bmk_ci_gnu-bisect-tcwg_bmk_tx1-gnu-release-aa... --fail curl -o artifacts/manifests/build-parameters.sh https://ci.linaro.org/job/tcwg_bmk_ci_gnu-bisect-tcwg_bmk_tx1-gnu-release-aa... --fail curl -o artifacts/test.sh https://ci.linaro.org/job/tcwg_bmk_ci_gnu-bisect-tcwg_bmk_tx1-gnu-release-aa... --fail chmod +x artifacts/test.sh
# Reproduce the baseline build (build all pre-requisites) ./jenkins-scripts/tcwg_bmk-build.sh @@ artifacts/manifests/build-baseline.sh
# Save baseline build state (which is then restored in artifacts/test.sh) mkdir -p ./bisect rsync -a --del --delete-excluded --exclude /bisect/ --exclude /artifacts/ --exclude /gcc/ ./ ./bisect/baseline/
cd gcc
# Reproduce first_bad build git checkout --detach ea8dd3b6cea2a4d4dab7e2997b88a170f8093ce6 ../artifacts/test.sh
# Reproduce last_good build git checkout --detach 4aa5fd8aca1140adf0917dc53397efddc7fd4c11 ../artifacts/test.sh
cd .. </cut>
History of pending regressions and results: https://git.linaro.org/toolchain/ci/base-artifacts.git/log/?h=linaro-local/c...
Artifacts: https://ci.linaro.org/job/tcwg_bmk_ci_gnu-bisect-tcwg_bmk_tx1-gnu-release-aa... Build log: https://ci.linaro.org/job/tcwg_bmk_ci_gnu-bisect-tcwg_bmk_tx1-gnu-release-aa...
Full commit (up to 1000 lines): <cut> commit ea8dd3b6cea2a4d4dab7e2997b88a170f8093ce6 Author: Jan Hubicka jh@suse.cz Date: Tue Nov 19 19:56:26 2019 +0100
Avoid redundant computations in edge_badness.
* ipa-inline.c (inlining_speedup): New function. (edge_badness): Use it.
From-SVN: r278459 --- gcc/ChangeLog | 5 +++++ gcc/ipa-inline.c | 37 ++++++++++++++++++++++++++++++------- 2 files changed, 35 insertions(+), 7 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3516235f606..710f8dab674 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-11-18 Jan Hubicka jh@suse.cz + + * ipa-inline.c (inlining_speedup): New function. + (edge_badness): Use it. + 2019-11-19 Zoran Jovanovic zoran.jovanovic@mips.com Dragan Mladjenovic dmladjenovic@wavecomp.com
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 1f77ba25ce0..becea8a3e8e 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -768,6 +768,33 @@ compute_inlined_call_time (struct cgraph_edge *edge, return time; }
+/* Determine time saved by inlininig EDGE of frequency FREQ + where callee's runtime w/o inlineing is UNINLINED_TYPE + and with inlined is INLINED_TYPE. */ + +inline sreal +inlining_speedup (struct cgraph_edge *edge, + sreal freq, + sreal uninlined_time, + sreal inlined_time) +{ + sreal speedup = uninlined_time - inlined_time; + /* Handling of call_time should match one in ipa-inline-fnsummary.c + (estimate_edge_size_and_time). */ + sreal call_time = ipa_call_summaries->get (edge)->call_stmt_time; + + if (freq > 0) + { + speedup = (speedup + call_time); + if (freq != 1) + speedup = speedup * freq; + } + else if (freq == 0) + speedup = speedup >> 11; + gcc_checking_assert (speedup >= 0); + return speedup; +} + /* Return true if the speedup for inlining E is bigger than PARAM_MAX_INLINE_MIN_SPEEDUP. */
@@ -1149,10 +1176,8 @@ edge_badness (struct cgraph_edge *edge, bool dump) sreal numerator, denominator; int overall_growth; sreal freq = edge->sreal_frequency (); - sreal inlined_time = compute_inlined_call_time (edge, edge_time, freq);
- numerator = (compute_uninlined_call_time (edge, unspec_edge_time, freq) - - inlined_time); + numerator = inlining_speedup (edge, freq, unspec_edge_time, edge_time); if (numerator <= 0) numerator = ((sreal) 1 >> 8); if (caller->count.ipa ().nonzero_p ()) @@ -1235,16 +1260,14 @@ edge_badness (struct cgraph_edge *edge, bool dump) fprintf (dump_file, " %f: guessed profile. frequency %f, count %" PRId64 " caller count %" PRId64 - " time w/o inlining %f, time with inlining %f" + " time saved %f" " overall growth %i (current) %i (original)" " %i (compensated)\n", badness.to_double (), freq.to_double (), edge->count.ipa ().initialized_p () ? edge->count.ipa ().to_gcov_type () : -1, caller->count.ipa ().initialized_p () ? caller->count.ipa ().to_gcov_type () : -1, - compute_uninlined_call_time (edge, - unspec_edge_time, freq).to_double (), - inlined_time.to_double (), + inlining_speedup (edge, freq, unspec_edge_time, edge_time).to_double (), estimate_growth (callee), callee_info->growth, overall_growth); } </cut>
linaro-toolchain@lists.linaro.org