summaryrefslogtreecommitdiff
path: root/gcc/tree-loop-distribution.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-09 15:01:41 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-09 15:01:41 +0000
commitb75ffad48663eafc66f35c7e278a478bd4be70c3 (patch)
treea7b73417ccd929f5b994bd6befec2692447a68f0 /gcc/tree-loop-distribution.c
parent3dbf161c7c078c4f979ae6e8df791bdcad8153fa (diff)
downloadgcc-b75ffad48663eafc66f35c7e278a478bd4be70c3.tar.gz
2010-11-09 Richard Guenther <rguenther@suse.de>
PR tree-optimization/46177 * tree-loop-distribution.c (prop_phis): Remove. (generate_builtin): Re-use the old loop exit edge to avoid needing to update PHI nodes. * gcc.dg/pr46177-2.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166492 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-loop-distribution.c')
-rw-r--r--gcc/tree-loop-distribution.c35
1 files changed, 6 insertions, 29 deletions
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index bc3f54d97d4..59585cdd761 100644
--- a/gcc/tree-loop-distribution.c
+++ b/gcc/tree-loop-distribution.c
@@ -311,31 +311,6 @@ generate_memset_zero (gimple stmt, tree op0, tree nb_iter,
return res;
}
-/* Propagate phis in BB b to their uses and remove them. */
-
-static void
-prop_phis (basic_block b)
-{
- gimple_stmt_iterator psi;
-
- for (psi = gsi_start_phis (b); !gsi_end_p (psi); )
- {
- gimple phi = gsi_stmt (psi);
- tree def = gimple_phi_result (phi);
-
- if (!is_gimple_reg (def))
- mark_virtual_phi_result_for_renaming (phi);
- else
- {
- tree use = gimple_phi_arg_def (phi, 0);
- gcc_assert (gimple_phi_num_args (phi) == 1);
- replace_uses_by (def, use);
- }
-
- remove_phi_node (&psi, true);
- }
-}
-
/* Tries to generate a builtin function for the instructions of LOOP
pointed to by the bits set in PARTITION. Returns true when the
operation succeeded. */
@@ -405,11 +380,13 @@ generate_builtin (struct loop *loop, bitmap partition, bool copy_p)
if (res && !copy_p)
{
unsigned nbbs = loop->num_nodes;
- basic_block src = loop_preheader_edge (loop)->src;
- basic_block dest = single_exit (loop)->dest;
- prop_phis (dest);
- make_edge (src, dest, EDGE_FALLTHRU);
+ edge exit = single_exit (loop);
+ basic_block src = loop_preheader_edge (loop)->src, dest = exit->dest;
+ redirect_edge_pred (exit, src);
+ exit->flags &= ~(EDGE_TRUE_VALUE|EDGE_FALSE_VALUE);
+ exit->flags |= EDGE_FALLTHRU;
cancel_loop_tree (loop);
+ rescan_loop_exit (exit, false, true);
for (i = 0; i < nbbs; i++)
delete_basic_block (bbs[i]);