From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 34E12398545D; Tue, 8 Jun 2021 23:09:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 34E12398545D From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/25290] PHI-OPT could be rewritten so that is uses match Date: Tue, 08 Jun 2021 23:09:32 +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.2.0 X-Bugzilla-Keywords: missed-optimization, patch 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 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: Tue, 08 Jun 2021 23:09:32 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D25290 --- Comment #22 from Andrew Pinski --- Without load/store handling, here are the following optimizations that eith= er can move to match.pd already or need some extra work to do it: * value_replacement: need to handle !single_non_singleton_phi_for_edges case and more than one feeder statement (2 max according to the current definiti= on) * cond_removal_in_popcount_clz_ctz_pattern: need 2 feeder statements and builtin call handling for feeder statements * two_value_replacement: recored as PR 100958, it can move already * abs_replacement: needs PROP_gimple_lswitch so we don't change if statemen= ts early enough ** I think majority of the abs handling is already in match.pd. * minmax_replacement: has some handling of comparisions which might not be = in the match.pd patterns already. needs PROP_gimple_lswitch also. ** The handling of: if (a <=3D u) b =3D MAX (a, d); x =3D PHI needs to moved too. For the ones which cannot move * factor_out_conditional_conversion: will never move, though it needs improvement and moved already (PR 56223 and PR 13563) * spaceship_replacement: cannot move to match.pd depends on use afterwards which is not hard to deal with in a match pattern.=