aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.h
AgeCommit message (Collapse)AuthorFilesLines
2005-05-17cgraph.h (cgraph_node): Add 'lowered' state.Steven Bosscher1-1/+3
* cgraph.h (cgraph_node): Add 'lowered' state. (cgraph_lower_function): Declare. * cgraphunit.c (cgraph_finalize_function): Initialize lowered flag. (cgraph_lower_function): New function. (cgraph_create_edges): Deal with lowered function bodies. (verify_cgraph_node): Likewise. (cgraph_analyze_function): Do lowering job. (cgraph_build_static_cdtor): Likewise. * function.h (struct function): Add saved_eh and saved_cfg. * integrate.c (copy_decl_for_inlining): Kill LABEL_DECL_UID field. * tree-cfg.c (fold_cond_expr_cond): Export. * tree-flow.h (fold_cond_expr_cond): Declare. * tree-inline.c: Include basic-block, ggc, tree-flow, except.h and pointer-set. (struct_inline_data): Kill fnd, first_inlined_fn, ret_label, in_target_cleanup_p, tree_pruner, tsi; add callee, caller and callee_cfun, block, eh_region, eh_region_offset. (inlining_p): New predicate. (remap_decl): Update for new inline_data; declare newly created inline vars in low gimple way. (copy_body_r): Update for new datastructure, simplify some of handling when we are in gimple; remap LABEL_DECLs for EH; copy TREE_BLOCK; deal with RESX_EXPRs. (copy_bb): New. (copy_edges_for_bb): Likewise. (remap_decl_1): New. (copy_cfg_body): New. (copy_generic_body): Rewrite to work on low gimple. (copy_body): Turn into simple wrapper around copy_cfg_body. (setup_one_parameter): Insert new statements into given basic block. (initialize_initialized_parameters): Likewise, reorganize way things are gimplified. (declare_return_variable): Update for new inline data datastructure. (inline_forbidden_p): Work on low gimple. (estimate_num_insns): Likewise. (expand_call_inline): Work on CFG. (push_cfun, pop_cfun): New functions. (cfun_stack): New stack. (add_lexical_block): New function. (gimple_expand_calls_inline): Work on basic block. (optimize_inline_calls): Likewise. (clone_body, save_body, unsave_ewpr_now): Update for new datastructures. (declare_inline_vars): Work on block instead of bind_expr. (inlining_p): New predicate. * tree-inline.h (push_cfun, pop_cfun): Declare. * tree-optimize.c: Include except.h (all_lowering_passes): New variable. (execute_fixup_cfg, pass_fixup_cfg): New pass. (init_tree_optimization_passes): Move some to all_lowering_passes. (tree_lowering_passes): New function. (tree_rest_of_compilation): Register cfg hooks; save/unsave eh. Co-Authored-By: Dale Johannesen <dalej@apple.com> Co-Authored-By: Jan Hubicka <jh@suse.cz> Co-Authored-By: Stuart Hastings <stuart@apple.com> From-SVN: r99840
2005-03-29builtin-types.def, [...]: Update copyright.Kazu Hirata1-1/+1
* builtin-types.def, c-convert.c, c-format.c, ddg.c, debug.c, debug.h, et-forest.c, et-forest.h, gcov.c, rtl-profile.c, rtlhooks-def.h, rtlhooks.c, sdbout.c, tree-inline.h, tree-profile.c, tsystem.h, value-prof.h: Update copyright. From-SVN: r97209
2005-03-22cgraphunit.c (cgraph_estimate_size_after_inlining): Compute call cost based ↵Richard Guenther1-0/+1
on argument sizes. * cgraphunit.c (cgraph_estimate_size_after_inlining): Compute call cost based on argument sizes. (cgraph_mark_inline_edge): Avoid inline unit from shringking by inlining. * params.def: (max-inline-inssn-single): Set to 450. (max-inline-insns-auto): Set to 90. (max-inline-insns-recursive): Set to 450 (max-inline-insns-recursive-auto): Set to 450. (large-function-insns): Set to 2700. (inline-call-cost): New parameter. * tree-inline.c (estimate_move_cost): New function. (estimate_num_insns_1): Compute move sizes costs by estimate_move_cost for non-gimple-regs, set cost to 0 for gimple-regs. Compute call size based on arguments. * tree-inline.h (estimate_move_cost): Declare. * invoke.texi: (max-inline-inssn-single): Change default to 450. (max-inline-insns-auto): Change default to 90. (max-inline-insns-recursive): Change default to 450 (max-inline-insns-recursive-auto): Change default to 450. (large-function-insns): Change default to 2700. (inline-call-cost): Document new parameter. * gcc.dg/winline-6.c: Modify so inlined function have nonzero cost. Co-Authored-By: Jan Hubicka <jh@suse.cz> From-SVN: r96892
2004-11-08tree-inline.c (remap_save_expr): Make it static.Kazu Hirata1-1/+0
* tree-inline.c (remap_save_expr): Make it static. * tree-inline.h: Remove the corresponding prototype. From-SVN: r90313
2004-10-15bitmap.c, [...]: Update copyright.Kazu Hirata1-1/+1
* bitmap.c, bitmap.h, builtin-attrs.def, cfglayout.h, collect2.h, conflict.c, coretypes.h, coverage.h, errors.h, gcc.h, gcov-dump.c, gen-protos.c, gencheck.c, gencodes.c, genconstants.c, gengenrtl.c, genmodes.c, genpeep.c, gensupport.h, graph.h, gthr-gnat.c, gthr-gnat.h, gthr-posix.c, gthr-posix.h, hard-reg-set.h, hwint.h, integrate.h, libgcc2.c, lists.c, machmode.def, mips-tdump.c, opts.h, params.c, predict.def, predict.h, protoize.c, reload.h, resource.h, rtl-error.c, sbitmap.c, sbitmap.h, sreal.c, tlink.c, tree-dump.h, tree-inline.h, unwind-dw2-fde.c, unwind-dw2.c, unwind-sjlj.c, value-prof.h: Update copyright. From-SVN: r89097
2004-07-27re PR tree-optimization/15077 (ICE in make_decl_rtl when inlining tail ↵Richard Kenner1-4/+4
recursive nested function) PR optimization/15077 * function.h (struct function): Add field saved_static_chain_decl. Fix comment for static_chain_decl. * tree-inline.c (save_body): Add new arg and handle static_chain_decl. * tree-inline.h (save_body): Add new arg. * tree-optimize.c (tree_rest_of_compilation): Handle saving static_chain_decl. From-SVN: r85247
2004-07-02c-decl.c (grokdeclarator): Don't frob current_function_decl around ↵Richard Henderson1-1/+1
variable_size. * c-decl.c (grokdeclarator): Don't frob current_function_decl around variable_size. (set_decl_nonlocal): Remove. (store_parm_decls): Add stmts for pending sizes. * calls.c (calls_function, calls_function_1): Remove. (precompute_arguments): Don't call it. * cfgexpand.c (set_save_expr_context): Remove. (tree_expand_cfg): Don't call it. * dwarf2out.c (add_bound_info): Don't handle SAVE_EXPR. (dwarf2out_finish): Likewise. * expr.c (emit_block_move): Adjust addresses to BLKmode. (store_constructor): Don't pre-evaluate SAVE_EXPR. (safe_from_p): Don't queue SAVE_EXPRs. (expand_expr_real_1 <case SAVE_EXPR>): Rewrite to expect, or build plain VAR_DECLs. * fold-const.c (twoval_comparison_p): Don't look at SAVE_EXPR_RTL. (fold): Likewise. (fold_checksum_tree): Don't special-case SAVE_EXPR. * function.c (free_after_compilation): Don't clear x_save_expr_regs. (put_var_into_stack): Don't handle SAVE_EXPR. (gen_mem_addressof): Likewise. * function.h (struct function): Remove x_save_expr_regs. (save_expr_regs): Remove. * gengtype.c (adjust_field_tree_exp): Don't special-case SAVE_EXPR. * print-tree.c (print_node): Don't dump SAVE_EXPR_NOPLACEHOLDER. * stor-layout.c (variable_size): Don't set it. (force_type_save_exprs, force_type_save_exprs_1): Remove. * tree-inline.c (remap_save_expr): Remove fn argument. Update all callers. Don't set SAVE_EXPR_CONTEXT. * tree-inline.h (remap_save_expr): Update decl. * tree.c (save_expr): Update build size. (first_rtl_op): Don't handle SAVE_EXPR. (unsave_expr_1, contains_placeholder_p): Likewise. (decl_function_context): Likewise. * tree.def (SAVE_EXPR): Remove args 1 and 2. * tree.h (SAVE_EXPR_CONTEXT, SAVE_EXPR_RTL): Remove. (SAVE_EXPR_NOPLACEHOLDER, SAVE_EXPR_PERSISTENT_P): Remove. cp/ * tree.c (cp_unsave_r): Update remap_save_expr call. java/ * jcf-write.c (generate_bytecode_insns <case SAVE_EXPR>): Rewrite. From-SVN: r84036
2004-05-13Merge tree-ssa-20020619-branch into mainline.Diego Novillo1-2/+1
From-SVN: r81764
2004-04-01cgraph.c: Add overall comment.Jan Hubicka1-0/+1
* cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2003-08-05tree.h (DID_INLINE_FUNC): Remove macro.Steven Bosscher1-1/+1
2003-08-05 Steven Bosscher <steven@gcc.gnu.org> * tree.h (DID_INLINE_FUNC): Remove macro. (DECL_DECLARED_INLINE_P): Move from c-tree.h and cp/cp-tree.h, add tree check for FUNCTION_DECL. (DECL_ESTIMATED_INSNS): Move from c-common.h and java/java-tree.h. (struct tree_decl): Rename inlined_function_flag to declared_inline_flag. * c-common.h (c_lang_decl): Remove. (DECL_ESTIMATED_INSNS): Remove. * c-tree.h (struct lang_decl): Don't include c_lang_decl. (DECL_DECLARED_INLINE_P): Remove. * c-decl.c (grokdeclarator): Update comment. With -finline-functions, do not reset DECL_DECLARED_INLINE_P. Don't use DID_INLINE_FUNC. (finish_function): Make uninlinable a bool. Fixup call to tree_inlinable_function_p() and fix some code style issues. * cgraph.h (disgread_inline_limits): Fix spelling: `disregard'. * cgraph.c (dump_cgraph): Likewise. * cgraphunit.c (cgraph_decide_inlining): Likewise (cgraph_finalize_compilation_unit): Likewise. Also update call to tree_inlinable_function_p(). (cgraph_default_inline_p): Don't use DID_INLINE_FUNC. Instead look at DECL_DECLARED_INLINE and reverse logic. * print-tree.c (print_node): Likewise. * toplev.c (rest_of_handle_inlining): Don't use DID_INLINE_FUNC. * tree-inline.h (tree_inlinable_function_p): Make a bool. Update prototype. * tree-inline.c (inlinable_function_p): Split up in this function to check for basic inlining inhibiting conditions, and new limits_allow_inlining() function. Warn if inlining is impossible because the inline candidate calls alloca or uses sjlj exceptions. (limits_allow_inlining): this new function to check if the inlining limits are satisfied. Throttle from currfn_max_inline_insns, not from MAX_INLINE_INSNS_SINGLE. The latter only makes sense if MAX_INLINE_INSNS_AUTO and MAX_INLINE_INSNS_SINGLE are equal. Update prototypes. (tree_inlinable_function_p): Make a bool. Update call to inlinable_function_p (expand_call_inline): Use limits_allow_inlining() when not in unit-at-a-time mode to decide on inlining. Don't use DID_INLINE_FUNC, instead see if the function was declared `inline'. cp/ * cp-tree.h (struct lang_decl): Don't include c_lang_decl. (DECL_DECLARED_INLINE_P): Remove. * decl2.c (import_export_decl): Only look at DECL_DECLARED_INLINE_P if decl is a FUNCTION_DECL. This never made sense, but now it is required to avoid a tree check failure. * decl.c (grokfndecl): Don't touch DID_INLINE_FUNC. * optimize.c (maybe_clone_body): Likewise. java/ * java-tree.h (DECL_ESTIMATED_INSNS): Remove. From-SVN: r70174
2003-07-06sbitmap.c: Convert prototypes to ISO C90.Andreas Jaeger1-8/+8
* sbitmap.c: Convert prototypes to ISO C90. * sbitmap.h: Likewise. * scan-decls.c: Likewise. * scan.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sibcall.c: Likewise. * simplify-rtx.c: Likewise. * sreal.c: Likewise. * sreal.h: Likewise. * ssa-ccp.c: Likewise. * ssa-dce.c: Likewise. * ssa.c: Likewise. * ssa.h: Likewise. * stack.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * stringpool.c: Likewise. * target.h: Likewise. * timevar.c: Likewise. * timevar.h: Likewise. * tlink.c: Likewise. * tracer.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. From-SVN: r69002
2003-03-13genattrtab.h, [...]: Replace "GNU CC" with "GCC".Nathanael Nerode1-4/+4
* genattrtab.h, hosthooks-def.h, hosthooks.h, langhooks-def.h, langhooks.h, tree-inline.h: Replace "GNU CC" with "GCC". From-SVN: r64298
2003-03-08inline-3.c: New test.Jan Hubicka1-1/+1
* gcc.dg/inline-3.c: New test. * c-decl.c: (finish_function): Update call of tree_inlinable_function_p. * cgraph.h: (cgraph_local_info): Add can_inline_once (cgraph_global_info): Add inline_once. (cgraph_node): Add previous. (cgraph_remove_node): New. * cgraphunit.c (cgraph_mark_functions_to_inline_once): New static function. (cgraph_optimize): Call it. (cgraph_finalize_function): Set inlinable flags. (cgraph_finalize_compilation_unit): Actually remove the reclaimed nodes. (cgraph_mark_functions_to_output): Use new inlining heuristics flags. (cgraph_expand_function): Likewise. * cgraph.c (cgraph_node): Put nodes into doubly linked chain. (cgraph_remove_node): New function. * flags.h (flag_inline_functions_called_once): Declare. * tree-inline.c: Include cgraph.h (inlinable_functions_p): Add extra argument to bypass limits. (expand_call_inline): Obey cgraph flag. * tree-inline.h (tree_inlinable_function_p): Update prototype. From-SVN: r63983
2002-05-31target.h: Fix formatting.Kazu Hirata1-2/+2
* target.h: Fix formatting. * timevar.h: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tree.c: Likewise. * tree-dump.h: Likewise. * tree.h: Likewise. * tree-inline.h: Likewise. * unroll.c: Likewise. * unwind-dw2.c: Likewise. * unwind-dw2-fde.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2-fde.h: Likewise. * unwind.h: Likewise. * unwind-sjlj.c: Likewise. * varasm.c: Likewise. * varray.h: Likewise. * vmsdbg.h: Likewise. * vmsdbgout.c: Likewise. * xcoffout.h: Likewise. From-SVN: r54123
2001-10-08langhooks.h: New file.Alexandre Oliva1-98/+0
* langhooks.h: New file. * Makefile.in (OBJS): Added langhooks.o. (c-lang.o): Depend on langhooks.h. (c-common.o): Don't depend on tree-inline.h. (tree-inline.o): Depend on toplev.h. (langhooks.o): New rule. * c-common.c: Don't include tree-inline.h. (c_mark_lang_decl): Mark argument c as unused. (c_common_lang_init): Don't initialize hooks here. * c-lang.c: Include langhooks.h, then override some macros. (lang_hooks): Initialize with macros in langhooks.h. (c_init): Don't initialize hooks here. * toplev.c (struct lang_hooks_for_tree_inlining): New struct. (struct lang_hooks): Add tree_inlining. Refer to langhooks.h. * tree-inline.c: Include toplev.h. Don't define hook variables. * tree-inline.h: Don't define hook types nor declare hook variables. Move macros to... * langhooks.c: ... new file, as functions. Adjust all callers. From-SVN: r46096
2001-10-05Makefile.in (c-decl.o): Depend on tree-inline.h.Alexandre Oliva1-0/+1
* Makefile.in (c-decl.o): Depend on tree-inline.h. (c-lang.o): Likewise, as well as insn-config.h and integrate.h. * c-decl.c: Include tree-inline.h. (c_expand_body): Call optimize_inline_calls. Determine whether a function is inlinable upfront, and only clear DECL_SAVED_TREE, DECL_INITIAL and DECL_ARGUMENTS if it isn't. * c-lang.c: Include tree-inline.h, insn-config.h and integrate.h. (c_disregard_inline_limits): New function. (inline_forbidden_p, c_cannot_inline_tree_fn): Likewise. (c_post_options): Enable tree inlining if inlining is enabled. Don't inline trees when instrumenting functions. (c_init): Initialize lang_disregard_inline_limits and lang_cannot_inline_tree_fn. * tree-inline.c (initialize_inlined_parameters): Handle calls with fewer arguments than declared parameters, and fewer parameters than passed arguments. Don't assume value is a DECL. (declare_return_variable): Convert return value back to the original type, if it was promoted. (tree_inlinable_function_p): New function. (inlinable_function_p): Don't look at DECL_INLINE if we're inlining all functions. Make it work with a NULL id. Re-check DECL_UNINLINABLE after language-specific checks. (varargs_function_p): Move back to cp/tree.c. * tree-inline.h (tree_inlinable_function_p): Declare it. (varargs_function_p): Removed declaration. * integrate.h (function_attribute_inlinable_p): Declare it. * integrate.c (function_attribute_inlinable_p): Export it. (save_for_inline): Don't bother to prepare argvec when not inlining. * cse.c (check_for_label_ref): Don't check deleted labels. From-SVN: r46025
2001-10-05Makefile.in (OBJS): Added tree-inline.o.Alexandre Oliva1-0/+139
* Makefile.in (OBJS): Added tree-inline.o. (c-common.o): Depend on tree-inline.h. (tree-inline.o): New target. * c-common.c: Include tree-inline.h. (c_mark_lang_decl): Don't mark saved_tree. (c_common_lang_init): Set lang_anon_aggr_type_p. * c-common.h (walk_tree_fn, DECL_SAVED_TREE): Moved to tree.h. (struct c_lang_decl): Moved saved_tree to tree_decl. * ggc-common.c: Mark saved_tree and inlined_fns of FUNCTION_DECLs. * integrate.h (function_attribute_inlinable_p): Declare it. * integrate.c (function_attribute_inlinable_p): Export it. * tree-inline.c: New file. Define variables declared in... * tree-inline.h: New file. Declare functions to be moved to tree-inline.c. Define macros and declare types and hooks for language-specific tree inlining. (flag_inline_trees): Moved definition from cp/decl2.c. * tree.h (walk_tree_fn, DECL_SAVED_TREE): Moved from c-common.h. (TREE_READONLY_DECL_P, DECL_INLINED_FNS): Moved from cp/cp-tree.h. (struct tree_decl): Moved saved_tree from c_lang_decl and inlined_fns from C++'s lang_decl. From-SVN: r46021