aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-if-conv.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2015-06-25 17:15:44 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2015-06-25 17:15:44 +0000
commitd6a818c59e002f76f237ad305bf4b73a415dcb3c (patch)
treeeb230717d9cde4170f937a1e9235ca357475e5be /gcc/tree-if-conv.c
parent4ef7b52a932fffd5a43c26183515dcafc735c9a2 (diff)
downloadgcc-d6a818c59e002f76f237ad305bf4b73a415dcb3c.zip
gcc-d6a818c59e002f76f237ad305bf4b73a415dcb3c.tar.gz
gcc-d6a818c59e002f76f237ad305bf4b73a415dcb3c.tar.bz2
tree-hash-traits.h: New file.
gcc/ * tree-hash-traits.h: New file. (tree_operand_hash): New class. * sanopt.c: Include tree-hash-traits.h. (sanopt_tree_map_traits): Use tree_operand_hash. * tree-if-conv.c: Include tree-hash-traits.h. (phi_args_hash_traits): Use tree_operand_hash. * tree-ssa-uncprop.c: Include tree-hash-traits.h. (val_ssa_equiv_hash_traits): Use tree_operand_hash. From-SVN: r224967
Diffstat (limited to 'gcc/tree-if-conv.c')
-rw-r--r--gcc/tree-if-conv.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index e0ac936..59853c8 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -133,6 +133,7 @@ along with GCC; see the file COPYING3. If not see
#include "expr.h"
#include "insn-codes.h"
#include "optabs.h"
+#include "tree-hash-traits.h"
/* List of basic blocks in if-conversion-suitable order. */
static basic_block *ifc_bbs;
@@ -1588,27 +1589,9 @@ convert_scalar_cond_reduction (gimple reduc, gimple_stmt_iterator *gsi,
return rhs;
}
-/* Helpers for PHI arguments hashtable map. */
+typedef simple_hashmap_traits <tree_operand_hash> phi_args_hash_traits;
-struct phi_args_hash_traits : default_hashmap_traits
-{
- static inline hashval_t hash (tree);
- static inline bool equal_keys (tree, tree);
-};
-
-inline hashval_t
-phi_args_hash_traits::hash (tree value)
-{
- return iterative_hash_expr (value, 0);
-}
-
-inline bool
-phi_args_hash_traits::equal_keys (tree value1, tree value2)
-{
- return operand_equal_p (value1, value2, 0);
-}
-
- /* Produce condition for all occurrences of ARG in PHI node. */
+/* Produce condition for all occurrences of ARG in PHI node. */
static tree
gen_phi_arg_condition (gphi *phi, vec<int> *occur,