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
Status: UNCONFIRMED
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
URL:
Keywords:
Depends on:
Blocks: spec
  Show dependency treegraph
 
Reported: 2020-03-30 17:53 UTC by Martin Jambor
Modified: 2023-01-18 17:52 UTC (History)
3 users (show)

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


Attachments

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.
    
            * 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.
    
    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.
Comment 3 Martin Jambor 2023-01-18 17:52:31 UTC
This is still the case, as can be seen on LNT (GCC 9 is the dot in the left bottom corner):

https://lnt.opensuse.org/db_default/v4/SPEC/graph?plot.0=690.467.0&plot.1=745.467.0&plot.2=777.467.0&plot.3=687.467.0&