]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2012-08-07 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 7 Aug 2012 10:36:01 +0000 (10:36 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 7 Aug 2012 10:36:01 +0000 (10:36 +0000)
* gimple.h (gimple_phi_set_result): Adjust SSA_NAME_DEF_STMT.
* tree-phinodes.c (make_phi_node): Allow a NULL var.
* tree-into-ssa.c (insert_phi_nodes_for): Simplify.
* tree-complex.c (update_phi_components): Likewise.
* tree-ssa-loop-manip.c (create_iv): Likewise.
(add_exit_phis_edge): Likewise.
(split_loop_exit_edge): Likewise.
(tree_transform_and_unroll_loop): Likewise.
* value-prof.c (gimple_ic): Likewise.
(gimple_stringop_fixed_value): Likewise.
* tree-tailcall.c (tree_optimize_tail_calls_1): Likewise.
* omp-low.c (expand_parallel_call): Likewise.
(expand_omp_for_static_chunk): Likewise.
(expand_omp_atomic_pipeline): Likewise.
* tree-parloops.c (create_phi_for_local_result): Likewise.
(transform_to_exit_first_loop): Likewise.
* tree-vect-data-refs.c (vect_setup_realignment): Likewise.
* graphite-scop-detection.c (canonicalize_loop_closed_ssa): Likewise.
* tree-predcom.c (initialize_root_vars): Likewise.
(initialize_root_vars_lm): Likewise.
* sese.c (sese_add_exit_phis_edge): Likewise.
* gimple-streamer-in.c (input_phi): Likewise.
* tree-inline.c (copy_phis_for_bb): Likewise.
* tree-ssa-phiprop.c (phiprop_insert_phi): Likewise.
* tree-cfg.c (gimple_make_forwarder_block): Likewise.
(gimple_duplicate_bb): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190199 138bc75d-0d04-0410-961f-82ee72b054a4

18 files changed:
gcc/ChangeLog
gcc/gimple-streamer-in.c
gcc/gimple.h
gcc/graphite-scop-detection.c
gcc/omp-low.c
gcc/sese.c
gcc/tree-cfg.c
gcc/tree-complex.c
gcc/tree-inline.c
gcc/tree-into-ssa.c
gcc/tree-parloops.c
gcc/tree-phinodes.c
gcc/tree-predcom.c
gcc/tree-ssa-loop-manip.c
gcc/tree-ssa-phiprop.c
gcc/tree-tailcall.c
gcc/tree-vect-data-refs.c
gcc/value-prof.c

index b05788140a5ae1850573ade13c66a7852e870ae9..b732bed7355f85c535350f36ef3a22b916790718 100644 (file)
@@ -1,3 +1,32 @@
+2012-08-07  Richard Guenther  <rguenther@suse.de>
+
+       * gimple.h (gimple_phi_set_result): Adjust SSA_NAME_DEF_STMT.
+       * tree-phinodes.c (make_phi_node): Allow a NULL var.
+       * tree-into-ssa.c (insert_phi_nodes_for): Simplify.
+       * tree-complex.c (update_phi_components): Likewise.
+       * tree-ssa-loop-manip.c (create_iv): Likewise.
+       (add_exit_phis_edge): Likewise.
+       (split_loop_exit_edge): Likewise.
+       (tree_transform_and_unroll_loop): Likewise.
+       * value-prof.c (gimple_ic): Likewise.
+       (gimple_stringop_fixed_value): Likewise.
+       * tree-tailcall.c (tree_optimize_tail_calls_1): Likewise.
+       * omp-low.c (expand_parallel_call): Likewise.
+       (expand_omp_for_static_chunk): Likewise.
+       (expand_omp_atomic_pipeline): Likewise.
+       * tree-parloops.c (create_phi_for_local_result): Likewise.
+       (transform_to_exit_first_loop): Likewise.
+       * tree-vect-data-refs.c (vect_setup_realignment): Likewise.
+       * graphite-scop-detection.c (canonicalize_loop_closed_ssa): Likewise.
+       * tree-predcom.c (initialize_root_vars): Likewise.
+       (initialize_root_vars_lm): Likewise.
+       * sese.c (sese_add_exit_phis_edge): Likewise.
+       * gimple-streamer-in.c (input_phi): Likewise.
+       * tree-inline.c (copy_phis_for_bb): Likewise.
+       * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise.
+       * tree-cfg.c (gimple_make_forwarder_block): Likewise.
+       (gimple_duplicate_bb): Likewise.
+
 2012-08-07  Nick Clifton  <nickc@redhat.com>
 
        * config/mn10300/mn10300.c (mn10300_expand_prologue): Report
index f40be0e6edfc81c497f5ff08809623da62dc0cc3..56cdc6f4f67ce58d4920333489159d663aad8151 100644 (file)
@@ -45,7 +45,6 @@ input_phi (struct lto_input_block *ib, basic_block bb, struct data_in *data_in,
   phi_result = VEC_index (tree, SSANAMES (fn), ix);
   len = EDGE_COUNT (bb->preds);
   result = create_phi_node (phi_result, bb);
-  SSA_NAME_DEF_STMT (phi_result) = result;
 
   /* We have to go through a lookup process here because the preds in the
      reconstructed graph are generally in a different order than they
index 5180e8e5445e29fe54ee43812ff0296781947720..64ef68e57a1476c5e5d9ddb44906d3a5aaa58a1f 100644 (file)
@@ -3494,6 +3494,8 @@ gimple_phi_set_result (gimple gs, tree result)
 {
   GIMPLE_CHECK (gs, GIMPLE_PHI);
   gs->gimple_phi.result = result;
+  if (result && TREE_CODE (result) == SSA_NAME)
+    SSA_NAME_DEF_STMT (result) = gs;
 }
 
 
index cfa06ab60c5b9929abf1ff5d5e5951b61fba37c0..2fb1997c844a395631be94b2f47ca83f9fd93783 100644 (file)
@@ -1325,9 +1325,8 @@ canonicalize_loop_closed_ssa (loop_p loop)
                if (TREE_CODE (arg) != SSA_NAME)
                  continue;
 
-               close_phi = create_phi_node (arg, close);
-               res = create_new_def_for (gimple_phi_result (close_phi),
-                                         close_phi,
+               close_phi = create_phi_node (NULL_TREE, close);
+               res = create_new_def_for (arg, close_phi,
                                          gimple_phi_result_ptr (close_phi));
                add_phi_arg (close_phi, arg,
                             gimple_phi_arg_edge (close_phi, 0),
index 190360f6320f3da034da6c738c6d691f2126316c..846840e2b679804816b75589c4b7d668e21413cf 100644 (file)
@@ -3059,7 +3059,6 @@ expand_parallel_call (struct omp_region *region, basic_block bb,
          if (gimple_in_ssa_p (cfun))
            {
              gimple phi = create_phi_node (tmp_join, bb);
-             SSA_NAME_DEF_STMT (tmp_join) = phi;
              add_phi_arg (phi, tmp_then, e_then, UNKNOWN_LOCATION);
              add_phi_arg (phi, tmp_else, e_else, UNKNOWN_LOCATION);
            }
@@ -4592,7 +4591,6 @@ expand_omp_for_static_chunk (struct omp_region *region, struct omp_for_data *fd)
          t = gimple_phi_result (phi);
          gcc_assert (t == redirect_edge_var_map_result (vm));
          nphi = create_phi_node (t, iter_part_bb);
-         SSA_NAME_DEF_STMT (t) = nphi;
 
          t = PHI_ARG_DEF_FROM_EDGE (phi, se);
          locus = gimple_phi_arg_location_from_edge (phi, se);
@@ -4617,7 +4615,6 @@ expand_omp_for_static_chunk (struct omp_region *region, struct omp_for_data *fd)
 
       /* Make phi node for trip.  */
       phi = create_phi_node (trip_main, iter_part_bb);
-      SSA_NAME_DEF_STMT (trip_main) = phi;
       add_phi_arg (phi, trip_back, single_succ_edge (trip_update_bb),
                   UNKNOWN_LOCATION);
       add_phi_arg (phi, trip_init, single_succ_edge (entry_bb),
@@ -5319,7 +5316,6 @@ expand_omp_atomic_pipeline (basic_block load_bb, basic_block store_bb,
     {
       gcc_assert (gimple_seq_empty_p (phi_nodes (loop_header)));
       phi = create_phi_node (loadedi, loop_header);
-      SSA_NAME_DEF_STMT (loadedi) = phi;
       SET_USE (PHI_ARG_DEF_PTR_FROM_EDGE (phi, single_succ_edge (load_bb)),
               initial);
     }
index acae527b91bfcc72d9e78fedf247632af5f696c9..f3dc2b7c49e5c611ea84031921f58cb4ee381755 100644 (file)
@@ -345,10 +345,8 @@ free_sese (sese region)
 static void
 sese_add_exit_phis_edge (basic_block exit, tree use, edge false_e, edge true_e)
 {
-  gimple phi = create_phi_node (use, exit);
-
-  create_new_def_for (gimple_phi_result (phi), phi,
-                     gimple_phi_result_ptr (phi));
+  gimple phi = create_phi_node (NULL_TREE, exit);
+  create_new_def_for (use, phi, gimple_phi_result_ptr (phi));
   add_phi_arg (phi, use, false_e, UNKNOWN_LOCATION);
   add_phi_arg (phi, use, true_e, UNKNOWN_LOCATION);
 }
index b4b76923f6195f35806e29cbd476a796ed5dcdde..601899c4e01796106ed0a40a759cf4613a91941f 100644 (file)
@@ -5010,7 +5010,6 @@ gimple_make_forwarder_block (edge fallthru)
       phi = gsi_stmt (gsi);
       var = gimple_phi_result (phi);
       new_phi = create_phi_node (var, bb);
-      SSA_NAME_DEF_STMT (var) = new_phi;
       gimple_phi_set_result (phi, make_ssa_name (SSA_NAME_VAR (var), phi));
       add_phi_arg (new_phi, gimple_phi_result (phi), fallthru,
                   UNKNOWN_LOCATION);
@@ -5370,8 +5369,8 @@ gimple_duplicate_bb (basic_block bb)
   for (gsi = gsi_start (phis); !gsi_end_p (gsi); gsi_next (&gsi))
     {
       phi = gsi_stmt (gsi);
-      copy = create_phi_node (gimple_phi_result (phi), new_bb);
-      create_new_def_for (gimple_phi_result (copy), copy,
+      copy = create_phi_node (NULL_TREE, new_bb);
+      create_new_def_for (gimple_phi_result (phi), copy,
                          gimple_phi_result_ptr (copy));
     }
 
index 28757d9015e043c743413fa8b9ff7e69953f28c4..82ec14a7a6fc7727341a8e93162864fcfbef26d8 100644 (file)
@@ -720,17 +720,11 @@ update_phi_components (basic_block bb)
 
          lr = get_component_ssa_name (gimple_phi_result (phi), false);
          if (TREE_CODE (lr) == SSA_NAME)
-           {
-             pr = create_phi_node (lr, bb);
-             SSA_NAME_DEF_STMT (lr) = pr;
-           }
+           pr = create_phi_node (lr, bb);
 
          li = get_component_ssa_name (gimple_phi_result (phi), true);
          if (TREE_CODE (li) == SSA_NAME)
-           {
-             pi = create_phi_node (li, bb);
-             SSA_NAME_DEF_STMT (li) = pi;
-           }
+           pi = create_phi_node (li, bb);
 
          for (i = 0, n = gimple_phi_num_args (phi); i < n; ++i)
            {
index ae6027b8a80dd04f20460ad1e952d725a26e6db0..04c3109e94b86f210eed3bfce5a8ee45f5ddf450 100644 (file)
@@ -1941,8 +1941,7 @@ copy_phis_for_bb (basic_block bb, copy_body_data *id)
       if (is_gimple_reg (res))
        {
          walk_tree (&new_res, copy_tree_body_r, id, NULL);
-         SSA_NAME_DEF_STMT (new_res)
-           = new_phi = create_phi_node (new_res, new_bb);
+         new_phi = create_phi_node (new_res, new_bb);
          FOR_EACH_EDGE (new_edge, ei, new_bb->preds)
            {
              edge old_edge = find_edge ((basic_block) new_edge->src->aux, bb);
index b22aa2e90c7500786298d9109c2fa39f6c0374e3..1350d77abbfa16e770e4fa086ec78c9d333d9ff9 100644 (file)
@@ -1039,10 +1039,8 @@ insert_phi_nodes_for (tree var, bitmap phi_insertion_points, bool update_p)
          tree new_lhs;
 
          gcc_assert (update_p);
-         phi = create_phi_node (var, bb);
-
-         new_lhs = duplicate_ssa_name (var, phi);
-         gimple_phi_set_result (phi, new_lhs);
+         new_lhs = duplicate_ssa_name (var, NULL);
+         phi = create_phi_node (new_lhs, bb);
          add_new_name_mapping (new_lhs, var);
 
          /* Add VAR to every argument slot of PHI.  We need VAR in
index 9ccf7dfb3e5b26ed22dc378a4532626efba7346f..25416abb62120abbccef4f981daef1f7e195da54 100644 (file)
@@ -1013,7 +1013,6 @@ create_phi_for_local_result (void **slot, void *data)
                     NULL);
   locus = gimple_location (reduc->reduc_stmt);
   new_phi = create_phi_node (local_res, store_bb);
-  SSA_NAME_DEF_STMT (local_res) = new_phi;
   add_phi_arg (new_phi, reduc->init, e, locus);
   add_phi_arg (new_phi, gimple_assign_lhs (reduc->reduc_stmt),
               FALLTHRU_EDGE (loop->latch), locus);
@@ -1489,7 +1488,6 @@ transform_to_exit_first_loop (struct loop *loop, htab_t reduction_list, tree nit
       t = make_ssa_name (SSA_NAME_VAR (res), phi);
       SET_PHI_RESULT (phi, t);
       nphi = create_phi_node (res, orig_header);
-      SSA_NAME_DEF_STMT (res) = nphi;
       add_phi_arg (nphi, t, hpred, UNKNOWN_LOCATION);
 
       if (res == control)
index d488941f36d1151a124e7557edd7f2af3b489865..4bb10e59ac73d3dc55a4154817429876f21b737c 100644 (file)
@@ -189,7 +189,9 @@ make_phi_node (tree var, int len)
   gimple_init_singleton (phi);
   phi->gimple_phi.nargs = len;
   phi->gimple_phi.capacity = capacity;
-  if (TREE_CODE (var) == SSA_NAME)
+  if (!var)
+    ;
+  else if (TREE_CODE (var) == SSA_NAME)
     gimple_phi_set_result (phi, var);
   else
     gimple_phi_set_result (phi, make_ssa_name (var, phi));
index 1cde8bd9ee0919e6ff8513c246f085d7b126851e..a0d5d3ea14c3e2947f53f16c25ff768e6cea2b9b 100644 (file)
@@ -1495,7 +1495,6 @@ initialize_root_vars (struct loop *loop, chain_p chain, bitmap tmp_vars)
        gsi_insert_seq_on_edge_immediate (entry, stmts);
 
       phi = create_phi_node (var, loop->header);
-      SSA_NAME_DEF_STMT (var) = phi;
       add_phi_arg (phi, init, entry, UNKNOWN_LOCATION);
       add_phi_arg (phi, next, latch, UNKNOWN_LOCATION);
     }
@@ -1559,7 +1558,6 @@ initialize_root_vars_lm (struct loop *loop, dref root, bool written,
     {
       next = VEC_index (tree, *vars, 1);
       phi = create_phi_node (var, loop->header);
-      SSA_NAME_DEF_STMT (var) = phi;
       add_phi_arg (phi, init, entry, UNKNOWN_LOCATION);
       add_phi_arg (phi, next, latch, UNKNOWN_LOCATION);
     }
index 74eda3cf19f1b4f96dea819f61d6a91a39031d80..0ddc56f832a467495daf9868cbdbd57368405f5c 100644 (file)
@@ -116,7 +116,6 @@ create_iv (tree base, tree step, tree var, struct loop *loop,
     gsi_insert_seq_on_edge_immediate (pe, stmts);
 
   stmt = create_phi_node (vb, loop->header);
-  SSA_NAME_DEF_STMT (vb) = stmt;
   add_phi_arg (stmt, initial, loop_preheader_edge (loop), UNKNOWN_LOCATION);
   add_phi_arg (stmt, va, loop_latch_edge (loop), UNKNOWN_LOCATION);
 }
@@ -144,9 +143,8 @@ add_exit_phis_edge (basic_block exit, tree use)
   if (!e)
     return;
 
-  phi = create_phi_node (use, exit);
-  create_new_def_for (gimple_phi_result (phi), phi,
-                     gimple_phi_result_ptr (phi));
+  phi = create_phi_node (NULL_TREE, exit);
+  create_new_def_for (use, phi, gimple_phi_result_ptr (phi));
   FOR_EACH_EDGE (e, ei, exit->preds)
     add_phi_arg (phi, use, e, UNKNOWN_LOCATION);
 }
@@ -499,7 +497,6 @@ split_loop_exit_edge (edge exit)
         of the SSA name out of the loop.  */
       new_name = duplicate_ssa_name (name, NULL);
       new_phi = create_phi_node (new_name, bb);
-      SSA_NAME_DEF_STMT (new_name) = new_phi;
       add_phi_arg (new_phi, name, exit, locus);
       SET_USE (op_p, new_name);
     }
@@ -1012,7 +1009,6 @@ tree_transform_and_unroll_loop (struct loop *loop, unsigned factor,
 
       new_init = make_ssa_name (var, NULL);
       phi_rest = create_phi_node (new_init, rest);
-      SSA_NAME_DEF_STMT (new_init) = phi_rest;
 
       add_phi_arg (phi_rest, init, precond_edge, UNKNOWN_LOCATION);
       add_phi_arg (phi_rest, next, new_exit, UNKNOWN_LOCATION);
index 2b77ec3ec26144f9d98626a2ed8a0bea093d8b52..cc2b89364c9c16de67f7d4326ee7e382aebf859f 100644 (file)
@@ -141,7 +141,7 @@ phiprop_insert_phi (basic_block bb, gimple phi, gimple use_stmt,
   /* Build a new PHI node to replace the definition of
      the indirect reference lhs.  */
   res = gimple_assign_lhs (use_stmt);
-  SSA_NAME_DEF_STMT (res) = new_phi = create_phi_node (res, bb);
+  new_phi = create_phi_node (res, bb);
 
   if (dump_file && (dump_flags & TDF_DETAILS))
     {
index 548d1b6aa2ebe04328e9b33dd45c637f7819c9d3..b5356f5edbf61cc2f7593c9d3a1cf208b8268d3e 100644 (file)
@@ -975,7 +975,6 @@ tree_optimize_tail_calls_1 (bool opt_tailcalls)
 
                set_ssa_default_def (cfun, param, new_name);
                phi = create_phi_node (name, first);
-               SSA_NAME_DEF_STMT (name) = phi;
                add_phi_arg (phi, new_name, single_pred_edge (first),
                             EXPR_LOCATION (param));
              }
index 3223f4b34de968213071516ddb4ce26caa8b1d50..e123bea88a0f30f84e03871e3e857b0594b7d98f 100644 (file)
@@ -4446,7 +4446,6 @@ vect_setup_realignment (gimple stmt, gimple_stmt_iterator *gsi,
   vec_dest = vect_create_destination_var (scalar_dest, vectype);
   msq = make_ssa_name (vec_dest, NULL);
   phi_stmt = create_phi_node (msq, containing_loop->header);
-  SSA_NAME_DEF_STMT (msq) = phi_stmt;
   add_phi_arg (phi_stmt, msq_init, pe, UNKNOWN_LOCATION);
 
   return msq;
index 6f57e7008be153906790ebd3b1ffc98873f1ece9..6044dd74e188cf4141d71cdea96816e3d804dce6 100644 (file)
@@ -1275,7 +1275,6 @@ gimple_ic (gimple icall_stmt, struct cgraph_node *direct_call,
     {
       tree result = gimple_call_lhs (icall_stmt);
       gimple phi = create_phi_node (result, join_bb);
-      SSA_NAME_DEF_STMT (result) = phi;
       gimple_call_set_lhs (icall_stmt,
                           make_ssa_name (SSA_NAME_VAR (result), icall_stmt));
       add_phi_arg (phi, gimple_call_lhs (icall_stmt), e_ij, UNKNOWN_LOCATION);
@@ -1507,7 +1506,6 @@ gimple_stringop_fixed_value (gimple vcall_stmt, tree icall_size, int prob,
     {
       tree result = gimple_call_lhs (vcall_stmt);
       gimple phi = create_phi_node (result, join_bb);
-      SSA_NAME_DEF_STMT (result) = phi;
       gimple_call_set_lhs (vcall_stmt,
                           make_ssa_name (SSA_NAME_VAR (result), vcall_stmt));
       add_phi_arg (phi, gimple_call_lhs (vcall_stmt), e_vj, UNKNOWN_LOCATION);