From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 63EF53858C50; Fri, 28 Jul 2023 15:46:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 63EF53858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1690559189; bh=Z3SB65qQw8cFio3GWXsf0pbaRhDgmNojzKn04msqN6o=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OUniBwcfloc4lielbiUHPe9+0cgV4QtSNjHEBOEVcj9KiwUYgGETznHZ2ghZ8pH4t OO6XliVMGWWiDtrFexUQi4YXziHbhMraVTVxTgV9dWnZBU6wi9SNfaLHn4ZBUfO1fV U8DwBtIWV0dYHbD5a4D4wrH3JBlgUS+XH4ScVYm4= From: "ubizjak at gmail dot com" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: missed-optimization, needs-bisection X-Bugzilla-Severity: normal X-Bugzilla-Who: ubizjak at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110832 --- Comment #8 from Uro=C5=A1 Bizjak --- (In reply to Richard Biener from comment #6) > Do we know whether we could in theory improve the sanitizing by optimizat= ion > 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 ha= ve 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 woul= d 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 valu= es 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 bench= mark 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 h= ere.=