From c9b2c56940d91eadec697cea19b1fa775fbe1fe9 Mon Sep 17 00:00:00 2001 From: rguenth Date: Wed, 16 Jan 2013 14:06:58 +0000 Subject: 2013-01-16 Richard Biener PR tree-optimization/55964 * tree-flow.h (rename_variables_in_loop): Remove. (rename_variables_in_bb): Likewise. * tree-loop-distribution.c (update_phis_for_loop_copy): Remove. (copy_loop_before): Adjust and delete update-ssa status. * tree-vect-loop-manip.c (rename_variables_in_bb): Make static. (rename_variables_in_bb): Likewise. Properly walk over predecessors. (rename_variables_in_loop): Remove. (slpeel_update_phis_for_duplicate_loop): Likewise. (slpeel_tree_duplicate_loop_to_edge_cfg): Handle nested loops, use available cfg machinery instead of duplicating it. Update PHI nodes and perform poor-mans SSA update here. (slpeel_tree_peel_loop_to_edge): Adjust. * gcc.dg/torture/pr55964.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195239 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-loop-distribution.c | 56 +------------------------------------------- 1 file changed, 1 insertion(+), 55 deletions(-) (limited to 'gcc/tree-loop-distribution.c') diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c index 93e98eba991..747b6ac6131 100644 --- a/gcc/tree-loop-distribution.c +++ b/gcc/tree-loop-distribution.c @@ -151,58 +151,6 @@ stmt_has_scalar_dependences_outside_loop (loop_p loop, gimple stmt) return false; } -/* Update the PHI nodes of NEW_LOOP. NEW_LOOP is a duplicate of - ORIG_LOOP. */ - -static void -update_phis_for_loop_copy (struct loop *orig_loop, struct loop *new_loop) -{ - tree new_ssa_name; - gimple_stmt_iterator si_new, si_orig; - edge orig_loop_latch = loop_latch_edge (orig_loop); - edge orig_entry_e = loop_preheader_edge (orig_loop); - edge new_loop_entry_e = loop_preheader_edge (new_loop); - - /* Scan the phis in the headers of the old and new loops - (they are organized in exactly the same order). */ - for (si_new = gsi_start_phis (new_loop->header), - si_orig = gsi_start_phis (orig_loop->header); - !gsi_end_p (si_new) && !gsi_end_p (si_orig); - gsi_next (&si_new), gsi_next (&si_orig)) - { - tree def; - source_location locus; - gimple phi_new = gsi_stmt (si_new); - gimple phi_orig = gsi_stmt (si_orig); - - /* Add the first phi argument for the phi in NEW_LOOP (the one - associated with the entry of NEW_LOOP) */ - def = PHI_ARG_DEF_FROM_EDGE (phi_orig, orig_entry_e); - locus = gimple_phi_arg_location_from_edge (phi_orig, orig_entry_e); - add_phi_arg (phi_new, def, new_loop_entry_e, locus); - - /* Add the second phi argument for the phi in NEW_LOOP (the one - associated with the latch of NEW_LOOP) */ - def = PHI_ARG_DEF_FROM_EDGE (phi_orig, orig_loop_latch); - locus = gimple_phi_arg_location_from_edge (phi_orig, orig_loop_latch); - - if (TREE_CODE (def) == SSA_NAME) - { - new_ssa_name = get_current_def (def); - - if (!new_ssa_name) - /* This only happens if there are no definitions inside the - loop. Use the the invariant in the new loop as is. */ - new_ssa_name = def; - } - else - /* Could be an integer. */ - new_ssa_name = def; - - add_phi_arg (phi_new, new_ssa_name, loop_latch_edge (new_loop), locus); - } -} - /* Return a copy of LOOP placed before LOOP. */ static struct loop * @@ -215,9 +163,7 @@ copy_loop_before (struct loop *loop) res = slpeel_tree_duplicate_loop_to_edge_cfg (loop, preheader); gcc_assert (res != NULL); free_original_copy_tables (); - - update_phis_for_loop_copy (loop, res); - rename_variables_in_loop (res); + delete_update_ssa (); return res; } -- cgit v1.2.3