]> gcc.gnu.org Git - gcc.git/commitdiff
tree-flow.h (copy_ssa_name_fn): New function.
authorRichard Guenther <rguenther@suse.de>
Tue, 7 Aug 2012 14:17:44 +0000 (14:17 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 7 Aug 2012 14:17:44 +0000 (14:17 +0000)
2012-08-07  Richard Guenther  <rguenther@suse.de>

* tree-flow.h (copy_ssa_name_fn): New function.
(duplicate_ssa_name_fn): Likewise.
* tree-flow-inline.h (copy_ssa_name): New function.
(duplicate_ssa_name): Likewise.
* tree-ssanames.c (copy_ssa_name_fn): New function.
(duplicate_ssa_name): Rename to ...
(duplicate_ssa_name_fn): ... this and adjust.
* tree-tailcall.c (update_accumulator_with_ops): Use copy_ssa_name.
* tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1): Likewise.
(slpeel_update_phi_nodes_for_guard2): Likewise.
(slpeel_tree_peel_loop_to_edge): Likewise.
(vect_loop_versioning): Likewise.
* tree-parloops.c (transform_to_exit_first_loop): Likewise.
(create_parallel_loop): Likewise.
* ipa-split.c (split_function): Likewise.
* tree-vect-loop.c (vect_is_simple_reduction_1): Likewise.
(vect_create_epilog_for_reduction): Likewise.
* tree-vect-data-refs.c (bump_vector_ptr): Likewise.
(vect_setup_realignment): Likewise.
* tree-vect-stmts.c (vectorizable_load): Likewise.
* tree-switch-conversion.c (build_one_array): Likewise.
(gen_def_assigns): Likewise.
* tree-cfg.c (gimple_make_forwarder_block): Likewise.
* graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Call
create_zero_dim_array with the SSA name.
(rewrite_phi_out_of_ssa): Likewise.
(rewrite_cross_bb_scalar_dependence): Likewise.  Use copy_ssa_name.

From-SVN: r190202

14 files changed:
gcc/ChangeLog
gcc/graphite-sese-to-poly.c
gcc/ipa-split.c
gcc/tree-cfg.c
gcc/tree-flow-inline.h
gcc/tree-flow.h
gcc/tree-parloops.c
gcc/tree-ssanames.c
gcc/tree-switch-conversion.c
gcc/tree-tailcall.c
gcc/tree-vect-data-refs.c
gcc/tree-vect-loop-manip.c
gcc/tree-vect-loop.c
gcc/tree-vect-stmts.c

index 09103dab98d604a26a55e6cfca1775fe4d0347f5..43b0b9204134672dc09cc23b997af4c2c2734df9 100644 (file)
@@ -1,3 +1,33 @@
+2012-08-07  Richard Guenther  <rguenther@suse.de>
+
+       * tree-flow.h (copy_ssa_name_fn): New function.
+       (duplicate_ssa_name_fn): Likewise.
+       * tree-flow-inline.h (copy_ssa_name): New function.
+       (duplicate_ssa_name): Likewise.
+       * tree-ssanames.c (copy_ssa_name_fn): New function.
+       (duplicate_ssa_name): Rename to ...
+       (duplicate_ssa_name_fn): ... this and adjust.
+       * tree-tailcall.c (update_accumulator_with_ops): Use copy_ssa_name.
+       * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1): Likewise.
+       (slpeel_update_phi_nodes_for_guard2): Likewise.
+       (slpeel_tree_peel_loop_to_edge): Likewise.
+       (vect_loop_versioning): Likewise.
+       * tree-parloops.c (transform_to_exit_first_loop): Likewise.
+       (create_parallel_loop): Likewise.
+       * ipa-split.c (split_function): Likewise.
+       * tree-vect-loop.c (vect_is_simple_reduction_1): Likewise.
+       (vect_create_epilog_for_reduction): Likewise.
+       * tree-vect-data-refs.c (bump_vector_ptr): Likewise.
+       (vect_setup_realignment): Likewise.
+       * tree-vect-stmts.c (vectorizable_load): Likewise.
+       * tree-switch-conversion.c (build_one_array): Likewise.
+       (gen_def_assigns): Likewise.
+       * tree-cfg.c (gimple_make_forwarder_block): Likewise.
+       * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Call
+       create_zero_dim_array with the SSA name.
+       (rewrite_phi_out_of_ssa): Likewise.
+       (rewrite_cross_bb_scalar_dependence): Likewise.  Use copy_ssa_name.
+
 2012-08-07  Richard Guenther  <rguenther@suse.de>
 
        * tree-dfa.c (set_ssa_default_def): Clear the SSA_NAME_DEFAULT_DEF
index ca3ae8f863348baf9e3cec899cad80c3849c5792..c1686221187725928f22679d6ed4d86f0a38ba12 100644 (file)
@@ -2166,7 +2166,6 @@ rewrite_close_phi_out_of_ssa (scop_p scop, gimple_stmt_iterator *psi)
   sese region = SCOP_REGION (scop);
   gimple phi = gsi_stmt (*psi);
   tree res = gimple_phi_result (phi);
-  tree var = SSA_NAME_VAR (res);
   basic_block bb = gimple_bb (phi);
   gimple_stmt_iterator gsi = gsi_after_labels (bb);
   tree arg = gimple_phi_arg_def (phi, 0);
@@ -2222,7 +2221,7 @@ rewrite_close_phi_out_of_ssa (scop_p scop, gimple_stmt_iterator *psi)
     }
   else
     {
-      tree zero_dim_array = create_zero_dim_array (var, "Close_Phi");
+      tree zero_dim_array = create_zero_dim_array (res, "Close_Phi");
 
       stmt = gimple_build_assign (res, zero_dim_array);
 
@@ -2250,8 +2249,8 @@ rewrite_phi_out_of_ssa (scop_p scop, gimple_stmt_iterator *psi)
   gimple phi = gsi_stmt (*psi);
   basic_block bb = gimple_bb (phi);
   tree res = gimple_phi_result (phi);
-  tree var = SSA_NAME_VAR (res);
-  tree zero_dim_array = create_zero_dim_array (var, "phi_out_of_ssa");
+  tree var;
+  tree zero_dim_array = create_zero_dim_array (res, "phi_out_of_ssa");
   gimple stmt;
   gimple_seq stmts;
 
@@ -2349,14 +2348,16 @@ static void
 rewrite_cross_bb_scalar_dependence (scop_p scop, tree zero_dim_array,
                                    tree def, gimple use_stmt)
 {
-  tree var = SSA_NAME_VAR (def);
-  gimple name_stmt = gimple_build_assign (var, zero_dim_array);
-  tree name = make_ssa_name (var, name_stmt);
+  gimple name_stmt;
+  tree name;
   ssa_op_iter iter;
   use_operand_p use_p;
 
   gcc_assert (gimple_code (use_stmt) != GIMPLE_PHI);
 
+  name = copy_ssa_name (def, NULL);
+  name_stmt = gimple_build_assign (name, zero_dim_array);
+
   gimple_assign_set_lhs (name_stmt, name);
   insert_stmts (scop, name_stmt, NULL, gsi_for_stmt (use_stmt));
 
@@ -2480,7 +2481,7 @@ rewrite_cross_bb_scalar_deps (scop_p scop, gimple_stmt_iterator *gsi)
        if (!zero_dim_array)
          {
            zero_dim_array = create_zero_dim_array
-             (SSA_NAME_VAR (def), "Cross_BB_scalar_dependence");
+             (def, "Cross_BB_scalar_dependence");
            insert_out_of_ssa_copy (scop, zero_dim_array, def,
                                    SSA_NAME_DEF_STMT (def));
            gsi_next (gsi);
index 7155f9965a76c8ced554a64d6ca38e9638c30e53..85d28f8822178273643899554190053db2e3121b 100644 (file)
@@ -1267,7 +1267,7 @@ split_function (struct split_point *split_point)
              if (TREE_CODE (retval) == SSA_NAME
                  && !DECL_BY_REFERENCE (DECL_RESULT (current_function_decl)))
                {
-                 retval = make_ssa_name (SSA_NAME_VAR (retval), call);
+                 retval = copy_ssa_name (retval, call);
 
                  /* See if there is PHI defining return value.  */
                  for (psi = gsi_start_phis (return_bb);
index bc4045ef56d8b1c4c1f427e40bf42e7cb9996af1..4f2ddc02adafdd5bd13b1e88077ae16b17f6e48b 100644 (file)
@@ -5018,7 +5018,7 @@ gimple_make_forwarder_block (edge fallthru)
       phi = gsi_stmt (gsi);
       var = gimple_phi_result (phi);
       new_phi = create_phi_node (var, bb);
-      gimple_phi_set_result (phi, make_ssa_name (SSA_NAME_VAR (var), phi));
+      gimple_phi_set_result (phi, copy_ssa_name (var, phi));
       add_phi_arg (new_phi, gimple_phi_result (phi), fallthru,
                   UNKNOWN_LOCATION);
     }
index 15f31107475da9bd2d7b87ce768178cd303daaea..e40974ea2a5257f31d8c17f59b94b3677d1f6b24 100644 (file)
@@ -1144,6 +1144,25 @@ make_ssa_name (tree var, gimple stmt)
   return make_ssa_name_fn (cfun, var, stmt);
 }
 
+/* Return an SSA_NAME node using the template SSA name NAME defined in
+   statement STMT in function cfun.  */
+
+static inline tree
+copy_ssa_name (tree var, gimple stmt)
+{
+  return copy_ssa_name_fn (cfun, var, stmt);
+}
+
+/*  Creates a duplicate of a SSA name NAME tobe defined by statement STMT
+    in function cfun.  */
+
+static inline tree
+duplicate_ssa_name (tree var, gimple stmt)
+{
+  return duplicate_ssa_name_fn (cfun, var, stmt);
+}
+
+
 /* Returns the base object and a constant BITS_PER_UNIT offset in *POFFSET that
    denotes the starting address of the memory access EXP.
    Returns NULL_TREE if the offset is not constant or any component
index 2e6a1ae9a07a25c52f0d9f449edd7164ef8157b7..b5dd3c45375a5cedb00aa71c926b6f437a6bbe66 100644 (file)
@@ -530,7 +530,8 @@ void set_current_def (tree, tree);
 extern void init_ssanames (struct function *, int);
 extern void fini_ssanames (void);
 extern tree make_ssa_name_fn (struct function *, tree, gimple);
-extern tree duplicate_ssa_name (tree, gimple);
+extern tree copy_ssa_name_fn (struct function *, tree, gimple);
+extern tree duplicate_ssa_name_fn (struct function *, tree, gimple);
 extern void duplicate_ssa_name_ptr_info (tree, struct ptr_info_def *);
 extern void release_ssa_name (tree);
 extern void release_defs (gimple);
index 25416abb62120abbccef4f981daef1f7e195da54..6a5c687ba29527bc4e9f98ba72236c9e06a39a4e 100644 (file)
@@ -1485,7 +1485,7 @@ transform_to_exit_first_loop (struct loop *loop, htab_t reduction_list, tree nit
     {
       phi = gsi_stmt (gsi);
       res = PHI_RESULT (phi);
-      t = make_ssa_name (SSA_NAME_VAR (res), phi);
+      t = copy_ssa_name (res, phi);
       SET_PHI_RESULT (phi, t);
       nphi = create_phi_node (res, orig_header);
       add_phi_arg (nphi, t, hpred, UNKNOWN_LOCATION);
@@ -1623,7 +1623,7 @@ create_parallel_loop (struct loop *loop, tree loop_fn, tree data,
   cvar_base = SSA_NAME_VAR (cvar);
   phi = SSA_NAME_DEF_STMT (cvar);
   cvar_init = PHI_ARG_DEF_FROM_EDGE (phi, loop_preheader_edge (loop));
-  initvar = make_ssa_name (cvar_base, NULL);
+  initvar = copy_ssa_name (cvar, NULL);
   SET_USE (PHI_ARG_DEF_PTR_FROM_EDGE (phi, loop_preheader_edge (loop)),
           initvar);
   cvar_next = PHI_ARG_DEF_FROM_EDGE (phi, loop_latch_edge (loop));
index f2b434a4d6553f9cb359afc5577c334c904fb167..b9036e2ec507fde98e390f6f6893921465156d9d 100644 (file)
@@ -312,6 +312,17 @@ get_ptr_info (tree t)
   return pi;
 }
 
+
+/* Creates a new SSA name using the template NAME tobe defined by
+   statement STMT in function FN.  */
+
+tree
+copy_ssa_name_fn (struct function *fn, tree name, gimple stmt)
+{
+  return make_ssa_name_fn (fn, SSA_NAME_VAR (name), stmt);
+}
+
+
 /* Creates a duplicate of the ptr_info_def at PTR_INFO for use by
    the SSA name NAME.  */
 
@@ -333,12 +344,13 @@ duplicate_ssa_name_ptr_info (tree name, struct ptr_info_def *ptr_info)
 }
 
 
-/* Creates a duplicate of a ssa name NAME tobe defined by statement STMT.  */
+/* Creates a duplicate of a ssa name NAME tobe defined by statement STMT
+   in function FN.  */
 
 tree
-duplicate_ssa_name (tree name, gimple stmt)
+duplicate_ssa_name_fn (struct function *fn, tree name, gimple stmt)
 {
-  tree new_name = make_ssa_name (SSA_NAME_VAR (name), stmt);
+  tree new_name = copy_ssa_name_fn (fn, name, stmt);
   struct ptr_info_def *old_ptr_info = SSA_NAME_PTR_INFO (name);
 
   if (old_ptr_info)
index 6c61eca3b612a99d27203707d29185e29b7a16c0..4336e5cc5927a1e05f400a229abb4acee82b3c5b 100644 (file)
@@ -1031,7 +1031,7 @@ build_one_array (gimple swtch, int num, tree arr_index_type, gimple phi,
 
   gcc_assert (info->default_values[num]);
 
-  name = make_ssa_name (SSA_NAME_VAR (PHI_RESULT (phi)), NULL);
+  name = copy_ssa_name (PHI_RESULT (phi), NULL);
   info->target_inbound_names[num] = name;
 
   cst = constructor_contains_same_values_p (info->constructors[num]);
@@ -1077,7 +1077,6 @@ build_one_array (gimple swtch, int num, tree arr_index_type, gimple phi,
       load = gimple_build_assign (name, fetch);
     }
 
-  SSA_NAME_DEF_STMT (name) = load;
   gsi_insert_before (&gsi, load, GSI_SAME_STMT);
   update_stmt (load);
   info->arr_ref_last = load;
@@ -1137,12 +1136,9 @@ gen_def_assigns (gimple_stmt_iterator *gsi, struct switch_conv_info *info)
 
   for (i = 0; i < info->phi_count; i++)
     {
-      tree name
-       = make_ssa_name (SSA_NAME_VAR (info->target_inbound_names[i]), NULL);
-
+      tree name = copy_ssa_name (info->target_inbound_names[i], NULL);
       info->target_outbound_names[i] = name;
       assign = gimple_build_assign (name, info->default_values[i]);
-      SSA_NAME_DEF_STMT (name) = assign;
       gsi_insert_before (gsi, assign, GSI_SAME_STMT);
       update_stmt (assign);
     }
index b5356f5edbf61cc2f7593c9d3a1cf208b8268d3e..594617a67fe84a2eae6951961dc08dd6a2ee88e0 100644 (file)
@@ -644,9 +644,9 @@ update_accumulator_with_ops (enum tree_code code, tree acc, tree op1,
                             gimple_stmt_iterator gsi)
 {
   gimple stmt;
-  tree var;
+  tree var = copy_ssa_name (acc, NULL);
   if (types_compatible_p (TREE_TYPE (acc), TREE_TYPE (op1)))
-    stmt = gimple_build_assign_with_ops (code, SSA_NAME_VAR (acc), acc, op1);
+    stmt = gimple_build_assign_with_ops (code, var, acc, op1);
   else
     {
       tree rhs = fold_convert (TREE_TYPE (acc),
@@ -656,11 +656,8 @@ update_accumulator_with_ops (enum tree_code code, tree acc, tree op1,
                                            op1));
       rhs = force_gimple_operand_gsi (&gsi, rhs,
                                      false, NULL, false, GSI_CONTINUE_LINKING);
-      stmt = gimple_build_assign (NULL_TREE, rhs);
+      stmt = gimple_build_assign (var, rhs);
     }
-  var = make_ssa_name (SSA_NAME_VAR (acc), stmt);
-  gimple_assign_set_lhs (stmt, var);
-  update_stmt (stmt);
   gsi_insert_after (&gsi, stmt, GSI_NEW_STMT);
   return var;
 }
index e123bea88a0f30f84e03871e3e857b0594b7d98f..ad59bf37d8c9f6524c1560c27788b275879724b7 100644 (file)
@@ -3941,7 +3941,6 @@ bump_vector_ptr (tree dataref_ptr, gimple ptr_incr, gimple_stmt_iterator *gsi,
   stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
   struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info);
   tree vectype = STMT_VINFO_VECTYPE (stmt_info);
-  tree ptr_var = SSA_NAME_VAR (dataref_ptr);
   tree update = TYPE_SIZE_UNIT (vectype);
   gimple incr_stmt;
   ssa_op_iter iter;
@@ -3951,10 +3950,9 @@ bump_vector_ptr (tree dataref_ptr, gimple ptr_incr, gimple_stmt_iterator *gsi,
   if (bump)
     update = bump;
 
-  incr_stmt = gimple_build_assign_with_ops (POINTER_PLUS_EXPR, ptr_var,
+  new_dataref_ptr = copy_ssa_name (dataref_ptr, NULL);
+  incr_stmt = gimple_build_assign_with_ops (POINTER_PLUS_EXPR, new_dataref_ptr,
                                            dataref_ptr, update);
-  new_dataref_ptr = make_ssa_name (ptr_var, incr_stmt);
-  gimple_assign_set_lhs (incr_stmt, new_dataref_ptr);
   vect_finish_stmt_generation (stmt, incr_stmt, gsi);
 
   /* Copy the points-to information if it exists. */
@@ -4356,12 +4354,11 @@ vect_setup_realignment (gimple stmt, gimple_stmt_iterator *gsi,
       ptr = vect_create_data_ref_ptr (stmt, vectype, loop_for_initial_load,
                                      NULL_TREE, &init_addr, NULL, &inc,
                                      true, &inv_p);
+      new_temp = copy_ssa_name (ptr, NULL);
       new_stmt = gimple_build_assign_with_ops
-                  (BIT_AND_EXPR, NULL_TREE, ptr,
+                  (BIT_AND_EXPR, new_temp, ptr,
                    build_int_cst (TREE_TYPE (ptr),
                                   -(HOST_WIDE_INT)TYPE_ALIGN_UNIT (vectype)));
-      new_temp = make_ssa_name (SSA_NAME_VAR (ptr), new_stmt);
-      gimple_assign_set_lhs (new_stmt, new_temp);
       new_bb = gsi_insert_on_edge_immediate (pe, new_stmt);
       gcc_assert (!new_bb);
       data_ref
index 65d939d0ffd5502c9acdfc3760ad9e3465742468..cea8a1b8c524a9455e984a8cf6053fce2a625ee7 100644 (file)
@@ -511,14 +511,15 @@ slpeel_update_phi_nodes_for_guard1 (edge guard_edge, struct loop *loop,
        gsi_next (&gsi_orig), gsi_next (&gsi_update))
     {
       source_location loop_locus, guard_locus;
+      tree new_res;
       orig_phi = gsi_stmt (gsi_orig);
       update_phi = gsi_stmt (gsi_update);
 
       /** 1. Handle new-merge-point phis  **/
 
       /* 1.1. Generate new phi node in NEW_MERGE_BB:  */
-      new_phi = create_phi_node (SSA_NAME_VAR (PHI_RESULT (orig_phi)),
-                                 new_merge_bb);
+      new_res = copy_ssa_name (PHI_RESULT (orig_phi), NULL);
+      new_phi = create_phi_node (new_res, new_merge_bb);
 
       /* 1.2. NEW_MERGE_BB has two incoming edges: GUARD_EDGE and the exit-edge
             of LOOP. Set the two phi args in NEW_PHI for these edges:  */
@@ -547,8 +548,8 @@ slpeel_update_phi_nodes_for_guard1 (edge guard_edge, struct loop *loop,
        continue;
 
       /* 2.1. Generate new phi node in NEW_EXIT_BB:  */
-      new_phi = create_phi_node (SSA_NAME_VAR (PHI_RESULT (orig_phi)),
-                                 *new_exit_bb);
+      new_res = copy_ssa_name (PHI_RESULT (orig_phi), NULL);
+      new_phi = create_phi_node (new_res, *new_exit_bb);
 
       /* 2.2. NEW_EXIT_BB has one incoming edge: the exit-edge of the loop.  */
       add_phi_arg (new_phi, loop_arg, single_exit (loop), loop_locus);
@@ -636,6 +637,7 @@ slpeel_update_phi_nodes_for_guard2 (edge guard_edge, struct loop *loop,
 
   for (gsi = gsi_start_phis (update_bb); !gsi_end_p (gsi); gsi_next (&gsi))
     {
+      tree new_res;
       update_phi = gsi_stmt (gsi);
       orig_phi = update_phi;
       orig_def = PHI_ARG_DEF_FROM_EDGE (orig_phi, e);
@@ -649,8 +651,8 @@ slpeel_update_phi_nodes_for_guard2 (edge guard_edge, struct loop *loop,
       /** 1. Handle new-merge-point phis  **/
 
       /* 1.1. Generate new phi node in NEW_MERGE_BB:  */
-      new_phi = create_phi_node (SSA_NAME_VAR (PHI_RESULT (orig_phi)),
-                                 new_merge_bb);
+      new_res = copy_ssa_name (PHI_RESULT (orig_phi), NULL);
+      new_phi = create_phi_node (new_res, new_merge_bb);
 
       /* 1.2. NEW_MERGE_BB has two incoming edges: GUARD_EDGE and the exit-edge
             of LOOP. Set the two PHI args in NEW_PHI for these edges:  */
@@ -691,8 +693,8 @@ slpeel_update_phi_nodes_for_guard2 (edge guard_edge, struct loop *loop,
       /** 2. Handle loop-closed-ssa-form phis  **/
 
       /* 2.1. Generate new phi node in NEW_EXIT_BB:  */
-      new_phi = create_phi_node (SSA_NAME_VAR (PHI_RESULT (orig_phi)),
-                                 *new_exit_bb);
+      new_res = copy_ssa_name (PHI_RESULT (orig_phi), NULL);
+      new_phi = create_phi_node (new_res, *new_exit_bb);
 
       /* 2.2. NEW_EXIT_BB has one incoming edge: the exit-edge of the loop.  */
       add_phi_arg (new_phi, loop_arg, single_exit (loop), UNKNOWN_LOCATION);
@@ -726,8 +728,8 @@ slpeel_update_phi_nodes_for_guard2 (edge guard_edge, struct loop *loop,
       arg = guard_arg;
 
       /* 3.2. Generate new phi node in GUARD_BB:  */
-      new_phi = create_phi_node (SSA_NAME_VAR (PHI_RESULT (orig_phi)),
-                                 guard_edge->src);
+      new_res = copy_ssa_name (PHI_RESULT (orig_phi), NULL);
+      new_phi = create_phi_node (new_res, guard_edge->src);
 
       /* 3.3. GUARD_BB has one incoming edge:  */
       gcc_assert (EDGE_COUNT (guard_edge->src->preds) == 1);
@@ -1182,13 +1184,11 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop,
            break;
        if (gsi_end_p (gsi))
          {
-           gimple new_phi = create_phi_node (SSA_NAME_VAR (PHI_RESULT (phi)),
-                                             exit_e->dest);
+           tree new_vop = copy_ssa_name (PHI_RESULT (phi), NULL);
+           gimple new_phi = create_phi_node (new_vop, exit_e->dest);
            tree vop = PHI_ARG_DEF_FROM_EDGE (phi, EDGE_SUCC (loop->latch, 0));
            imm_use_iterator imm_iter;
            gimple stmt;
-           tree new_vop = make_ssa_name (SSA_NAME_VAR (PHI_RESULT (phi)),
-                                         new_phi);
            use_operand_p use_p;
 
            add_phi_arg (new_phi, vop, exit_e, UNKNOWN_LOCATION);
@@ -2535,9 +2535,10 @@ vect_loop_versioning (loop_vec_info loop_vinfo,
 
   for (gsi = gsi_start_phis (merge_bb); !gsi_end_p (gsi); gsi_next (&gsi))
     {
+      tree new_res;
       orig_phi = gsi_stmt (gsi);
-      new_phi = create_phi_node (SSA_NAME_VAR (PHI_RESULT (orig_phi)),
-                                 new_exit_bb);
+      new_res = copy_ssa_name (PHI_RESULT (orig_phi), NULL);
+      new_phi = create_phi_node (new_res, new_exit_bb);
       arg = PHI_ARG_DEF_FROM_EDGE (orig_phi, e);
       add_phi_arg (new_phi, arg, new_exit_e,
                   gimple_phi_arg_location_from_edge (orig_phi, e));
index cd8c3afb1c7618afd1a142680ca24c8c77cd14b8..48d75a48a31e656ff0f3cf1d5978ef73fffdf980 100644 (file)
@@ -2270,7 +2270,7 @@ vect_is_simple_reduction_1 (loop_vec_info loop_info, gimple phi,
   if (orig_code == MINUS_EXPR)
     {
       tree rhs = gimple_assign_rhs2 (def_stmt);
-      tree negrhs = make_ssa_name (SSA_NAME_VAR (rhs), NULL);
+      tree negrhs = copy_ssa_name (rhs, NULL);
       gimple negate_stmt = gimple_build_assign_with_ops (NEGATE_EXPR, negrhs,
                                                         rhs, NULL);
       gimple_stmt_iterator gsi = gsi_for_stmt (def_stmt);
@@ -3700,7 +3700,8 @@ vect_create_epilog_for_reduction (VEC (tree, heap) *vect_defs, gimple stmt,
     {
       for (j = 0; j < ncopies; j++)
         {
-          phi = create_phi_node (SSA_NAME_VAR (def), exit_bb);
+         tree new_def = copy_ssa_name (def, NULL);
+          phi = create_phi_node (new_def, exit_bb);
           set_vinfo_for_stmt (phi, new_stmt_vec_info (phi, loop_vinfo, NULL));
           if (j == 0)
             VEC_quick_push (gimple, new_phis, phi);
@@ -3724,8 +3725,8 @@ vect_create_epilog_for_reduction (VEC (tree, heap) *vect_defs, gimple stmt,
       inner_phis = VEC_alloc (gimple, heap, VEC_length (tree, vect_defs));
       FOR_EACH_VEC_ELT (gimple, new_phis, i, phi)
        {
-         gimple outer_phi = create_phi_node (SSA_NAME_VAR (PHI_RESULT (phi)),
-                                             exit_bb);
+         tree new_result = copy_ssa_name (PHI_RESULT (phi), NULL);
+         gimple outer_phi = create_phi_node (new_result, exit_bb);
          SET_PHI_ARG_DEF (outer_phi, single_exit (loop)->dest_idx,
                           PHI_RESULT (phi));
          set_vinfo_for_stmt (outer_phi, new_stmt_vec_info (outer_phi,
@@ -3736,8 +3737,8 @@ vect_create_epilog_for_reduction (VEC (tree, heap) *vect_defs, gimple stmt,
           while (STMT_VINFO_RELATED_STMT (vinfo_for_stmt (phi)))
             {
              phi = STMT_VINFO_RELATED_STMT (vinfo_for_stmt (phi));
-             outer_phi = create_phi_node (SSA_NAME_VAR (PHI_RESULT (phi)),
-                                          exit_bb);
+             new_result = copy_ssa_name (PHI_RESULT (phi), NULL);
+             outer_phi = create_phi_node (new_result, exit_bb);
              SET_PHI_ARG_DEF (outer_phi, single_exit (loop)->dest_idx,
                               PHI_RESULT (phi));
              set_vinfo_for_stmt (outer_phi, new_stmt_vec_info (outer_phi,
index 8533919e52762c6545e0c54527616fe24fb6d699..4769e6269eeea74b7c465d119f3a16286bc9336a 100644 (file)
@@ -4668,15 +4668,13 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
                                                 NULL_TREE, true,
                                                 GSI_SAME_STMT);
              CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, newref);
-             newoff = SSA_NAME_VAR (running_off);
+             newoff = copy_ssa_name (running_off, NULL);
              if (POINTER_TYPE_P (TREE_TYPE (newoff)))
                incr = gimple_build_assign_with_ops (POINTER_PLUS_EXPR, newoff,
                                                     running_off, stride_step);
              else
                incr = gimple_build_assign_with_ops (PLUS_EXPR, newoff,
                                                     running_off, stride_step);
-             newoff = make_ssa_name (newoff, incr);
-             gimple_assign_set_lhs (incr, newoff);
              vect_finish_stmt_generation (stmt, incr, gsi);
 
              running_off = newoff;
@@ -4970,13 +4968,12 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
                                                    dr_explicit_realign,
                                                    dataref_ptr, NULL);
 
+                   ptr = copy_ssa_name (dataref_ptr, NULL);
                    new_stmt = gimple_build_assign_with_ops
-                                (BIT_AND_EXPR, NULL_TREE, dataref_ptr,
+                                (BIT_AND_EXPR, ptr, dataref_ptr,
                                  build_int_cst
                                  (TREE_TYPE (dataref_ptr),
                                   -(HOST_WIDE_INT)TYPE_ALIGN_UNIT (vectype)));
-                   ptr = make_ssa_name (SSA_NAME_VAR (dataref_ptr), new_stmt);
-                   gimple_assign_set_lhs (new_stmt, ptr);
                    vect_finish_stmt_generation (stmt, new_stmt, gsi);
                    data_ref
                      = build2 (MEM_REF, vectype, ptr,
@@ -5000,7 +4997,7 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
                                  build_int_cst
                                  (TREE_TYPE (ptr),
                                   -(HOST_WIDE_INT)TYPE_ALIGN_UNIT (vectype)));
-                   ptr = make_ssa_name (SSA_NAME_VAR (dataref_ptr), new_stmt);
+                   ptr = copy_ssa_name (dataref_ptr, new_stmt);
                    gimple_assign_set_lhs (new_stmt, ptr);
                    vect_finish_stmt_generation (stmt, new_stmt, gsi);
                    data_ref
@@ -5010,14 +5007,12 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
                    break;
                  }
                case dr_explicit_realign_optimized:
+                 new_temp = copy_ssa_name (dataref_ptr, NULL);
                  new_stmt = gimple_build_assign_with_ops
-                              (BIT_AND_EXPR, NULL_TREE, dataref_ptr,
+                              (BIT_AND_EXPR, new_temp, dataref_ptr,
                                build_int_cst
                                  (TREE_TYPE (dataref_ptr),
                                   -(HOST_WIDE_INT)TYPE_ALIGN_UNIT (vectype)));
-                 new_temp = make_ssa_name (SSA_NAME_VAR (dataref_ptr),
-                                           new_stmt);
-                 gimple_assign_set_lhs (new_stmt, new_temp);
                  vect_finish_stmt_generation (stmt, new_stmt, gsi);
                  data_ref
                    = build2 (MEM_REF, vectype, new_temp,
This page took 0.102497 seconds and 5 git commands to generate.