From patchwork Mon Aug 2 20:20:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Pop X-Patchwork-Id: 60660 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 9B77EB70B4 for ; Tue, 3 Aug 2010 06:29:53 +1000 (EST) Received: (qmail 4681 invoked by alias); 2 Aug 2010 20:25:18 -0000 Received: (qmail 4455 invoked by uid 22791); 2 Aug 2010 20:25:14 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, TW_SV, TW_TM, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-gx0-f175.google.com (HELO mail-gx0-f175.google.com) (209.85.161.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 02 Aug 2010 20:25:06 +0000 Received: by mail-gx0-f175.google.com with SMTP id 2so1547881gxk.20 for ; Mon, 02 Aug 2010 13:25:05 -0700 (PDT) Received: by 10.100.80.6 with SMTP id d6mr6929859anb.64.1280780705693; Mon, 02 Aug 2010 13:25:05 -0700 (PDT) Received: from napoca (cpe-70-120-196-107.austin.res.rr.com [70.120.196.107]) by mx.google.com with ESMTPS id q7sm10330737anf.26.2010.08.02.13.25.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 02 Aug 2010 13:25:05 -0700 (PDT) Received: by napoca (sSMTP sendmail emulation); Mon, 02 Aug 2010 15:25:02 -0500 From: Sebastian Pop To: gcc-patches@gcc.gnu.org Cc: Tobias Grosser , gcc-graphite Subject: [PATCH 65/65] Fix miscompile of 416.gamess. Date: Mon, 2 Aug 2010 15:20:38 -0500 Message-Id: <1280780438-17543-66-git-send-email-sebpop@gmail.com> In-Reply-To: <1280780438-17543-1-git-send-email-sebpop@gmail.com> References: <1280780438-17543-1-git-send-email-sebpop@gmail.com> X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org From: spop 2010-07-29 Sebastian Pop * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Add back the case removed in the previous patch, when the only phi argument is defined in the same loop as the phi node itself. Handle it separately from the invariant case by both propagating it outside the region and replacing the phi node with an assign. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162693 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 8 ++++++++ gcc/ChangeLog.graphite | 8 ++++++++ gcc/graphite-sese-to-poly.c | 10 ++++++++++ 3 files changed, 26 insertions(+), 0 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3e01871..e58ccb7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,13 @@ 2010-08-02 Sebastian Pop + * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Add back + the case removed in the previous patch, when the only phi argument + is defined in the same loop as the phi node itself. Handle it + separately from the invariant case by both propagating it outside + the region and replacing the phi node with an assign. + +2010-08-02 Sebastian Pop + * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): The only constant phi nodes with one argument are is_gimple_min_invariant and SSA_NAME_IS_DEFAULT_DEF. diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite index 1d3e64d..e43d2ce 100644 --- a/gcc/ChangeLog.graphite +++ b/gcc/ChangeLog.graphite @@ -1,3 +1,11 @@ +2010-07-29 Sebastian Pop + + * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Add back + the case removed in the previous patch, when the only phi argument + is defined in the same loop as the phi node itself. Handle it + separately from the invariant case by both propagating it outside + the region and replacing the phi node with an assign. + 2010-07-28 Sebastian Pop * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): The only diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c index 38e408c..4b94bcb 100644 --- a/gcc/graphite-sese-to-poly.c +++ b/gcc/graphite-sese-to-poly.c @@ -2249,6 +2249,16 @@ rewrite_close_phi_out_of_ssa (gimple_stmt_iterator *psi, sese region) return; } + else if (gimple_bb (SSA_NAME_DEF_STMT (arg))->loop_father == bb->loop_father) + { + propagate_expr_outside_region (res, arg, region); + stmt = gimple_build_assign (res, arg); + remove_phi_node (psi, false); + gsi_insert_before (&gsi, stmt, GSI_NEW_STMT); + SSA_NAME_DEF_STMT (res) = stmt; + return; + } + /* If res is scev analyzable and is not a scalar value, it is safe to ignore the close phi node: it will be code generated in the out of Graphite pass. */