This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] Preserve exit phis only in lcSSA form
- From: Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 25 Jul 2007 01:39:44 +0200
- Subject: [patch] Preserve exit phis only in lcSSA form
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)