/* Function splitting pass
- Copyright (C) 2010-2019 Free Software Foundation, Inc.
+ Copyright (C) 2010-2021 Free Software Foundation, Inc.
Contributed by Jan Hubicka <jh@suse.cz>
This file is part of GCC.
#include "tree-into-ssa.h"
#include "tree-dfa.h"
#include "tree-inline.h"
-#include "params.h"
#include "gimple-pretty-print.h"
#include "ipa-fnsummary.h"
#include "cfgloop.h"
|| (VAR_P (t)
&& auto_var_in_fn_p (t, current_function_decl))
|| TREE_CODE (t) == RESULT_DECL
- /* Normal labels are part of CFG and will be handled gratefuly.
+ /* Normal labels are part of CFG and will be handled gratefully.
Forced labels however can be used directly by statements and
need to stay in one partition along with their uses. */
|| (TREE_CODE (t) == LABEL_DECL
is unknown. */
if (!(current->count
< (ENTRY_BLOCK_PTR_FOR_FN (cfun)->count.apply_scale
- (PARAM_VALUE (PARAM_PARTIAL_INLINING_ENTRY_PROBABILITY), 100))))
+ (param_partial_inlining_entry_probability, 100))))
{
/* When profile is guessed, we cannot expect it to give us
- realistic estimate on likelyness of function taking the
+ realistic estimate on likeliness of function taking the
complex path. As a special case, when tail of the function is
a loop, enable splitting since inlining code skipping the loop
is likely noticeable win. */
}
}
}
- if (!VOID_TYPE_P (TREE_TYPE (current_function_decl)))
- call_overhead += estimate_move_cost (TREE_TYPE (current_function_decl),
+ if (!VOID_TYPE_P (TREE_TYPE (TREE_TYPE (current_function_decl))))
+ call_overhead += estimate_move_cost (TREE_TYPE (TREE_TYPE
+ (current_function_decl)),
false);
if (current->split_size <= call_overhead)
that. Next stage1 we should try to be more meaningful here. */
if (current->header_size + call_overhead
>= (unsigned int)(DECL_DECLARED_INLINE_P (current_function_decl)
- ? MAX_INLINE_INSNS_SINGLE
- : MAX_INLINE_INSNS_AUTO) + 10)
+ ? param_max_inline_insns_single
+ : param_max_inline_insns_auto) + 10)
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file,
Limit this duplication. This is consistent with limit in tree-sra.c
FIXME: with LTO we ought to be able to do better! */
if (DECL_ONE_ONLY (current_function_decl)
- && current->split_size >= (unsigned int) MAX_INLINE_INSNS_AUTO + 10)
+ && current->split_size >= (unsigned int) param_max_inline_insns_auto + 10)
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file,
FIXME: with LTO we ought to be able to do better! */
if (DECL_ONE_ONLY (current_function_decl)
&& current->split_size
- <= (unsigned int) PARAM_VALUE (PARAM_EARLY_INLINING_INSNS) / 2)
+ <= (unsigned int) param_early_inlining_insns / 2)
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file,
{
/* TODO: call is versionable if we make sure that all
callers are inside of a comdat group. */
- cur_node->calls_comdat_local = 1;
+ cur_node->calls_comdat_local = true;
node->add_to_same_comdat_group (cur_node);
}
/* Let's take a time profile for splitted function. */
- node->tp_first_run = cur_node->tp_first_run + 1;
+ if (cur_node->tp_first_run)
+ node->tp_first_run = cur_node->tp_first_run + 1;
/* For usual cloning it is enough to clear builtin only when signature
changes. For partial inlining we however cannot expect the part
calculate_dominance_info (CDI_DOMINATORS);
/* Compute local info about basic blocks and determine function size/time. */
- bb_info_vec.safe_grow_cleared (last_basic_block_for_fn (cfun) + 1);
+ bb_info_vec.safe_grow_cleared (last_basic_block_for_fn (cfun) + 1, true);
best_split_point.split_bbs = NULL;
basic_block return_bb = find_return_bb ();
int tsan_exit_found = -1;