cgraph.c (cgraph_create_edge_1): Initialize call_stmt_cannot_inline_p from the stmt if possible.
2011-12-05 Richard Guenther <rguenther@suse.de> * cgraph.c (cgraph_create_edge_1): Initialize call_stmt_cannot_inline_p from the stmt if possible. (cgraph_make_edge_direct): Likewise. * gimple-streamer-in.c (input_gimple_stmt): Do not call gimple_call_set_cannot_inline. * gimple.h (enum gf_mask): Remove GF_CALL_CANNOT_INLINE, shift values. (gimple_call_set_cannot_inline): Remove. (gimple_call_cannot_inline_p): Likewise. * ipa-inline-analysis.c (initialize_inline_failed): Look at the edge call_stmt_cannot_inline_p flag. * ipa-inline.c (can_inline_edge_p): Likewise. (early_inliner): Only update the edge flag. * ipa-prop.c (update_indirect_edges_after_inlining): Likewise. (ipa_modify_call_arguments): Do not call gimple_call_set_cannot_inline. * cgraphunit.c (assemble_thunk): Likewise. * gimple-fold.c (gimple_fold_call): Likewise. * tree.h (CALL_CANNOT_INLINE_P): Remove. * tree-mudflap.c (mf_xform_statements): Do not modify alloca calls. * builtins.c (expand_builtin_alloca): With -fmudflap do not expand alloca calls inline. * cfgexpand.c (expand_call_stmt): Do not set CALL_CANNOT_INLINE_P. * gimple.c (gimple_build_call_from_tree): Do not read CALL_CANNOT_INLINE_P. * gimplify.c (gimplify_call_expr): Do not copy CALL_CANNOT_INLINE_P. From-SVN: r182001
This commit is contained in:
parent
5275901c43
commit
89faf322d8
@ -1,3 +1,32 @@
|
||||
2011-12-05 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
* cgraph.c (cgraph_create_edge_1): Initialize
|
||||
call_stmt_cannot_inline_p from the stmt if possible.
|
||||
(cgraph_make_edge_direct): Likewise.
|
||||
* gimple-streamer-in.c (input_gimple_stmt): Do not
|
||||
call gimple_call_set_cannot_inline.
|
||||
* gimple.h (enum gf_mask): Remove GF_CALL_CANNOT_INLINE, shift
|
||||
values.
|
||||
(gimple_call_set_cannot_inline): Remove.
|
||||
(gimple_call_cannot_inline_p): Likewise.
|
||||
* ipa-inline-analysis.c (initialize_inline_failed): Look
|
||||
at the edge call_stmt_cannot_inline_p flag.
|
||||
* ipa-inline.c (can_inline_edge_p): Likewise.
|
||||
(early_inliner): Only update the edge flag.
|
||||
* ipa-prop.c (update_indirect_edges_after_inlining): Likewise.
|
||||
(ipa_modify_call_arguments): Do not call gimple_call_set_cannot_inline.
|
||||
* cgraphunit.c (assemble_thunk): Likewise.
|
||||
* gimple-fold.c (gimple_fold_call): Likewise.
|
||||
|
||||
* tree.h (CALL_CANNOT_INLINE_P): Remove.
|
||||
* tree-mudflap.c (mf_xform_statements): Do not modify alloca calls.
|
||||
* builtins.c (expand_builtin_alloca): With -fmudflap do not expand
|
||||
alloca calls inline.
|
||||
* cfgexpand.c (expand_call_stmt): Do not set CALL_CANNOT_INLINE_P.
|
||||
* gimple.c (gimple_build_call_from_tree): Do not read
|
||||
CALL_CANNOT_INLINE_P.
|
||||
* gimplify.c (gimplify_call_expr): Do not copy CALL_CANNOT_INLINE_P.
|
||||
|
||||
2011-12-05 Jakub Jelinek <jakub@redhat.com>
|
||||
Eric Botcazou <ebotcazou@adacore.com>
|
||||
|
||||
|
@ -4523,8 +4523,8 @@ expand_builtin_alloca (tree exp, bool cannot_accumulate)
|
||||
bool alloca_with_align = (DECL_FUNCTION_CODE (get_callee_fndecl (exp))
|
||||
== BUILT_IN_ALLOCA_WITH_ALIGN);
|
||||
|
||||
/* Emit normal call if marked not-inlineable. */
|
||||
if (CALL_CANNOT_INLINE_P (exp))
|
||||
/* Emit normal call if we use mudflap. */
|
||||
if (flag_mudflap)
|
||||
return NULL_RTX;
|
||||
|
||||
valid_arglist
|
||||
|
@ -2050,7 +2050,6 @@ expand_call_stmt (gimple stmt)
|
||||
CALL_ALLOCA_FOR_VAR_P (exp) = gimple_call_alloca_for_var_p (stmt);
|
||||
else
|
||||
CALL_FROM_THUNK_P (exp) = gimple_call_from_thunk_p (stmt);
|
||||
CALL_CANNOT_INLINE_P (exp) = gimple_call_cannot_inline_p (stmt);
|
||||
CALL_EXPR_VA_ARG_PACK (exp) = gimple_call_va_arg_pack_p (stmt);
|
||||
SET_EXPR_LOCATION (exp, gimple_location (stmt));
|
||||
TREE_BLOCK (exp) = gimple_block (stmt);
|
||||
|
17
gcc/cgraph.c
17
gcc/cgraph.c
@ -988,8 +988,12 @@ cgraph_create_edge_1 (struct cgraph_node *caller, struct cgraph_node *callee,
|
||||
edge->can_throw_external
|
||||
= call_stmt ? stmt_can_throw_external (call_stmt) : false;
|
||||
pop_cfun ();
|
||||
edge->call_stmt_cannot_inline_p =
|
||||
(call_stmt ? gimple_call_cannot_inline_p (call_stmt) : false);
|
||||
if (call_stmt
|
||||
&& callee && callee->decl
|
||||
&& !gimple_check_call_matching_types (call_stmt, callee->decl))
|
||||
edge->call_stmt_cannot_inline_p = true;
|
||||
else
|
||||
edge->call_stmt_cannot_inline_p = false;
|
||||
if (call_stmt && caller->call_site_hash)
|
||||
cgraph_add_edge_to_call_site_hash (edge);
|
||||
|
||||
@ -1184,12 +1188,9 @@ cgraph_make_edge_direct (struct cgraph_edge *edge, struct cgraph_node *callee)
|
||||
/* Insert to callers list of the new callee. */
|
||||
cgraph_set_edge_callee (edge, callee);
|
||||
|
||||
if (edge->call_stmt
|
||||
&& !gimple_check_call_matching_types (edge->call_stmt, callee->decl))
|
||||
{
|
||||
gimple_call_set_cannot_inline (edge->call_stmt, true);
|
||||
edge->call_stmt_cannot_inline_p = true;
|
||||
}
|
||||
if (edge->call_stmt)
|
||||
edge->call_stmt_cannot_inline_p
|
||||
= !gimple_check_call_matching_types (edge->call_stmt, callee->decl);
|
||||
|
||||
/* We need to re-determine the inlining status of the edge. */
|
||||
initialize_inline_failed (edge);
|
||||
|
@ -1694,7 +1694,6 @@ assemble_thunk (struct cgraph_node *node)
|
||||
VEC_quick_push (tree, vargs, arg);
|
||||
call = gimple_build_call_vec (build_fold_addr_expr_loc (0, alias), vargs);
|
||||
VEC_free (tree, heap, vargs);
|
||||
gimple_call_set_cannot_inline (call, true);
|
||||
gimple_call_set_from_thunk (call, true);
|
||||
if (restmp)
|
||||
gimple_call_set_lhs (call, restmp);
|
||||
|
@ -1108,23 +1108,12 @@ gimple_fold_call (gimple_stmt_iterator *gsi, bool inplace)
|
||||
}
|
||||
}
|
||||
|
||||
/* Check whether propagating into the function address made the
|
||||
call direct, and thus possibly non-inlineable.
|
||||
??? This asks for a more conservative setting of the non-inlinable
|
||||
flag, namely true for all indirect calls. But that would require
|
||||
that we can re-compute the flag conservatively, thus it isn't
|
||||
ever initialized from something else than return/argument type
|
||||
checks . */
|
||||
callee = gimple_call_fndecl (stmt);
|
||||
if (callee
|
||||
&& !gimple_check_call_matching_types (stmt, callee))
|
||||
gimple_call_set_cannot_inline (stmt, true);
|
||||
|
||||
if (inplace)
|
||||
return changed;
|
||||
|
||||
/* Check for builtins that CCP can handle using information not
|
||||
available in the generic fold routines. */
|
||||
callee = gimple_call_fndecl (stmt);
|
||||
if (callee && DECL_BUILT_IN (callee))
|
||||
{
|
||||
tree result = gimple_fold_builtin (stmt);
|
||||
|
@ -219,18 +219,11 @@ input_gimple_stmt (struct lto_input_block *ib, struct data_in *data_in,
|
||||
}
|
||||
if (is_gimple_call (stmt))
|
||||
{
|
||||
tree fndecl;
|
||||
if (gimple_call_internal_p (stmt))
|
||||
gimple_call_set_internal_fn
|
||||
(stmt, streamer_read_enum (ib, internal_fn, IFN_LAST));
|
||||
else
|
||||
gimple_call_set_fntype (stmt, stream_read_tree (ib, data_in));
|
||||
/* Update the non-inlinable flag conservatively. */
|
||||
fndecl = gimple_call_fndecl (stmt);
|
||||
if (fndecl
|
||||
&& !gimple_call_cannot_inline_p (stmt)
|
||||
&& !gimple_check_call_matching_types (stmt, fndecl))
|
||||
gimple_call_set_cannot_inline (stmt, true);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -370,7 +370,6 @@ gimple_build_call_from_tree (tree t)
|
||||
/* Carry all the CALL_EXPR flags to the new GIMPLE_CALL. */
|
||||
gimple_call_set_chain (call, CALL_EXPR_STATIC_CHAIN (t));
|
||||
gimple_call_set_tail (call, CALL_EXPR_TAILCALL (t));
|
||||
gimple_call_set_cannot_inline (call, CALL_CANNOT_INLINE_P (t));
|
||||
gimple_call_set_return_slot_opt (call, CALL_EXPR_RETURN_SLOT_OPT (t));
|
||||
if (fndecl
|
||||
&& DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL
|
||||
|
38
gcc/gimple.h
38
gcc/gimple.h
@ -97,14 +97,13 @@ enum gimple_rhs_class
|
||||
enum gf_mask {
|
||||
GF_ASM_INPUT = 1 << 0,
|
||||
GF_ASM_VOLATILE = 1 << 1,
|
||||
GF_CALL_CANNOT_INLINE = 1 << 0,
|
||||
GF_CALL_FROM_THUNK = 1 << 1,
|
||||
GF_CALL_RETURN_SLOT_OPT = 1 << 2,
|
||||
GF_CALL_TAILCALL = 1 << 3,
|
||||
GF_CALL_VA_ARG_PACK = 1 << 4,
|
||||
GF_CALL_NOTHROW = 1 << 5,
|
||||
GF_CALL_ALLOCA_FOR_VAR = 1 << 6,
|
||||
GF_CALL_INTERNAL = 1 << 7,
|
||||
GF_CALL_FROM_THUNK = 1 << 0,
|
||||
GF_CALL_RETURN_SLOT_OPT = 1 << 1,
|
||||
GF_CALL_TAILCALL = 1 << 2,
|
||||
GF_CALL_VA_ARG_PACK = 1 << 3,
|
||||
GF_CALL_NOTHROW = 1 << 4,
|
||||
GF_CALL_ALLOCA_FOR_VAR = 1 << 5,
|
||||
GF_CALL_INTERNAL = 1 << 6,
|
||||
GF_OMP_PARALLEL_COMBINED = 1 << 0,
|
||||
|
||||
/* True on an GIMPLE_OMP_RETURN statement if the return does not require
|
||||
@ -2343,29 +2342,6 @@ gimple_call_tail_p (gimple s)
|
||||
}
|
||||
|
||||
|
||||
/* Set the inlinable status of GIMPLE_CALL S to INLINABLE_P. */
|
||||
|
||||
static inline void
|
||||
gimple_call_set_cannot_inline (gimple s, bool inlinable_p)
|
||||
{
|
||||
GIMPLE_CHECK (s, GIMPLE_CALL);
|
||||
if (inlinable_p)
|
||||
s->gsbase.subcode |= GF_CALL_CANNOT_INLINE;
|
||||
else
|
||||
s->gsbase.subcode &= ~GF_CALL_CANNOT_INLINE;
|
||||
}
|
||||
|
||||
|
||||
/* Return true if GIMPLE_CALL S cannot be inlined. */
|
||||
|
||||
static inline bool
|
||||
gimple_call_cannot_inline_p (gimple s)
|
||||
{
|
||||
GIMPLE_CHECK (s, GIMPLE_CALL);
|
||||
return (s->gsbase.subcode & GF_CALL_CANNOT_INLINE) != 0;
|
||||
}
|
||||
|
||||
|
||||
/* If RETURN_SLOT_OPT_P is true mark GIMPLE_CALL S as valid for return
|
||||
slot optimization. This transformation uses the target of the call
|
||||
expansion as the return slot for calls that return in memory. */
|
||||
|
@ -2449,7 +2449,6 @@ gimplify_call_expr (tree *expr_p, gimple_seq *pre_p, bool want_value)
|
||||
CALL_EXPR_RETURN_SLOT_OPT (*expr_p)
|
||||
= CALL_EXPR_RETURN_SLOT_OPT (call);
|
||||
CALL_FROM_THUNK_P (*expr_p) = CALL_FROM_THUNK_P (call);
|
||||
CALL_CANNOT_INLINE_P (*expr_p) = CALL_CANNOT_INLINE_P (call);
|
||||
SET_EXPR_LOCATION (*expr_p, EXPR_LOCATION (call));
|
||||
TREE_BLOCK (*expr_p) = TREE_BLOCK (call);
|
||||
|
||||
|
@ -1249,7 +1249,7 @@ initialize_inline_failed (struct cgraph_edge *e)
|
||||
e->inline_failed = CIF_BODY_NOT_AVAILABLE;
|
||||
else if (callee->local.redefined_extern_inline)
|
||||
e->inline_failed = CIF_REDEFINED_EXTERN_INLINE;
|
||||
else if (e->call_stmt && gimple_call_cannot_inline_p (e->call_stmt))
|
||||
else if (e->call_stmt_cannot_inline_p)
|
||||
e->inline_failed = CIF_MISMATCHED_ARGUMENTS;
|
||||
else
|
||||
e->inline_failed = CIF_FUNCTION_NOT_CONSIDERED;
|
||||
|
@ -246,14 +246,6 @@ can_inline_edge_p (struct cgraph_edge *e, bool report)
|
||||
struct function *caller_cfun = DECL_STRUCT_FUNCTION (e->caller->decl);
|
||||
struct function *callee_cfun
|
||||
= callee ? DECL_STRUCT_FUNCTION (callee->decl) : NULL;
|
||||
bool call_stmt_cannot_inline_p;
|
||||
|
||||
/* If E has a call statement in it, use the inline attribute from
|
||||
the statement, otherwise use the inline attribute in E. Edges
|
||||
will not have statements when working in WPA mode. */
|
||||
call_stmt_cannot_inline_p = (e->call_stmt)
|
||||
? gimple_call_cannot_inline_p (e->call_stmt)
|
||||
: e->call_stmt_cannot_inline_p;
|
||||
|
||||
if (!caller_cfun && e->caller->clone_of)
|
||||
caller_cfun = DECL_STRUCT_FUNCTION (e->caller->clone_of->decl);
|
||||
@ -278,7 +270,7 @@ can_inline_edge_p (struct cgraph_edge *e, bool report)
|
||||
e->inline_failed = CIF_OVERWRITABLE;
|
||||
return false;
|
||||
}
|
||||
else if (call_stmt_cannot_inline_p)
|
||||
else if (e->call_stmt_cannot_inline_p)
|
||||
{
|
||||
e->inline_failed = CIF_MISMATCHED_ARGUMENTS;
|
||||
inlinable = false;
|
||||
@ -1957,8 +1949,10 @@ early_inliner (void)
|
||||
= estimate_num_insns (edge->call_stmt, &eni_size_weights);
|
||||
es->call_stmt_time
|
||||
= estimate_num_insns (edge->call_stmt, &eni_time_weights);
|
||||
edge->call_stmt_cannot_inline_p
|
||||
= gimple_call_cannot_inline_p (edge->call_stmt);
|
||||
if (edge->callee->decl
|
||||
&& !gimple_check_call_matching_types (edge->call_stmt,
|
||||
edge->callee->decl))
|
||||
edge->call_stmt_cannot_inline_p = true;
|
||||
}
|
||||
timevar_pop (TV_INTEGRATION);
|
||||
iterations++;
|
||||
|
@ -1905,13 +1905,10 @@ update_indirect_edges_after_inlining (struct cgraph_edge *cs,
|
||||
if (new_direct_edge)
|
||||
{
|
||||
new_direct_edge->indirect_inlining_edge = 1;
|
||||
if (new_direct_edge->call_stmt
|
||||
&& !gimple_check_call_matching_types (new_direct_edge->call_stmt,
|
||||
new_direct_edge->callee->decl))
|
||||
{
|
||||
gimple_call_set_cannot_inline (new_direct_edge->call_stmt, true);
|
||||
new_direct_edge->call_stmt_cannot_inline_p = true;
|
||||
}
|
||||
if (new_direct_edge->call_stmt)
|
||||
new_direct_edge->call_stmt_cannot_inline_p
|
||||
= !gimple_check_call_matching_types (new_direct_edge->call_stmt,
|
||||
new_direct_edge->callee->decl);
|
||||
if (new_edges)
|
||||
{
|
||||
VEC_safe_push (cgraph_edge_p, heap, *new_edges,
|
||||
@ -2577,9 +2574,6 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gimple stmt,
|
||||
gimple_set_location (new_stmt, gimple_location (stmt));
|
||||
gimple_call_set_chain (new_stmt, gimple_call_chain (stmt));
|
||||
gimple_call_copy_flags (new_stmt, stmt);
|
||||
if (gimple_call_cannot_inline_p (stmt))
|
||||
gimple_call_set_cannot_inline
|
||||
(new_stmt, !gimple_check_call_matching_types (new_stmt, callee_decl));
|
||||
|
||||
if (dump_file && (dump_flags & TDF_DETAILS))
|
||||
{
|
||||
|
@ -929,7 +929,6 @@ mf_xform_derefs_1 (gimple_stmt_iterator *iter, tree *tp,
|
||||
}
|
||||
/* Transform
|
||||
1) Memory references.
|
||||
2) BUILTIN_ALLOCA calls.
|
||||
*/
|
||||
static void
|
||||
mf_xform_statements (void)
|
||||
@ -970,16 +969,6 @@ mf_xform_statements (void)
|
||||
}
|
||||
break;
|
||||
|
||||
case GIMPLE_CALL:
|
||||
{
|
||||
tree fndecl = gimple_call_fndecl (s);
|
||||
if (fndecl && (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_ALLOCA
|
||||
|| (DECL_FUNCTION_CODE (fndecl)
|
||||
== BUILT_IN_ALLOCA_WITH_ALIGN)))
|
||||
gimple_call_set_cannot_inline (s, true);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
;
|
||||
}
|
||||
|
@ -533,9 +533,6 @@ struct GTY(()) tree_common {
|
||||
CASE_HIGH_SEEN in
|
||||
CASE_LABEL_EXPR
|
||||
|
||||
CALL_CANNOT_INLINE_P in
|
||||
CALL_EXPR
|
||||
|
||||
ENUM_IS_SCOPED in
|
||||
ENUMERAL_TYPE
|
||||
|
||||
@ -1245,9 +1242,6 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
|
||||
#define CASE_HIGH_SEEN(NODE) \
|
||||
(CASE_LABEL_EXPR_CHECK (NODE)->base.static_flag)
|
||||
|
||||
/* Used to mark a CALL_EXPR as not suitable for inlining. */
|
||||
#define CALL_CANNOT_INLINE_P(NODE) (CALL_EXPR_CHECK (NODE)->base.static_flag)
|
||||
|
||||
/* Used to mark scoped enums. */
|
||||
#define ENUM_IS_SCOPED(NODE) (ENUMERAL_TYPE_CHECK (NODE)->base.static_flag)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user