From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10318 invoked by alias); 24 Jul 2007 23:39:48 -0000 Received: (qmail 10308 invoked by uid 22791); 24 Jul 2007 23:39:48 -0000 X-Spam-Check-By: sourceware.org Received: from nikam-dmz.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 24 Jul 2007 23:39:46 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 29025) id 48CF25B9C3; Wed, 25 Jul 2007 01:39:44 +0200 (CEST) Date: Tue, 24 Jul 2007 23:54:00 -0000 From: Zdenek Dvorak To: gcc-patches@gcc.gnu.org Subject: [patch] Preserve exit phis only in lcSSA form Message-ID: <20070724233944.GA29854@kam.mff.cuni.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.9i Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2007-07/txt/msg01785.txt.bz2 Hello, in order to preserve loop closed ssa form, we avoid removing phi nodes from exit edges of loops in tree_merge_blocks. However, we do this whenever the information about loops is available, regardless of whether we actually maintain lcSSA or not. This patch makes us protect loop exit phi nodes only if we are in lcSSA. Bootstrapped & regtested on ia64. Zdenek * tree-cfg.c (tree_merge_blocks): Preserve loop exit phi nodes only in loop closed ssa. Index: tree-cfg.c =================================================================== *** tree-cfg.c (revision 126869) --- tree-cfg.c (working copy) *************** tree_merge_blocks (basic_block a, basic_ *** 1275,1283 **** tree copy; bool may_replace_uses = may_propagate_copy (def, use); ! /* In case we have loops to care about, do not propagate arguments of ! loop closed ssa phi nodes. */ if (current_loops && is_gimple_reg (def) && TREE_CODE (use) == SSA_NAME && a->loop_father != b->loop_father) --- 1280,1289 ---- tree copy; bool may_replace_uses = may_propagate_copy (def, use); ! /* In case we maintain loop closed ssa form, do not propagate arguments ! of loop exit phi nodes. */ if (current_loops + && (current_loops->state & LOOP_CLOSED_SSA) && is_gimple_reg (def) && TREE_CODE (use) == SSA_NAME && a->loop_father != b->loop_father)