Successfully identified regression in *gcc* in CI configuration tcwg_bmk_llvm_tk1/llvm-release-arm-spec2k6-Os. So far, this commit has regressed CI configurations: - tcwg_bmk_llvm_tk1/llvm-release-arm-spec2k6-Os
Culprit: <cut> commit 0b92cf305dcf34387a8e2564e55ca8948df3b47a Author: Jan Hubicka hubicka@ucw.cz Date: Tue Oct 1 18:58:35 2019 +0200
invoke.texi (early-inlining-insns-O2): Document.
* doc/invoke.texi (early-inlining-insns-O2): Document. (early-inlining-insns): Update. * params.def (early-inlining-insns-O2): New bound. (early-inlining-insns): Update docs. * ipa-inline.c (want_early_inline_function_p): Use new bound.
* g++.dg/tree-ssa/pr61034.C: Set early-inlining-insns-O2=14. * g++.dg/tree-ssa/pr8781.C: Likewise. * g++.dg/warn/Wstringop-truncation-1.C: Likewise. * gcc.dg/ipa/pr63416.c: likewise. * gcc.dg/vect/pr66142.c: Likewise. * gcc.dg/tree-ssa/ssa-thread-12.c: Mark compure_idf inline.
From-SVN: r276416 </cut>
Results regressed to (for first_bad == 0b92cf305dcf34387a8e2564e55ca8948df3b47a) # reset_artifacts: -10 # build_abe binutils: -9 # build_abe stage1 -- --set gcc_override_configure=--with-mode=thumb --set gcc_override_configure=--disable-libsanitizer: -8 # build_abe linux: -7 # build_abe glibc: -6 # build_abe stage2 -- --set gcc_override_configure=--with-mode=thumb --set gcc_override_configure=--disable-libsanitizer: -5 # build_llvm true: -3 # true: 0 # benchmark -Os_mthumb -- artifacts/build-0b92cf305dcf34387a8e2564e55ca8948df3b47a/results_id: 1 # 447.dealII,[.] _ZSt18_Rb_tree_incrementPKSt18_Rb_tree_node_ba regressed by 1150
from (for last_good == 7552c36afa1f9058bb39f336ae84f019621885a0) # reset_artifacts: -10 # build_abe binutils: -9 # build_abe stage1 -- --set gcc_override_configure=--with-mode=thumb --set gcc_override_configure=--disable-libsanitizer: -8 # build_abe linux: -7 # build_abe glibc: -6 # build_abe stage2 -- --set gcc_override_configure=--with-mode=thumb --set gcc_override_configure=--disable-libsanitizer: -5 # build_llvm true: -3 # true: 0 # benchmark -Os_mthumb -- artifacts/build-7552c36afa1f9058bb39f336ae84f019621885a0/results_id: 1
Artifacts of last_good build: https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_tk1-llvm-release-... Results ID of last_good: tk1_32/tcwg_bmk_llvm_tk1/bisect-llvm-release-arm-spec2k6-Os/2301 Artifacts of first_bad build: https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_tk1-llvm-release-... Results ID of first_bad: tk1_32/tcwg_bmk_llvm_tk1/bisect-llvm-release-arm-spec2k6-Os/2288 Build top page/logs: https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_tk1-llvm-release-...
Configuration details:
Reproduce builds: <cut> mkdir investigate-gcc-0b92cf305dcf34387a8e2564e55ca8948df3b47a cd investigate-gcc-0b92cf305dcf34387a8e2564e55ca8948df3b47a
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_llvm-bisect-tcwg_bmk_tk1-llvm-release-... --fail curl -o artifacts/manifests/build-parameters.sh https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_tk1-llvm-release-... --fail curl -o artifacts/test.sh https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_tk1-llvm-release-... --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 0b92cf305dcf34387a8e2564e55ca8948df3b47a ../artifacts/test.sh
# Reproduce last_good build git checkout --detach 7552c36afa1f9058bb39f336ae84f019621885a0 ../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_llvm-bisect-tcwg_bmk_tk1-llvm-release-... Build log: https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_tk1-llvm-release-...
Full commit (up to 1000 lines): <cut> commit 0b92cf305dcf34387a8e2564e55ca8948df3b47a Author: Jan Hubicka hubicka@ucw.cz Date: Tue Oct 1 18:58:35 2019 +0200
invoke.texi (early-inlining-insns-O2): Document.
* doc/invoke.texi (early-inlining-insns-O2): Document. (early-inlining-insns): Update. * params.def (early-inlining-insns-O2): New bound. (early-inlining-insns): Update docs. * ipa-inline.c (want_early_inline_function_p): Use new bound.
* g++.dg/tree-ssa/pr61034.C: Set early-inlining-insns-O2=14. * g++.dg/tree-ssa/pr8781.C: Likewise. * g++.dg/warn/Wstringop-truncation-1.C: Likewise. * gcc.dg/ipa/pr63416.c: likewise. * gcc.dg/vect/pr66142.c: Likewise. * gcc.dg/tree-ssa/ssa-thread-12.c: Mark compure_idf inline.
From-SVN: r276416 --- gcc/ChangeLog | 8 ++++++++ gcc/doc/invoke.texi | 8 ++++++++ gcc/ipa-inline.c | 22 ++++++++++++++-------- gcc/params.def | 6 +++++- gcc/testsuite/ChangeLog | 9 +++++++++ gcc/testsuite/g++.dg/tree-ssa/pr61034.C | 2 +- gcc/testsuite/g++.dg/tree-ssa/pr8781.C | 2 +- gcc/testsuite/g++.dg/warn/Wstringop-truncation-1.C | 2 +- gcc/testsuite/gcc.dg/ipa/pr63416.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-thread-12.c | 2 +- gcc/testsuite/gcc.dg/vect/pr66142.c | 2 +- 11 files changed, 50 insertions(+), 15 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bb4de20ab16..b4c4292c299 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2019-10-01 Jan Hubicka hubicka@ucw.cz + + * doc/invoke.texi (early-inlining-insns-O2): Document. + (early-inlining-insns): Update. + * params.def (early-inlining-insns-O2): New bound. + (early-inlining-insns): Update docs. + * ipa-inline.c (want_early_inline_function_p): Use new bound. + 2019-10-01 Oleg Endo olegendo@gcc.gnu.org
PR target/88562 diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 83016a5a8ee..4281ee7c614 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -11291,9 +11291,17 @@ recursion depth can be guessed from the probability that function recurses via a given call expression. This parameter limits inlining only to call expressions whose probability exceeds the given threshold (in percents).
+@item early-inlining-insns-O2 +Specify growth that the early inliner can make. In effect it increases +the amount of inlining for code having a large abstraction penalty. +This is applied to functions compiled with @option{-O1} or @option{-O2} +optimization levels. + @item early-inlining-insns Specify growth that the early inliner can make. In effect it increases the amount of inlining for code having a large abstraction penalty. +This is applied to functions compiled with @option{-O3} or @option{-Ofast} +optimization levels.
@item max-early-inliner-iterations Limit of iterations of the early inliner. This basically bounds diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index b62d280eb25..c8689c7d9a8 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -641,6 +641,10 @@ want_early_inline_function_p (struct cgraph_edge *e) { int growth = estimate_edge_growth (e); int n; + int early_inlining_insns = opt_for_fn (e->caller->decl, optimize) >= 3 + ? PARAM_VALUE (PARAM_EARLY_INLINING_INSNS) + : PARAM_VALUE (PARAM_EARLY_INLINING_INSNS_O2); +
if (growth <= PARAM_VALUE (PARAM_MAX_INLINE_INSNS_SIZE)) ; @@ -654,26 +658,28 @@ want_early_inline_function_p (struct cgraph_edge *e) growth); want_inline = false; } - else if (growth > PARAM_VALUE (PARAM_EARLY_INLINING_INSNS)) + else if (growth > early_inlining_insns) { if (dump_enabled_p ()) dump_printf_loc (MSG_MISSED_OPTIMIZATION, e->call_stmt, " will not early inline: %C->%C, " - "growth %i exceeds --param early-inlining-insns\n", - e->caller, callee, - growth); + "growth %i exceeds --param early-inlining-insns%s\n", + e->caller, callee, growth, + opt_for_fn (e->caller->decl, optimize) >= 3 + ? "" : "-O2"); want_inline = false; } else if ((n = num_calls (callee)) != 0 - && growth * (n + 1) > PARAM_VALUE (PARAM_EARLY_INLINING_INSNS)) + && growth * (n + 1) > early_inlining_insns) { if (dump_enabled_p ()) dump_printf_loc (MSG_MISSED_OPTIMIZATION, e->call_stmt, " will not early inline: %C->%C, " - "growth %i exceeds --param early-inlining-insns " + "growth %i exceeds --param early-inlining-insns%s " "divided by number of calls\n", - e->caller, callee, - growth); + e->caller, callee, growth, + opt_for_fn (e->caller->decl, optimize) >= 3 + ? "" : "-O2"); want_inline = false; } } diff --git a/gcc/params.def b/gcc/params.def index d2d957fc6b1..0acf29b6c4d 100644 --- a/gcc/params.def +++ b/gcc/params.def @@ -233,8 +233,12 @@ DEFPARAM(PARAM_IPCP_UNIT_GROWTH, 10, 0, 0) DEFPARAM(PARAM_EARLY_INLINING_INSNS, "early-inlining-insns", - "Maximal estimated growth of function body caused by early inlining of single call.", + "Maximal estimated growth of function body caused by early inlining of single call with -O3 and -Ofast.", 14, 0, 0) +DEFPARAM(PARAM_EARLY_INLINING_INSNS_O2, + "early-inlining-insns-O2", + "Maximal estimated growth of function body caused by early inlining of single call with -O1 and -O2.", + 6, 0, 0) DEFPARAM(PARAM_LARGE_STACK_FRAME, "large-stack-frame", "The size of stack frame to be considered large.", diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index df6105f3d13..0dcaf4b6292 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2019-10-01 Jan Hubicka hubicka@ucw.cz + + * g++.dg/tree-ssa/pr61034.C: Set early-inlining-insns-O2=14. + * g++.dg/tree-ssa/pr8781.C: Likewise. + * g++.dg/warn/Wstringop-truncation-1.C: Likewise. + * gcc.dg/ipa/pr63416.c: likewise. + * gcc.dg/vect/pr66142.c: Likewise. + * gcc.dg/tree-ssa/ssa-thread-12.c: Mark compure_idf inline. + 2019-10-01 Jakub Jelinek jakub@redhat.com
PR c++/91925 diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr61034.C b/gcc/testsuite/g++.dg/tree-ssa/pr61034.C index 870b2372166..2e3dfecacb4 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/pr61034.C +++ b/gcc/testsuite/g++.dg/tree-ssa/pr61034.C @@ -1,5 +1,5 @@ // { dg-do compile } -// { dg-options "-O2 -fdump-tree-fre3 -fdump-tree-optimized -fdelete-null-pointer-checks" } +// { dg-options "-O2 -fdump-tree-fre3 -fdump-tree-optimized -fdelete-null-pointer-checks --param early-inlining-insns-O2=14" }
#define assume(x) if(!(x))__builtin_unreachable()
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr8781.C b/gcc/testsuite/g++.dg/tree-ssa/pr8781.C index 1f115b2b26d..5bc1ef03520 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/pr8781.C +++ b/gcc/testsuite/g++.dg/tree-ssa/pr8781.C @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fno-tree-sra -fdump-tree-fre1" } */ +/* { dg-options "-O -fno-tree-sra -fdump-tree-fre1 --param early-inlining-insns-O2=14" } */
int f();
diff --git a/gcc/testsuite/g++.dg/warn/Wstringop-truncation-1.C b/gcc/testsuite/g++.dg/warn/Wstringop-truncation-1.C index 83066019772..49dde0a65ba 100644 --- a/gcc/testsuite/g++.dg/warn/Wstringop-truncation-1.C +++ b/gcc/testsuite/g++.dg/warn/Wstringop-truncation-1.C @@ -1,7 +1,7 @@ /* PR/tree-optimization/84480 - bogus -Wstringop-truncation despite assignment with an inlined string literal { dg-do compile } - { dg-options "-O2 -Wstringop-truncation" } */ + { dg-options "-O2 -Wstringop-truncation --param early-inlining-insns-O2=14" } */
#include <string.h>
diff --git a/gcc/testsuite/gcc.dg/ipa/pr63416.c b/gcc/testsuite/gcc.dg/ipa/pr63416.c index b5374c51fe9..5873954fba3 100644 --- a/gcc/testsuite/gcc.dg/ipa/pr63416.c +++ b/gcc/testsuite/gcc.dg/ipa/pr63416.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fdump-tree-optimized --param early-inlining-insns-O2=14" } */ #define _UNUSED_ __attribute__((__unused__))
typedef int TEST_F30 (int *v); diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-thread-12.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-thread-12.c index 67526762f2c..216de23d791 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-thread-12.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-thread-12.c @@ -56,7 +56,7 @@ bmp_iter_and_compl (bitmap_iterator * bi, unsigned *bit_no) }
extern int VEC_int_base_length (VEC_int_base *); -bitmap +inline bitmap compute_idf (bitmap def_blocks, bitmap_head * dfs) { bitmap_iterator bi; diff --git a/gcc/testsuite/gcc.dg/vect/pr66142.c b/gcc/testsuite/gcc.dg/vect/pr66142.c index 8c79f290767..a0316f1f01e 100644 --- a/gcc/testsuite/gcc.dg/vect/pr66142.c +++ b/gcc/testsuite/gcc.dg/vect/pr66142.c @@ -1,6 +1,6 @@ /* PR middle-end/66142 */ /* { dg-do compile } */ -/* { dg-additional-options "-ffast-math -fopenmp-simd" } */ +/* { dg-additional-options "-ffast-math -fopenmp-simd --param early-inlining-insns-O2=14" } */ /* { dg-additional-options "-mavx" { target avx_runtime } } */
struct A { float x, y; }; </cut>