+2017-10-22 Richard Sandiford <richard.sandiford@linaro.org>
+
+ * inchash.h (inchash::hash::add_wide_int): Rename to...
+ (inchash::hash::add_hwi): ...this.
+ * ipa-devirt.c (hash_odr_vtable): Update accordingly.
+ (polymorphic_call_target_hasher::hash): Likewise.
+ * ipa-icf.c (sem_function::get_hash, sem_function::init): Likewise.
+ (sem_item::add_expr, sem_item::add_type, sem_variable::get_hash)
+ (sem_item_optimizer::update_hash_by_addr_refs): Likewise.
+ * lto-streamer-out.c (hash_tree): Likewise.
+ * optc-save-gen.awk: Likewise.
+ * tree.c (add_expr): Likewise.
+
2017-10-22 Uros Bizjak <ubizjak@gmail.com>
PR target/52451
}
/* Add HOST_WIDE_INT value V. */
- void add_wide_int (HOST_WIDE_INT v)
+ void add_hwi (HOST_WIDE_INT v)
{
val = iterative_hash_host_wide_int (v, val);
}
v = TREE_OPERAND (TREE_OPERAND (v, 0), 0);
}
- hstate.add_wide_int (IDENTIFIER_HASH_VALUE (DECL_ASSEMBLER_NAME (v)));
+ hstate.add_hwi (IDENTIFIER_HASH_VALUE (DECL_ASSEMBLER_NAME (v)));
return hstate.end ();
}
{
inchash::hash hstate (odr_query->otr_token);
- hstate.add_wide_int (odr_query->type->id);
+ hstate.add_hwi (odr_query->type->id);
hstate.merge_hash (TYPE_UID (odr_query->context.outer_type));
- hstate.add_wide_int (odr_query->context.offset);
+ hstate.add_hwi (odr_query->context.offset);
if (odr_query->context.speculative_outer_type)
{
hstate.merge_hash (TYPE_UID (odr_query->context.speculative_outer_type));
- hstate.add_wide_int (odr_query->context.speculative_offset);
+ hstate.add_hwi (odr_query->context.speculative_offset);
}
hstate.add_flag (odr_query->speculative);
hstate.add_flag (odr_query->context.maybe_in_construction);
/* Add common features of declaration itself. */
if (DECL_FUNCTION_SPECIFIC_TARGET (decl))
- hstate.add_wide_int
+ hstate.add_hwi
(cl_target_option_hash
(TREE_TARGET_OPTION (DECL_FUNCTION_SPECIFIC_TARGET (decl))));
if (DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl))
- hstate.add_wide_int
+ hstate.add_hwi
(cl_optimization_hash
(TREE_OPTIMIZATION (DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl))));
hstate.add_flag (DECL_CXX_CONSTRUCTOR_P (decl));
{
cfg_checksum = 0;
inchash::hash hstate;
- hstate.add_wide_int (cnode->thunk.fixed_offset);
- hstate.add_wide_int (cnode->thunk.virtual_value);
+ hstate.add_hwi (cnode->thunk.fixed_offset);
+ hstate.add_hwi (cnode->thunk.virtual_value);
hstate.add_flag (cnode->thunk.this_adjusting);
hstate.add_flag (cnode->thunk.virtual_offset_p);
hstate.add_flag (cnode->thunk.add_pointer_bounds_args);
unsigned HOST_WIDE_INT idx;
tree value;
- hstate.add_wide_int (int_size_in_bytes (TREE_TYPE (exp)));
+ hstate.add_hwi (int_size_in_bytes (TREE_TYPE (exp)));
FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (exp), idx, value)
if (value)
case VAR_DECL:
case CONST_DECL:
case PARM_DECL:
- hstate.add_wide_int (int_size_in_bytes (TREE_TYPE (exp)));
+ hstate.add_hwi (int_size_in_bytes (TREE_TYPE (exp)));
break;
case MEM_REF:
case POINTER_PLUS_EXPR:
}
break;
CASE_CONVERT:
- hstate.add_wide_int (int_size_in_bytes (TREE_TYPE (exp)));
+ hstate.add_hwi (int_size_in_bytes (TREE_TYPE (exp)));
return add_expr (TREE_OPERAND (exp, 0), hstate);
default:
break;
hstate2.add_int (nf);
hash = hstate2.end ();
- hstate.add_wide_int (hash);
+ hstate.add_hwi (hash);
optimizer->m_type_hash_cache.put (type, hash);
}
else
- hstate.add_wide_int (*val);
+ hstate.add_hwi (*val);
}
}
hstate.add_int (456346417);
if (DECL_SIZE (decl) && tree_fits_shwi_p (DECL_SIZE (decl)))
- hstate.add_wide_int (tree_to_shwi (DECL_SIZE (decl)));
+ hstate.add_hwi (tree_to_shwi (DECL_SIZE (decl)));
add_expr (ctor, hstate);
set_hash (hstate.end ());
if (TYPE_NAME (class_type)
&& DECL_ASSEMBLER_NAME_SET_P (TYPE_NAME (class_type)))
- hstate.add_wide_int
+ hstate.add_hwi
(IDENTIFIER_HASH_VALUE
(DECL_ASSEMBLER_NAME (TYPE_NAME (class_type))));
if (CODE_CONTAINS_STRUCT (code, TS_INT_CST))
{
int i;
- hstate.add_wide_int (TREE_INT_CST_NUNITS (t));
- hstate.add_wide_int (TREE_INT_CST_EXT_NUNITS (t));
+ hstate.add_hwi (TREE_INT_CST_NUNITS (t));
+ hstate.add_hwi (TREE_INT_CST_EXT_NUNITS (t));
for (i = 0; i < TREE_INT_CST_NUNITS (t); i++)
- hstate.add_wide_int (TREE_INT_CST_ELT (t, i));
+ hstate.add_hwi (TREE_INT_CST_ELT (t, i));
}
if (CODE_CONTAINS_STRUCT (code, TS_REAL_CST))
if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON))
{
- hstate.add_wide_int (DECL_MODE (t));
+ hstate.add_hwi (DECL_MODE (t));
hstate.add_flag (DECL_NONLOCAL (t));
hstate.add_flag (DECL_VIRTUAL_P (t));
hstate.add_flag (DECL_IGNORED_P (t));
if (CODE_CONTAINS_STRUCT (code, TS_TYPE_COMMON))
{
- hstate.add_wide_int (TYPE_MODE (t));
+ hstate.add_hwi (TYPE_MODE (t));
hstate.add_flag (TYPE_STRING_FLAG (t));
/* TYPE_NO_FORCE_BLK is private to stor-layout and need
no streaming. */
if (CODE_CONTAINS_STRUCT (code, TS_TARGET_OPTION)
/* We don't stream these when passing things to a different target. */
&& !lto_stream_offload_p)
- hstate.add_wide_int (cl_target_option_hash (TREE_TARGET_OPTION (t)));
+ hstate.add_hwi (cl_target_option_hash (TREE_TARGET_OPTION (t)));
if (CODE_CONTAINS_STRUCT (code, TS_OPTIMIZATION))
- hstate.add_wide_int (cl_optimization_hash (TREE_OPTIMIZATION (t)));
+ hstate.add_hwi (cl_optimization_hash (TREE_OPTIMIZATION (t)));
if (CODE_CONTAINS_STRUCT (code, TS_IDENTIFIER))
hstate.merge_hash (IDENTIFIER_HASH_VALUE (t));
if (CODE_CONTAINS_STRUCT (code, TS_EXP))
{
- hstate.add_wide_int (TREE_OPERAND_LENGTH (t));
+ hstate.add_hwi (TREE_OPERAND_LENGTH (t));
for (int i = 0; i < TREE_OPERAND_LENGTH (t); ++i)
visit (TREE_OPERAND (t, i));
}
{
unsigned i;
tree index, value;
- hstate.add_wide_int (CONSTRUCTOR_NELTS (t));
+ hstate.add_hwi (CONSTRUCTOR_NELTS (t));
FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (t), i, index, value)
{
visit (index);
int i;
HOST_WIDE_INT val;
- hstate.add_wide_int (OMP_CLAUSE_CODE (t));
+ hstate.add_hwi (OMP_CLAUSE_CODE (t));
switch (OMP_CLAUSE_CODE (t))
{
case OMP_CLAUSE_DEFAULT:
val = 0;
break;
}
- hstate.add_wide_int (val);
+ hstate.add_hwi (val);
for (i = 0; i < omp_clause_num_ops[OMP_CLAUSE_CODE (t)]; i++)
visit (OMP_CLAUSE_OPERAND (t, i));
visit (OMP_CLAUSE_CHAIN (t));
}
for (i = 0; i < n_target_val; i++) {
name = var_target_val[i]
- print " hstate.add_wide_int (ptr->" name");";
+ print " hstate.add_hwi (ptr->" name");";
}
print " return hstate.end ();";
print "}";
if (!var_opt_hash[i])
continue;
name = var_opt_val[i]
- print " hstate.add_wide_int (ptr->" name");";
+ print " hstate.add_hwi (ptr->" name");";
}
print " return hstate.end ();";
print "}";
case INTEGER_CST:
gcc_checking_assert (!(flags & OEP_ADDRESS_OF));
for (i = 0; i < TREE_INT_CST_EXT_NUNITS (t); i++)
- hstate.add_wide_int (TREE_INT_CST_ELT (t, i));
+ hstate.add_hwi (TREE_INT_CST_ELT (t, i));
return;
case REAL_CST:
{
}
case SSA_NAME:
/* We can just compare by pointer. */
- hstate.add_wide_int (SSA_NAME_VERSION (t));
+ hstate.add_hwi (SSA_NAME_VERSION (t));
return;
case PLACEHOLDER_EXPR:
/* The node itself doesn't matter. */
if (tclass == tcc_declaration)
{
/* DECL's have a unique ID */
- hstate.add_wide_int (DECL_UID (t));
+ hstate.add_hwi (DECL_UID (t));
}
else if (tclass == tcc_comparison && !commutative_tree_code (code))
{