Bug 94410 - 511.povray_r is 11% slower built at -O2 PGO+LTO than with GCC 9 and same options
Summary: 511.povray_r is 11% slower built at -O2 PGO+LTO than with GCC 9 and same options
Alias: None
Product: gcc
Classification: Unclassified
Component: gcov-profile (show other bugs)
Version: 10.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Blocks: spec
  Show dependency treegraph
Reported: 2020-03-30 17:53 UTC by Martin Jambor
Modified: 2020-05-25 18:48 UTC (History)
3 users (show)

See Also:
Host: x86_64-linux
Target: x86_64-linux
Known to work:
Known to fail:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Martin Jambor 2020-03-30 17:53:42 UTC
SPEC 2017 FPrate benchmark 511.povray_r runs 11 % slower on AMD Zen2
CPU and 10% slower on Intel Cascade Lake server CPU when built with
-O2 (generic march/tuning) and both PGO and LTO with trunk (revision
26b3e568a60) than when compiled with the same options with GCC 9.

Bisecting revealed that the slowdown was introduced with:

commit 2925cad2151842daa387950e62d989090e47c91d
Author: Jan Hubicka <hubicka@ucw.cz>
Date:   Thu Oct 3 17:08:21 2019 +0200

    params.def (PARAM_INLINE_HEURISTICS_HINT_PERCENT, [...]): 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.
    From-SVN: r276516

The revision just before it was even 9% and 7% faster than GCC 9 on
AMD and Intel respectively.
Comment 1 Martin Jambor 2020-03-30 17:58:22 UTC
PR94360 is another O2 PGO+LTO bug where the commit caused a slowdown.
Comment 2 Martin Jambor 2020-03-30 20:17:44 UTC
For the record, SPEC 2006 453.povray is similarly affected, the commit
makes it run 26% slower.