Commit 8e7c5fdd by Richard Henderson Committed by Richard Henderson

tree-cfg.c (gimple_can_merge_blocks_p): Move label and loop latch tests earlier.

* tree-cfg.c (gimple_can_merge_blocks_p): Move label and
        loop latch tests earlier.

From-SVN: r151604
parent 07c358c6
2009-09-10 Richard Henderson <rth@redhat.com> 2009-09-10 Richard Henderson <rth@redhat.com>
* tree-cfg.c (gimple_can_merge_blocks_p): Move label and
loop latch tests earlier.
* gimple-iterator.c (gimple_find_edge_insert_loc): Insert * gimple-iterator.c (gimple_find_edge_insert_loc): Insert
before GIMPLE_RETURN, not after its predecessor; insert before GIMPLE_RETURN, not after its predecessor; insert
before GIMPLE_RESX. before GIMPLE_RESX.
......
...@@ -1354,6 +1354,24 @@ gimple_can_merge_blocks_p (basic_block a, basic_block b) ...@@ -1354,6 +1354,24 @@ gimple_can_merge_blocks_p (basic_block a, basic_block b)
&& DECL_NONLOCAL (gimple_label_label (stmt))) && DECL_NONLOCAL (gimple_label_label (stmt)))
return false; return false;
/* Examine the labels at the beginning of B. */
for (gsi = gsi_start_bb (b); !gsi_end_p (gsi); gsi_next (&gsi))
{
tree lab;
stmt = gsi_stmt (gsi);
if (gimple_code (stmt) != GIMPLE_LABEL)
break;
lab = gimple_label_label (stmt);
/* Do not remove user labels. */
if (!DECL_ARTIFICIAL (lab))
return false;
}
/* Protect the loop latches. */
if (current_loops && b->loop_father->latch == b)
return false;
/* It must be possible to eliminate all phi nodes in B. If ssa form /* It must be possible to eliminate all phi nodes in B. If ssa form
is not up-to-date, we cannot eliminate any phis; however, if only is not up-to-date, we cannot eliminate any phis; however, if only
some symbols as whole are marked for renaming, this is not a problem, some symbols as whole are marked for renaming, this is not a problem,
...@@ -1377,21 +1395,6 @@ gimple_can_merge_blocks_p (basic_block a, basic_block b) ...@@ -1377,21 +1395,6 @@ gimple_can_merge_blocks_p (basic_block a, basic_block b)
} }
} }
/* Do not remove user labels. */
for (gsi = gsi_start_bb (b); !gsi_end_p (gsi); gsi_next (&gsi))
{
stmt = gsi_stmt (gsi);
if (gimple_code (stmt) != GIMPLE_LABEL)
break;
if (!DECL_ARTIFICIAL (gimple_label_label (stmt)))
return false;
}
/* Protect the loop latches. */
if (current_loops
&& b->loop_father->latch == b)
return false;
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment