https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94472
Bug ID: 94472 Summary: 400.perlbench is slower when compiled at -O2 with both PGO and LTO on AMD Zen CPUs Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: gcov-profile Assignee: unassigned at gcc dot gnu.org Reporter: jamborm at gcc dot gnu.org CC: hubicka at gcc dot gnu.org, marxin at gcc dot gnu.org Blocks: 26163 Target Milestone: --- Host: x86_64-linux Target: x86_64-linux 400.perlbench is slower when compiled at -O2 (and generic march/mtune) with both PGO and LTO when compiled with master (26b3e568a60) than when built with GCC 9, on Zen2 by 13% and on Zen1 by 7%. The performance is comparable on Intel Cascade Lake server CPU. I attempted bisecting the problems on the Zen2 CPU but was only partially successful because a lot of the slowdown seemed to have happened gradually. The first bigger slowdown - almost 4% - came with: 562d1e9556777988ae46c5d1357af2636bc272ea is the first bad commit commit 562d1e9556777988ae46c5d1357af2636bc272ea Author: Jan Hubicka <hubi...@gcc.gnu.org> Date: Wed Oct 2 16:01:47 2019 +0000 cif-code.def (MAX_INLINE_INSNS_SINGLE_O2_LIMIT, [...]): New. * cif-code.def (MAX_INLINE_INSNS_SINGLE_O2_LIMIT, MAX_INLINE_INSNS_AUTO_O2_LIMIT): New. ... From-SVN: r276469 About the same performance loss was then introduced by: commit 2925cad2151842daa387950e62d989090e47c91d Author: Jan Hubicka <hubi...@ucw.cz> Date: Thu Oct 3 17:08:21 2019 +0200 params.def (PARAM_INLINE_HEURISTICS_HINT_PERCENT, [...]): New. * params.def (PARAM_INLINE_HEURISTICS_HINT_PERCENT, PARAM_INLINE_HEURISTICS_HINT_PERCENT_O2): New. * doc/invoke.texi (inline-heuristics-hint-percent, inline-heuristics-hint-percent-O2): Document. * tree-inline.c (inline_insns_single, inline_insns_auto): Add new hint attribute. (can_inline_edge_by_limits_p): Use it. And finally throughout March the benchmark is quite jumpy but finally ended again ended up about 5% slower than at the beginning of the month. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26163 [Bug 26163] [meta-bug] missed optimization in SPEC (2k17, 2k and 2k6 and 95)