public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/104466] New: Inlining functions with restrict parameters can inhibit lim (e.g. in 554.roms_r)
@ 2022-02-09 13:53 jamborm at gcc dot gnu.org
  2022-02-09 14:57 ` [Bug tree-optimization/104466] " jamborm at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: jamborm at gcc dot gnu.org @ 2022-02-09 13:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104466

            Bug ID: 104466
           Summary: Inlining functions with restrict parameters can
                    inhibit lim (e.g. in 554.roms_r)
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jamborm at gcc dot gnu.org
            Blocks: 26163
  Target Milestone: ---
              Host: x86_64-linux
            Target: x86_64-linux

We have noticed that a bit more performance can be squeezed out of
554.roms_r benchmark from the SPEC 2017 FPrate suite by using option
-fno-inline-functions-called-once, even at -O2 (but also at -Ofast).
At least one potential reason is that without inlining, loop invariant
motion is able to disambiguate memory references better because of
restrict qualified parameters.  When it cannot, it can be observed by
lim not taking place, at -O2 at least (which in turn affects other
passes).

I tried to create a small-ish reproducer and am attaching the result.
Compile with: -std=legacy -O2 --param max-inline-insns-auto=0 --param
max-inline-insns-single=0  

with and without -fno-inline-functions-called-once and look for lim of
a load from array n in the lim2 dump.


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)

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-05-06 11:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-09 13:53 [Bug tree-optimization/104466] New: Inlining functions with restrict parameters can inhibit lim (e.g. in 554.roms_r) jamborm at gcc dot gnu.org
2022-02-09 14:57 ` [Bug tree-optimization/104466] " jamborm at gcc dot gnu.org
2022-02-09 15:14 ` rguenth at gcc dot gnu.org
2022-02-09 18:53 ` pinskia at gcc dot gnu.org
2022-02-10  8:03 ` rguenth at gcc dot gnu.org
2022-02-10  8:16 ` rguenth at gcc dot gnu.org
2022-02-10  8:33 ` rguenth at gcc dot gnu.org
2022-02-10  9:55 ` cvs-commit at gcc dot gnu.org
2022-02-10  9:55 ` rguenth at gcc dot gnu.org
2022-05-06 11:37 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).