summaryrefslogtreecommitdiff
path: root/gcc/tree-vn.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-vn.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-vn.c')
-rw-r--r--gcc/tree-vn.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/gcc/tree-vn.c b/gcc/tree-vn.c
index a23d7beb467..0c5061f70fc 100644
--- a/gcc/tree-vn.c
+++ b/gcc/tree-vn.c
@@ -107,19 +107,6 @@ set_value_handle (tree e, tree v)
gcc_assert (is_gimple_min_invariant (e));
}
-/* A comparison function for use in qsort to compare vuses. Simply
- subtracts version numbers. */
-
-static int
-vuses_compare (const void *pa, const void *pb)
-{
- const tree vusea = *((const tree *)pa);
- const tree vuseb = *((const tree *)pb);
- int sn = SSA_NAME_VERSION (vusea) - SSA_NAME_VERSION (vuseb);
-
- return sn;
-}
-
/* Print out the "Created value <x> for <Y>" statement to the
dump_file.
This is factored because both versions of lookup use it, and it
@@ -161,7 +148,7 @@ sort_vuses (VEC (tree,gc) *vuses)
qsort (VEC_address (tree, vuses),
VEC_length (tree, vuses),
sizeof (tree),
- vuses_compare);
+ operand_build_cmp);
}
/* Sort the VUSE array so that we can do equality comparisons
@@ -174,7 +161,7 @@ sort_vuses_heap (VEC (tree,heap) *vuses)
qsort (VEC_address (tree, vuses),
VEC_length (tree, vuses),
sizeof (tree),
- vuses_compare);
+ operand_build_cmp);
}
/* Insert EXPR into VALUE_TABLE with value VAL, and add expression
EXPR to the value set for value VAL. */