From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DE8CA3858D38; Mon, 10 Apr 2023 22:11:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DE8CA3858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681164669; bh=zaILYJf9DOneVAYmOwK2oul/hCQiRXadvxilukmAh5g=; h=From:To:Subject:Date:In-Reply-To:References:From; b=R5evQs+E1EdQYCpUGMn7SDSndQVxK+YtD4lg9HjiIcK/WLlruQ6SSgFfTbXrEnttq rFiYMIdkSnf7hOUfC/J0Jn/Sf6yAT+7dif9cSmRoy0tQ5g0Ki5ahV7TAqDRLWcD3gx /MQUOnNpo4DwBkW0wqMTldiHnd8CBhCU7YZVYljo= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/68894] Recognition min/max pattern with multiple arguments. Date: Mon, 10 Apr 2023 22:11:09 +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: 6.0 X-Bugzilla-Keywords: missed-optimization, TREE X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pinskia at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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=3D68894 --- Comment #9 from Andrew Pinski --- I have a patch which fixes the phiopt issue I saw. The problem is when do_hoist_loads is true (which is !early and -fhoist-adjacent-loads ), we would not do the diamond case for phiopt in la= ter passes. In the above case, pre needs to hoist the load first and then we could get = to it with phiopt4. You can see the same effect with: -O2 -fno-hoist-adjacent-loads -fno-tree-vectorize=