diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-01-07 14:49:36 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-01-07 14:49:36 +0000 |
commit | 3ee3dfa4447aab6c7d4ee1ab1039e20e2c6fe6c5 (patch) | |
tree | f69fbfc7468d0e14fa1e4c2b833a1807785c2f97 /gcc/tree-ssa-sccvn.c | |
parent | ca03fed05ea8f42219cae8958a6d3206d56b297b (diff) | |
download | gcc-3ee3dfa4447aab6c7d4ee1ab1039e20e2c6fe6c5.tar.gz |
2008-01-07 Richard Guenther <rguenther@suse.de>
PR tree-optimization/34683
* tree-ssa-sccvn.c (vuses_to_vec): Pre-allocate the vector of
VOPs of the needed size to save memory. Use VEC_quick_push
to save compile-time.
(vdefs_to_vec): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131375 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-sccvn.c')
-rw-r--r-- | gcc/tree-ssa-sccvn.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index a14c2a749cf..035c81120b8 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -389,8 +389,10 @@ 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)); + FOR_EACH_SSA_TREE_OPERAND (vuse, stmt, iter, SSA_OP_VIRTUAL_USES) - VEC_safe_push (tree, gc, *result, vuse); + VEC_quick_push (tree, *result, vuse); if (VEC_length (tree, *result) > 1) sort_vuses (*result); @@ -421,8 +423,10 @@ vdefs_to_vec (tree stmt, VEC (tree, gc) **result) if (!stmt) return; + *result = VEC_alloc (tree, gc, num_ssa_operands (stmt, SSA_OP_VIRTUAL_DEFS)); + FOR_EACH_SSA_TREE_OPERAND (vdef, stmt, iter, SSA_OP_VIRTUAL_DEFS) - VEC_safe_push (tree, gc, *result, vdef); + VEC_quick_push (tree, *result, vdef); if (VEC_length (tree, *result) > 1) sort_vuses (*result); |