summaryrefslogtreecommitdiff
path: root/gcc/tree-outof-ssa.c
diff options
context:
space:
mode:
authoramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-05 14:13:56 +0000
committeramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-05 14:13:56 +0000
commitf5ea8c530cdc4e8a16a7f69f38b0eaa613a35036 (patch)
treefa68845ee02d5d3d6eeca638d0ed925c3481f017 /gcc/tree-outof-ssa.c
parentcce95bcb3f3aa03d4dd82208732d0cb453637ea8 (diff)
downloadgcc-f5ea8c530cdc4e8a16a7f69f38b0eaa613a35036.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204393 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-outof-ssa.c')
-rw-r--r--gcc/tree-outof-ssa.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/gcc/tree-outof-ssa.c b/gcc/tree-outof-ssa.c
index 1e982857e14..4dc3f9e4a8d 100644
--- a/gcc/tree-outof-ssa.c
+++ b/gcc/tree-outof-ssa.c
@@ -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. */