tree-outof-ssa.c (queue_phi_copy_p): Combine phi_ssa_name_p from gimple.h and the...
authorAndrew MacLeod <amacleod@redhat.com>
Tue, 5 Nov 2013 14:13:56 +0000 (14:13 +0000)
committerAndrew Macleod <amacleod@gcc.gnu.org>
Tue, 5 Nov 2013 14:13:56 +0000 (14:13 +0000)
2013-11-05  Andrew MacLeod  <amacleod@redhat.com>

* tree-outof-ssa.c (queue_phi_copy_p): Combine phi_ssa_name_p from
gimple.h and the rest of the condition in eliminate_build.
(eliminate_build): Call new routine.
* gimple.h (phi_ssa_name_p): Delete.

From-SVN: r204393

gcc/ChangeLog
gcc/gimple.h
gcc/tree-outof-ssa.c

index e388ec9660d961637aab181bd2435afd1006d8e4..6dd16fc34f1b9e36b05d46f38765636fd7989720 100644 (file)
@@ -1,3 +1,10 @@
+2013-11-05  Andrew MacLeod  <amacleod@redhat.com>
+
+       * tree-outof-ssa.c (queue_phi_copy_p): Combine phi_ssa_name_p from 
+       gimple.h and the rest of the condition in eliminate_build.
+       (eliminate_build): Call new routine.
+       * gimple.h (phi_ssa_name_p): Delete.
+
 2013-11-05  Trevor Saunders  <tsaunders@mozilla.com>
 
        * vec.c (vec_prefix::calculate_allocation): Don't try to handle the
index b34424c18d3560aa2a410fb57e44953255c3d7fc..90773c00524ec0901d936d9847470738ec33fdec 100644 (file)
@@ -3633,19 +3633,6 @@ gimple_phi_set_arg (gimple gs, unsigned index, struct phi_arg_d * phiarg)
   gs->gimple_phi.args[index] = *phiarg;
 }
 
-/* PHI nodes should contain only ssa_names and invariants.  A test
-   for ssa_name is definitely simpler; don't let invalid contents
-   slip in in the meantime.  */
-
-static inline bool
-phi_ssa_name_p (const_tree t)
-{
-  if (TREE_CODE (t) == SSA_NAME)
-    return true;
-  gcc_checking_assert (is_gimple_min_invariant (t));
-  return false;
-}
-
 /* Return the PHI nodes for basic block BB, or NULL if there are no
    PHI nodes.  */
 
index 1e982857e14122e55751ddb8dd569ecc05268602..4dc3f9e4a8d9cf8ac26eb877cb9861f79899dc4e 100644 (file)
@@ -548,6 +548,23 @@ eliminate_name (elim_graph g, int T)
   elim_graph_add_node (g, T);
 }
 
+/* Return true if this phi argument T should have a copy queued when using
+   var_map MAP.  PHI nodes should contain only ssa_names and invariants.  A
+   test for ssa_name is definitely simpler, but don't let invalid contents
+   slip through in the meantime.  */
+
+static inline bool
+queue_phi_copy_p (var_map map, tree t)
+{
+  if (TREE_CODE (t) == SSA_NAME)
+    { 
+      if (var_to_partition (map, t) == NO_PARTITION)
+        return true;
+      return false;
+    }
+  gcc_checking_assert (is_gimple_min_invariant (t));
+  return true;
+}
 
 /* Build elimination graph G for basic block BB on incoming PHI edge
    G->e.  */
@@ -577,9 +594,7 @@ eliminate_build (elim_graph g)
       /* If this argument is a constant, or a SSA_NAME which is being
         left in SSA form, just queue a copy to be emitted on this
         edge.  */
-      if (!phi_ssa_name_p (Ti)
-         || (TREE_CODE (Ti) == SSA_NAME
-             && var_to_partition (g->map, Ti) == NO_PARTITION))
+      if (queue_phi_copy_p (g->map, Ti))
         {
          /* Save constant copies until all other copies have been emitted
             on this edge.  */