public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/110832] [14 Regression] 14% capacita -O2 regression between g:9fdbd7d6fa5e0a76 (2023-07-26 01:45) and g:ca912a39cccdd990 (2023-07-27 03:44) on zen3 and core
Date: Fri, 28 Jul 2023 15:46:29 +0000	[thread overview]
Message-ID: <bug-110832-4-euA5QofY4M@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110832-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #8 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Richard Biener from comment #6)
> Do we know whether we could in theory improve the sanitizing by optimization
> without -funsafe-math-optimizations (I think -fno-trapping-math,
> -ffinite-math-only -fno-signalling-nans should be a better guard?)?

Regarding the sanitizing, we can remove all sanitizing MOVQ instructions
between trapping instructions (IOW, the result of ADDPS is guaranteed to have
zeros in the high part outside V2SF, so MOVQ is unnecessary in front of a
follow-up MULPS).

I think that some instruction back-walking pass on the RTL insn stream would be
able to identify these unnecessary instructions and remove them.

Also, as mentioned elsewhere, it is really hard to get non-zero value to the
highpart of XMM register. The compiler takes great care to always load values
via MOVQ, so one has to craft a special code that works around all these
fences. OTOH, in two years since gcc-11 was released with the V2SF support, not
a single PR involving spurious exceptions was reported. Even capacita benchmark
enables:

Note: The following floating-point exceptions are signalling:
IEEE_UNDERFLOW_FLAG IEEE_DENORMAL

without problems.

As an example here, it looks that polyhedron capacita greatly benefits from
V2SF vectors, and I was surprised that sanitizing MOVQ has such an effect here.

  parent reply	other threads:[~2023-07-28 15:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-27 17:27 [Bug middle-end/110832] New: " hubicka at gcc dot gnu.org
2023-07-27 17:28 ` [Bug middle-end/110832] " hubicka at gcc dot gnu.org
2023-07-27 18:35 ` hubicka at ucw dot cz
2023-07-28  6:21 ` rguenth at gcc dot gnu.org
2023-07-28  6:21 ` [Bug middle-end/110832] [14 Regression] " rguenth at gcc dot gnu.org
2023-07-28 12:30 ` ubizjak at gmail dot com
2023-07-28 12:36 ` ubizjak at gmail dot com
2023-07-28 13:28 ` rguenth at gcc dot gnu.org
2023-07-28 13:41 ` ubizjak at gmail dot com
2023-07-28 15:46 ` ubizjak at gmail dot com [this message]
2023-07-31  4:58 ` crazylht at gmail dot com
2023-07-31  7:54 ` ubizjak at gmail dot com
2023-08-08 16:56 ` cvs-commit at gcc dot gnu.org
2023-08-09  9:46 ` ubizjak at gmail dot com
2023-08-10  6:06 ` cvs-commit at gcc dot gnu.org
2023-08-25  8:59 ` ubizjak at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-110832-4-euA5QofY4M@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).