Commit bb7e83fc by Andi Kleen Committed by Andi Kleen

Convert tree-ssa-tail-merge to inchash

gcc/:

2014-07-31  Andi Kleen  <ak@linux.intel.com>

	* tree-ssa-tail-merge.c (same_succ_hash): Convert to inchash.

From-SVN: r213400
parent 4e44a6e8
2014-07-31 Andi Kleen <ak@linux.intel.com> 2014-07-31 Andi Kleen <ak@linux.intel.com>
* tree-ssa-tail-merge.c (same_succ_hash): Convert to inchash.
2014-07-31 Andi Kleen <ak@linux.intel.com>
* tree-ssa-sccvn.c (vn_reference_op_compute_hash): Convert to * tree-ssa-sccvn.c (vn_reference_op_compute_hash): Convert to
inchash. inchash.
(vn_reference_compute_hash): Dito. (vn_reference_compute_hash): Dito.
......
...@@ -451,7 +451,7 @@ stmt_update_dep_bb (gimple stmt) ...@@ -451,7 +451,7 @@ stmt_update_dep_bb (gimple stmt)
static hashval_t static hashval_t
same_succ_hash (const_same_succ e) same_succ_hash (const_same_succ e)
{ {
hashval_t hashval = bitmap_hash (e->succs); inchash::hash hstate (bitmap_hash (e->succs));
int flags; int flags;
unsigned int i; unsigned int i;
unsigned int first = bitmap_first_set_bit (e->bbs); unsigned int first = bitmap_first_set_bit (e->bbs);
...@@ -472,37 +472,35 @@ same_succ_hash (const_same_succ e) ...@@ -472,37 +472,35 @@ same_succ_hash (const_same_succ e)
continue; continue;
size++; size++;
hashval = iterative_hash_hashval_t (gimple_code (stmt), hashval); hstate.add_int (gimple_code (stmt));
if (is_gimple_assign (stmt)) if (is_gimple_assign (stmt))
hashval = iterative_hash_hashval_t (gimple_assign_rhs_code (stmt), hstate.add_int (gimple_assign_rhs_code (stmt));
hashval);
if (!is_gimple_call (stmt)) if (!is_gimple_call (stmt))
continue; continue;
if (gimple_call_internal_p (stmt)) if (gimple_call_internal_p (stmt))
hashval = iterative_hash_hashval_t hstate.add_int (gimple_call_internal_fn (stmt));
((hashval_t) gimple_call_internal_fn (stmt), hashval);
else else
{ {
hashval = iterative_hash_expr (gimple_call_fn (stmt), hashval); inchash::add_expr (gimple_call_fn (stmt), hstate);
if (gimple_call_chain (stmt)) if (gimple_call_chain (stmt))
hashval = iterative_hash_expr (gimple_call_chain (stmt), hashval); inchash::add_expr (gimple_call_chain (stmt), hstate);
} }
for (i = 0; i < gimple_call_num_args (stmt); i++) for (i = 0; i < gimple_call_num_args (stmt); i++)
{ {
arg = gimple_call_arg (stmt, i); arg = gimple_call_arg (stmt, i);
arg = vn_valueize (arg); arg = vn_valueize (arg);
hashval = iterative_hash_expr (arg, hashval); inchash::add_expr (arg, hstate);
} }
} }
hashval = iterative_hash_hashval_t (size, hashval); hstate.add_int (size);
BB_SIZE (bb) = size; BB_SIZE (bb) = size;
for (i = 0; i < e->succ_flags.length (); ++i) for (i = 0; i < e->succ_flags.length (); ++i)
{ {
flags = e->succ_flags[i]; flags = e->succ_flags[i];
flags = flags & ~(EDGE_TRUE_VALUE | EDGE_FALSE_VALUE); flags = flags & ~(EDGE_TRUE_VALUE | EDGE_FALSE_VALUE);
hashval = iterative_hash_hashval_t (flags, hashval); hstate.add_int (flags);
} }
EXECUTE_IF_SET_IN_BITMAP (e->succs, 0, s, bs) EXECUTE_IF_SET_IN_BITMAP (e->succs, 0, s, bs)
...@@ -521,7 +519,7 @@ same_succ_hash (const_same_succ e) ...@@ -521,7 +519,7 @@ same_succ_hash (const_same_succ e)
} }
} }
return hashval; return hstate.end ();
} }
/* Returns true if E1 and E2 have 2 successors, and if the successor flags /* Returns true if E1 and E2 have 2 successors, and if the successor flags
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment