public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] Preserve exit phis only in lcSSA form
@ 2007-07-24 23:54 Zdenek Dvorak
  2007-07-31 13:07 ` Diego Novillo
  0 siblings, 1 reply; 2+ messages in thread
From: Zdenek Dvorak @ 2007-07-24 23:54 UTC (permalink / raw)
  To: gcc-patches

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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] Preserve exit phis only in lcSSA form
  2007-07-24 23:54 [patch] Preserve exit phis only in lcSSA form Zdenek Dvorak
@ 2007-07-31 13:07 ` Diego Novillo
  0 siblings, 0 replies; 2+ messages in thread
From: Diego Novillo @ 2007-07-31 13:07 UTC (permalink / raw)
  To: Zdenek Dvorak; +Cc: gcc-patches

On 7/24/07 7:39 PM, Zdenek Dvorak wrote:

> 	* tree-cfg.c (tree_merge_blocks): Preserve loop exit phi nodes only
> 	in loop closed ssa.

OK.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-07-31 12:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-24 23:54 [patch] Preserve exit phis only in lcSSA form Zdenek Dvorak
2007-07-31 13:07 ` Diego Novillo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).