From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 661DF3858298; Tue, 28 Nov 2023 06:06:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 661DF3858298 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701151574; bh=4joHDI4X2RIor8wAcqBtMc95UuHOBo7ARKwHlVJHeow=; h=From:To:Subject:Date:In-Reply-To:References:From; b=h9+sJdcpr/VLNklWsSWH8a4HSphLEZNG/6O8YG6Zda21FmR1oSLn41mtgZLv5FeXo gAFqYvMBoyzQo5bAsR2qmyVJF+KfyPqatu00nFxxRLleLhN+yuEUdsKuWMoiqw4fm/ GrDTtNnJtkO+ZHaxYsteiEQzjbHa69WcFRUXQBzo= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/52252] An opportunity for x86 gcc vectorizer (gain up to 3 times) Date: Tue, 28 Nov 2023 06:06:12 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 4.7.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia 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: cc 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=3D52252 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pinskia at gcc dot gnu.org --- Comment #10 from Andrew Pinski --- Note there is also a missing scalar optimization here also (which will impr= ove the vectorized version in the end too). Right now we have the following match pattern: /* MIN (~X, ~Y) -> ~MAX (X, Y) MAX (~X, ~Y) -> ~MIN (X, Y) */ (for minmax (min max) maxmin (max min) (simplify (minmax (bit_not:s@2 @0) (bit_not:s@3 @1)) (bit_not (maxmin @0 @1))) But that does not match here due to the :s. I am not 100% sure but trading 2 possible bit_not for adding another might end up improving things ...=