Commit c02ae3ae by Jan Hubicka Committed by Jan Hubicka

tree-profile.c (init_ic_make_global_vars): Drop workaround for bintuils bug 14342.


	* tree-profile.c (init_ic_make_global_vars): Drop workaround
	for bintuils bug 14342.
	(init_ic_make_global_vars): Likewise.
	(gimple_init_edge_profiler): Likewise.
	(gimple_gen_ic_func_profiler): Likewise.

From-SVN: r219574
parent 9e145afd
2015-01-13 Jan Hubicka <hubicka@ucw.cz>
* tree-profile.c (init_ic_make_global_vars): Drop workaround
for bintuils bug 14342.
(init_ic_make_global_vars): Likewise.
(gimple_init_edge_profiler): Likewise.
(gimple_gen_ic_func_profiler): Likewise.
2015-01-15 Naveen H.S <Naveen.Hurugalawadi@caviumnetworks.com> 2015-01-15 Naveen H.S <Naveen.Hurugalawadi@caviumnetworks.com>
* ipa-inline.c (inline_small_functions): Swap the operands in * ipa-inline.c (inline_small_functions): Swap the operands in
......
...@@ -105,30 +105,15 @@ init_ic_make_global_vars (void) ...@@ -105,30 +105,15 @@ init_ic_make_global_vars (void)
ptr_void = build_pointer_type (void_type_node); ptr_void = build_pointer_type (void_type_node);
/* Workaround for binutils bug 14342. Once it is fixed, remove lto path. */ ic_void_ptr_var
if (flag_lto) = build_decl (UNKNOWN_LOCATION, VAR_DECL,
{ get_identifier (
ic_void_ptr_var (PARAM_VALUE (PARAM_INDIR_CALL_TOPN_PROFILE) ?
= build_decl (UNKNOWN_LOCATION, VAR_DECL, "__gcov_indirect_call_topn_callee" :
get_identifier ("__gcov_indirect_call_callee_ltopriv"), "__gcov_indirect_call_callee")),
ptr_void); ptr_void);
TREE_PUBLIC (ic_void_ptr_var) = 1; TREE_PUBLIC (ic_void_ptr_var) = 1;
DECL_COMMON (ic_void_ptr_var) = 1; DECL_EXTERNAL (ic_void_ptr_var) = 1;
DECL_VISIBILITY (ic_void_ptr_var) = VISIBILITY_HIDDEN;
DECL_VISIBILITY_SPECIFIED (ic_void_ptr_var) = true;
}
else
{
ic_void_ptr_var
= build_decl (UNKNOWN_LOCATION, VAR_DECL,
get_identifier (
(PARAM_VALUE (PARAM_INDIR_CALL_TOPN_PROFILE) ?
"__gcov_indirect_call_topn_callee" :
"__gcov_indirect_call_callee")),
ptr_void);
TREE_PUBLIC (ic_void_ptr_var) = 1;
DECL_EXTERNAL (ic_void_ptr_var) = 1;
}
TREE_STATIC (ic_void_ptr_var) = 1; TREE_STATIC (ic_void_ptr_var) = 1;
DECL_ARTIFICIAL (ic_void_ptr_var) = 1; DECL_ARTIFICIAL (ic_void_ptr_var) = 1;
DECL_INITIAL (ic_void_ptr_var) = NULL; DECL_INITIAL (ic_void_ptr_var) = NULL;
...@@ -138,30 +123,16 @@ init_ic_make_global_vars (void) ...@@ -138,30 +123,16 @@ init_ic_make_global_vars (void)
varpool_node::finalize_decl (ic_void_ptr_var); varpool_node::finalize_decl (ic_void_ptr_var);
gcov_type_ptr = build_pointer_type (get_gcov_type ()); gcov_type_ptr = build_pointer_type (get_gcov_type ());
/* Workaround for binutils bug 14342. Once it is fixed, remove lto path. */
if (flag_lto) ic_gcov_type_ptr_var
{ = build_decl (UNKNOWN_LOCATION, VAR_DECL,
ic_gcov_type_ptr_var get_identifier (
= build_decl (UNKNOWN_LOCATION, VAR_DECL, (PARAM_VALUE (PARAM_INDIR_CALL_TOPN_PROFILE) ?
get_identifier ("__gcov_indirect_call_counters_ltopriv"), "__gcov_indirect_call_topn_counters" :
gcov_type_ptr); "__gcov_indirect_call_counters")),
TREE_PUBLIC (ic_gcov_type_ptr_var) = 1; gcov_type_ptr);
DECL_COMMON (ic_gcov_type_ptr_var) = 1; TREE_PUBLIC (ic_gcov_type_ptr_var) = 1;
DECL_VISIBILITY (ic_gcov_type_ptr_var) = VISIBILITY_HIDDEN; DECL_EXTERNAL (ic_gcov_type_ptr_var) = 1;
DECL_VISIBILITY_SPECIFIED (ic_gcov_type_ptr_var) = true;
}
else
{
ic_gcov_type_ptr_var
= build_decl (UNKNOWN_LOCATION, VAR_DECL,
get_identifier (
(PARAM_VALUE (PARAM_INDIR_CALL_TOPN_PROFILE) ?
"__gcov_indirect_call_topn_counters" :
"__gcov_indirect_call_counters")),
gcov_type_ptr);
TREE_PUBLIC (ic_gcov_type_ptr_var) = 1;
DECL_EXTERNAL (ic_gcov_type_ptr_var) = 1;
}
TREE_STATIC (ic_gcov_type_ptr_var) = 1; TREE_STATIC (ic_gcov_type_ptr_var) = 1;
DECL_ARTIFICIAL (ic_gcov_type_ptr_var) = 1; DECL_ARTIFICIAL (ic_gcov_type_ptr_var) = 1;
DECL_INITIAL (ic_gcov_type_ptr_var) = NULL; DECL_INITIAL (ic_gcov_type_ptr_var) = NULL;
...@@ -230,33 +201,18 @@ gimple_init_edge_profiler (void) ...@@ -230,33 +201,18 @@ gimple_init_edge_profiler (void)
init_ic_make_global_vars (); init_ic_make_global_vars ();
/* Workaround for binutils bug 14342. Once it is fixed, remove lto path. */ /* void (*) (gcov_type, void *) */
if (flag_lto) ic_profiler_fn_type
{ = build_function_type_list (void_type_node,
/* void (*) (gcov_type, void *) */ gcov_type_node,
ic_profiler_fn_type ptr_void,
= build_function_type_list (void_type_node, NULL_TREE);
gcov_type_ptr, gcov_type_node, tree_indirect_call_profiler_fn
ptr_void, ptr_void, = build_fn_decl ( (PARAM_VALUE (PARAM_INDIR_CALL_TOPN_PROFILE) ?
NULL_TREE); "__gcov_indirect_call_topn_profiler":
tree_indirect_call_profiler_fn "__gcov_indirect_call_profiler_v2"),
= build_fn_decl ("__gcov_indirect_call_profiler", ic_profiler_fn_type);
ic_profiler_fn_type);
}
else
{
/* void (*) (gcov_type, void *) */
ic_profiler_fn_type
= build_function_type_list (void_type_node,
gcov_type_node,
ptr_void,
NULL_TREE);
tree_indirect_call_profiler_fn
= build_fn_decl ( (PARAM_VALUE (PARAM_INDIR_CALL_TOPN_PROFILE) ?
"__gcov_indirect_call_topn_profiler":
"__gcov_indirect_call_profiler_v2"),
ic_profiler_fn_type);
}
TREE_NOTHROW (tree_indirect_call_profiler_fn) = 1; TREE_NOTHROW (tree_indirect_call_profiler_fn) = 1;
DECL_ATTRIBUTES (tree_indirect_call_profiler_fn) DECL_ATTRIBUTES (tree_indirect_call_profiler_fn)
= tree_cons (get_identifier ("leaf"), NULL, = tree_cons (get_identifier ("leaf"), NULL,
...@@ -477,7 +433,8 @@ gimple_gen_ic_func_profiler (void) ...@@ -477,7 +433,8 @@ gimple_gen_ic_func_profiler (void)
stmt1: __gcov_indirect_call_profiler_v2 (profile_id, stmt1: __gcov_indirect_call_profiler_v2 (profile_id,
&current_function_decl) &current_function_decl)
*/ */
gsi = gsi_after_labels (split_edge (single_succ_edge (ENTRY_BLOCK_PTR_FOR_FN (cfun)))); gsi = gsi_after_labels (split_edge (single_succ_edge
(ENTRY_BLOCK_PTR_FOR_FN (cfun))));
cur_func = force_gimple_operand_gsi (&gsi, cur_func = force_gimple_operand_gsi (&gsi,
build_addr (current_function_decl, build_addr (current_function_decl,
...@@ -485,26 +442,10 @@ gimple_gen_ic_func_profiler (void) ...@@ -485,26 +442,10 @@ gimple_gen_ic_func_profiler (void)
true, NULL_TREE, true, NULL_TREE,
true, GSI_SAME_STMT); true, GSI_SAME_STMT);
tree_uid = build_int_cst tree_uid = build_int_cst
(gcov_type_node, cgraph_node::get (current_function_decl)->profile_id); (gcov_type_node,
/* Workaround for binutils bug 14342. Once it is fixed, remove lto path. */ cgraph_node::get (current_function_decl)->profile_id);
if (flag_lto) stmt1 = gimple_build_call (tree_indirect_call_profiler_fn, 2,
{ tree_uid, cur_func);
tree counter_ptr, ptr_var;
counter_ptr = force_gimple_operand_gsi (&gsi, ic_gcov_type_ptr_var,
true, NULL_TREE, true,
GSI_SAME_STMT);
ptr_var = force_gimple_operand_gsi (&gsi, ic_void_ptr_var,
true, NULL_TREE, true,
GSI_SAME_STMT);
stmt1 = gimple_build_call (tree_indirect_call_profiler_fn, 4,
counter_ptr, tree_uid, cur_func, ptr_var);
}
else
{
stmt1 = gimple_build_call (tree_indirect_call_profiler_fn, 2,
tree_uid, cur_func);
}
gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT); gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
/* Set __gcov_indirect_call_callee to 0, /* Set __gcov_indirect_call_callee to 0,
......
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