summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-sccvn.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-01-08 16:29:14 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-01-08 16:29:14 +0000
commit911908dca6d055235a653b76fc6826747c9a1f23 (patch)
treeecfed3abf31acdafc39792d76273a9ef575c689c /gcc/tree-ssa-sccvn.c
parentcfbdd7def6579707128299d6429c1273e778a97f (diff)
downloadgcc-911908dca6d055235a653b76fc6826747c9a1f23.tar.gz
2008-01-08 Richard Guenther <rguenther@suse.de>
PR tree-optimization/34683 * tree-ssa-operands.c (operand_build_cmp): Export. * tree-ssa-operands.h (operand_build_cmp): Declare. * tree-vn.c (vuses_compare): Remove. (sort_vuses): Use operand_build_cmp. (sort_vuses_heap): Likewise. * tree-ssa-sccvn.c (vuses_to_vec): Use VEC_reserve, not VEC_alloc to re-use old VEC if available. Do not sort already sorted VUSEs. (vdefs_to_vec): Do not sort already sorted VDEFs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131400 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-sccvn.c')
-rw-r--r--gcc/tree-ssa-sccvn.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 035c81120b8..e1d4af11fee 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -389,13 +389,11 @@ vuses_to_vec (tree stmt, VEC (tree, gc) **result)
if (!stmt)
return;
- *result = VEC_alloc (tree, gc, num_ssa_operands (stmt, SSA_OP_VIRTUAL_USES));
+ VEC_reserve_exact (tree, gc, *result,
+ num_ssa_operands (stmt, SSA_OP_VIRTUAL_USES));
FOR_EACH_SSA_TREE_OPERAND (vuse, stmt, iter, SSA_OP_VIRTUAL_USES)
VEC_quick_push (tree, *result, vuse);
-
- if (VEC_length (tree, *result) > 1)
- sort_vuses (*result);
}
@@ -427,9 +425,6 @@ vdefs_to_vec (tree stmt, VEC (tree, gc) **result)
FOR_EACH_SSA_TREE_OPERAND (vdef, stmt, iter, SSA_OP_VIRTUAL_DEFS)
VEC_quick_push (tree, *result, vdef);
-
- if (VEC_length (tree, *result) > 1)
- sort_vuses (*result);
}
/* Copy the names of vdef results in STMT into a vector, and return