From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8C7FC39450C2; Mon, 6 Apr 2020 16:31:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8C7FC39450C2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1586190702; bh=Ws1DPyOrzTdb/u7ucmLI+KBXpBUWb2W7KVZHSeAHAyU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Lf1dF2o3VeBmUuLuZvBFZoVoZPS43yP4eDLveylkyl2YJUvNQWItrTOmXmQLbl+mm ka+/imnJBQYNKTZxgo/+hGkXhAoNCOxEXqFErLYZyuUGuG6S74LJ6/Y978OOeY1KtL hFr7Zf/6WYanZ21r8QTagNRAVMbhAYDhXYNYD48c= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/94497] Branchless clamp in the general case gets a branch in a particular case ? Date: Mon, 06 Apr 2020 16:31:42 +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: 10.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_gcctarget 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2020 16:31:42 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94497 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Target| |x86_64-*-* i?86-*-* --- Comment #6 from Richard Biener --- (In reply to Hadrien Grasland from comment #5) > Thanks for the clarifications! We could probably live with > -fno-signed-zeros, but I think -ffinite-math-only would be too much as an > application-wide flag, as I've spotted several occurences of the "do the > computation, then check if the result is normal" pattern around... >=20 > I tried to experiment with #pragma optimize as a finer-grained alternative > to a global fast-math flag, which would probably be acceptable. But that > seemed to have the side-effect of preventing inlining of the functions to > which the attributes are applied into other functions that don't have it = (I > guess that attribute is implemented by splitting the code into multiple > compilation units?), whereas in this part of the codebase we want all the > inlining we can get... Yeah, since the #pragma optimize works at a function level we cannot permit inlining of functions with conflicting settings... > So since I don't have the skills and time to work on GCC myself, I guess I > will need to wait for now and see what you come up with. There's also the possibility to use XMM intrinsics or simply fmin()/fmax() (but the latter is only optimized for targets implementing fmin/fmax expand= ers which unfortunately x86 doesn't).=