From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14826 invoked by alias); 20 Jan 2015 22:01:08 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 14801 invoked by uid 48); 20 Jan 2015 22:01:04 -0000 From: "law at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/64700] New: Sink common code through PHI Date: Tue, 20 Jan 2015 22:01:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: law at redhat dot com X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-01/txt/msg02129.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64700 Bug ID: 64700 Summary: Sink common code through PHI Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: law at redhat dot com Created attachment 34507 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34507&action=edit Testcode Originally from BZ 64081.... We do miss some interesting kind of optimization opportunities like transforming if (prephitmp_87 == 1) goto ; else goto ; : _24 = arr1.5_23 + _62; pos.6_25 = *_24; goto ; : _28 = arr2.7_27 + _62; pos.8_29 = *_28; : # prephitmp_89 = PHI to if (prephitmp_87 == 1) goto ; else goto ; : goto ; : # _24 = PHI _28 = _24 + _62; prephitmp_89 = *_28; sinking common computations through a PHI. With the followup optimization in out-of-SSA to coalesce arr1.5_23 and arr2.7_27 which means we can drop the conditional entirely.