+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>
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
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);
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);
/* 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);
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);
}
}
- /* 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);
}
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;
/* 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
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
}
-/* 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. */
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);
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;
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);
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;
= 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++;
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,
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))
{
}
/* Transform
1) Memory references.
- 2) BUILTIN_ALLOCA calls.
*/
static void
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:
;
}
CASE_HIGH_SEEN in
CASE_LABEL_EXPR
- CALL_CANNOT_INLINE_P in
- CALL_EXPR
-
ENUM_IS_SCOPED in
ENUMERAL_TYPE
#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)