Age | Commit message (Collapse) | Author | Files | Lines |
|
cost per call to a target specific...
2007-09-24 Pranav Bhandarkar <pranav.bhandarkar@celunite.com>
Ramana Radhakrishnan <ramana@hercules.pun.celunite.com>
* tree-inline.h (eni_weights): Add field target_builtin_cost to
reflect the cost per call to a target specific builtin.
* tree-inline.c (estimate_num_insns_1): If it is a CALL_EXPR for
* a
call to a target specific builtin, then use
target_builtin_call_cost.
(init_inline_once): Initialize target_builtin_call_cost field.
Co-Authored-By: Ramana Radhakrishnan <ramana@hercules.pun.celunite.com>
From-SVN: r128714
|
|
* builtins.def (BUILT_IN_VA_ARG_PACK): New built-in.
* tree.h (CALL_EXPR_VA_ARG_PACK): Define.
* tree-inline.h (copy_body_data): Add call_expr field.
* tree-inline.c (expand_call_inline): Initialize call_expr.
(copy_bb): Append anonymous inline fn arguments to arguments
when inlining a CALL_EXPR_VA_ARG_PACK call.
* builtins.c (expand_builtin): Issue an error if
BUILT_IN_VA_ARG_PACK is seen during expand.
(fold_call_expr, fold_builtin_call_array): Don't fold
CALL_EXPR_VA_ARG_PACK CALL_EXPRs or calls with
__builtin_va_arg_pack () call as last argument.
* gimplify.c (gimplify_call_expr): If last argument to a vararg
function is __builtin_va_arg_pack (), decrease number of call
arguments and instead set CALL_EXPR_VA_ARG_PACK on the CALL_EXPR.
* expr.c (expand_expr_real_1): Issue an error if
CALL_EXPR_VA_ARG_PACK CALL_EXPR is seen during expand.
* tree-pretty-print.c (dump_generic_node): Handle printing
CALL_EXPR_VA_ARG_PACK bit on CALL_EXPRs.
* doc/extend.texi (__builtin_va_arg_pack): Document.
* gcc.c-torture/execute/va-arg-pack-1.c: New test.
* gcc.dg/va-arg-pack-1.c: New test.
From-SVN: r128150
|
|
2007-09-05 Sandra Loosemore <sandra@codesourcery.com>
gcc/
Add target hook invoked when cfun changes.
* doc/tm.texi (TARGET_SET_CURRENT_FUNCTION): Document.
* target.h (struct gcc_target): Add set_current_function.
* target-def.h (TARGET_SET_CURRENT_FUNCTION): Define.
(TARGET_INITIALIZER): Add initializer for set_current_function.
* tree.h (push_struct_function): New.
* tree-inline.h (push_cfun, pop_cfun): Move declarations to...
* function.h: Here.
(set_cfun): Declare.
* tree-inline.c (cfun_stack, push_cfun, pop_cfun): Moved to...
* function.c: Here.
(push_function_context_to): Use allocate_struct_function
to create null context, not init_dummy_function_start. Use set_cfun.
(pop_function_context_from): Use set_cfun.
(in_dummy_function): New.
(invoke_set_current_function_hook): New.
(set_cfun): New.
(push_cfun, pop_cfun): Use set_cfun.
(push_struct_function): New.
(allocate_struct_function): Call invoke_set_current_function_hook
before returning.
(prepare_function_start): Don't set cfun here. Remove unused
argument; fix all callers.
(init_dummy_function_start): Fiddle with in_dummy_function. Call
push_struct_function.
(init_function_start): Set cfun here.
(expand_dummy_function_end): Fiddle with in_dummy_function. Pop cfun.
* omp-low.c (create_omp_child_function): Use push_struct_function
and pop_cfun to save/restore state.
(expand_omp_parallel): Remove unused saved_cfun variable.
* cgraphunit.c (ipa_passes): Use set_cfun.
* gimple-low.c (record_vars_into): Use push_cfun/pop_cfun here.
* dwarf2out.c (dwarf2out_abstract_function): Likewise.
* matrix-reorg.c (transform_allocation_sites): Likewise.
(matrix_reorg): Use set_cfun.
* gimplify.c (gimplify_function_tree): Use push_cfun/pop_cfun here.
* tree-optimize.c (tree_rest_of_compilation): Remove one redundant
assignment to cfun; use set_cfun for the other.
* tree-cfg.c (move_sese_region_to_fn): Use set_cfun.
(dump_function_to_file): Use push_cfun/pop_cfun here.
* c-decl.c (finish_function): Use set_cfun.
gcc/ada/
* trans.c (Compilation_unit_to_gnu): Use set_cfun.
* utils.c (end_subprog_body): Likewise.
gcc/cp/
* decl.c (finish_function): Use set_cfun.
* method.c (use_thunk): Likewise.
gcc/fortran/
* trans-decl.c (build_entry_thunks): Use set_cfun.
(gfc_generate_function_code): Likewise.
gcc/java/
* decl.c (finish_method): Use set_cfun.
gcc/treelang/
* treetree.c (tree_code_create_function_wrapup): Use set_cfun.
From-SVN: r128132
|
|
2007-08-28 Richard Guenther <rguenther@suse.de>
* tree.h (DECL_DISREGARD_INLINE_LIMITS): New.
(struct tree_function_decl): Make function_code a bitfield.
Add disregard_inline_limits flag.
* cgraphunit.c (cgraph_process_new_functions): Check
DECL_DISREGARD_INLINE_LIMITS instead of disregard_inline_limits_p.
(cgraph_preserve_function_body_p): Likewise.
* ipa-inline.c (compute_inline_parameters): Likewise.
* c-decl.c (finish_function): Set DECL_DISREGARD_INLINE_LIMITS
for GNU C extern inline functions.
(merge_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
* tree-inline.c (disregard_inline_limits_p): Remove.
* tree-inline.h (disregard_inline_limits_p): Likewise.
* c-common.c (handle_always_inline_attribute): Set
DECL_DISREGARD_INLINE_LIMITS.
* langhooks.c (add_builtin_function): Verify the function code
fits in the bitfield.
cp/
* decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
From-SVN: r127851
|
|
2007-08-20 Richard Guenther <rguenther@suse.de>
* c-objc-common.c (c_disregard_inline_limits): Remove.
* c-objc-common.h (c_disregard_inline_limits): Likewise.
* cgraphunit.c (cgraph_process_new_functions): Call
disregard_inline_limits_p.
(cgraph_preserve_function_body_p): Likewise.
* ipa-inline.c (compute_inline_parameters): Likewise.
* langhooks-def.h (lhd_tree_inlining_disregard_inline_limits):
Remove.
(LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS): Remove.
(LANG_HOOKS_TREE_INLINING_INITIALIZER): Remove initializer for
disregard_inline_limits langhook.
* langhooks.c (lhd_tree_inlining_disregard_inline_limits):
Remove.
* langhooks.h (lang_hooks_for_tree_inlining): Remove
disregard_inline_limits langhook.
* tree-inline.c (disregard_inline_limits_p): New function.
* tree-inline.h (disregard_inline_limits_p): Declare.
From-SVN: r127644
|
|
License and to point readers at the COPYING3 file and the FSF's license web page.
From-SVN: r126948
|
|
2007-03-31 Richard Guenther <rguenther@suse.de>
* omp-low.c (splay-tree.h): Include.
(lookup_decl): Replace splay-tree usage by pointer-map.
(maybe_lookup_decl): Likewise.
(new_omp_context): Likewise.
(delete_omp_context): Likewise.
* gimplify.c (splay-tree.h): Include.
* tree-inline.c (insert_decl_map): Replace splay-tree usage by
pointer-map.
(remap_ssa_name): Likewise.
(remap_decl): Likewise.
(remap_type_1): Likewise.
(remap_type): Likewise.
(copy_body_r): Likewise.
(expand_call_inline): Likewise.
(clone_body): Likewise.
(copy_tree_r): Likewise.
(remap_save_expr): Likewise.
(unsave_r): Likewise.
(unsave_expr_now): Likewise.
(tree_function_versioning): Likewise.
(build_duplicate_type): Likewise.
* tree-inline.h (pointer-set.h): Include instead of splay-tree.h.
(struct copy_body_data): Replace splay-tree by pointer-map.
* Makefile.in (TREE_INLINE_H): Depend on pointer-map.h, not $(SPLAY_TREE_H).
(gimplify.o): Depend on $(SPLAY_TREE_H).
(omp-low.p): Likewise.
* optimize.c (maybe_clone_body): Replace splay-tree usage by
pointer-map.
From-SVN: r123381
|
|
* tree-ssa-loop-unswitch.c: Include tree-inline.h.
(tree_unswitch_single_loop): Pass eni_size_weights to
tree_num_loop_insns.
* tree-ssa-loop-manip.c: Include tree-inline.h.
(can_unroll_loop_p): Pass eni_size_weights to
tree_num_loop_insns.
* tree-ssa-loop-ch.c (should_duplicate_loop_header_p):
Pass eni_size_weights to estimate_num_insns.
* tree.h (init_inline_once): Export.
* toplev.c (backend_init): Call init_inline_once.
* cgraphunit.c (cgraph_process_new_functions,
cgraph_analyze_function): Pass eni_inlining_weights to
estimate_num_insns.
* ipa-inline.c (compute_inline_parameters): Ditto.
* tree-ssa-loop-ivcanon.c (tree_num_loop_insns): Pass weights
to estimate_num_insns.
(try_unroll_loop_completely): Pass eni_size_weights to
tree_num_loop_insns.
* tree-eh.c (decide_copy_try_finally): Pass eni_size_weights
ot estimate_num_insns.
* tree-ssa-loop-prefetch.c: Include tree-inline.h.
(loop_prefetch_arrays): Pass eni_time_weights to tree_num_loop_insns.
* tree-inline.c (eni_inlining_weights, eni_size_weights,
eni_time_weights): New variables.
(init_inline_once): Initialize them.
(struct eni_data): Mew.
(estimate_num_insns_1, estimate_num_insns): Use weights.
* tree-inline.h (struct eni_weights_d): New.
(eni_inlining_weights, eni_size_weights, eni_time_weights): Declare.
(estimate_num_insns): Declaration changed.
* cfgloop.h (tree_num_loop_insns): Declaration changed.
* Makefile.in (tree-ssa-loop-unswitch.o, tree-ssa-loop-prefetch.o,
tree-ssa-loop-manip.o): Add TREE_INLINE_H dependency.
* gcc.dg/tree-ssa/loop-23.c: New test.
From-SVN: r121260
|
|
* cgraph.h (cgraph_decide_inlining_incrementally): Kill.
* tree-pass.h: Reorder to make IPA passes appear toegher.
(pass_early_inline, pass_inline_parameters, pass_apply_inline): Declare.
* cgraphunit.c (cgraph_finalize_function): Do not compute inling
parameters, do not call early inliner.
* ipa-inline.c: Update comments. Include tree-flow.h
(cgraph_decide_inlining): Do not compute inlining parameters.
(cgraph_decide_inlining_incrementally): Return TODOs; assume to
be called with function context set up.
(pass_ipa_inline): Remove unreachable functions before pass.
(cgraph_early_inlining): Simplify assuming to be called from the
PM as local pass.
(pass_early_inline): New pass.
(cgraph_gate_ipa_early_inlining): New gate.
(pass_ipa_early_inline): Turn into simple wrapper.
(compute_inline_parameters): New function.
(gate_inline_passes): New gate.
(pass_inline_parameters): New pass.
(apply_inline): Move here from tree-optimize.c
(pass_apply_inline): New pass.
* ipa.c (cgraph_remove_unreachable_nodes): Verify cgraph after
transforming.
* tree-inline.c (optimize_inline_calls): Return TODOs rather than
doing them by hand.
(tree_function_versioning): Do not allocate dummy struct function.
* tree-inline.h (optimize_inline_calls): Update prototype.
* tree-optimize.c (execute_fixup_cfg): Export.
(pass_fixup_cfg): Remove
(tree_rest_of_compilation): Do not apply inlines.
* tree-flow.h (execute_fixup_cfg): Declare.
* Makefile.in (gt-passes.c): New.
* passes.c: Include gt-passes.h
(init_optimization_passes): New passes.
(nnodes, order): New static vars.
(do_per_function_toporder): New function.
(execute_one_pass): Dump current pass here.
(execute_ipa_pass_list): Don't dump current pass here.
From-SVN: r120835
|
|
* tree-inline.c (copy_bb): Insert new statements to statements_to_fold
set.
(fold_marked_statements): New function.
(optimize_inline_calls, tree_function_versioning): Fold new statements.
* tree-inline.h (copy_body_data): Add statemetns_to_fold.
From-SVN: r120430
|
|
* invoke.texi (large-stack-frame, large-stack-frame-growth): New params.
* cgraph.c (dump_cgraph_node): Dump stack usage.
* cgraph.h (cgraph_local_info): Add estimated_self_stack_size.
(cgraph_global_info): Add estimated_stack_size and stack_frame_offset.
* cgraphunit.c (cgraph_analyze_function): Analyze stack sizes.
* ipa-inline.c (cgraph_clone_inlined_nodes): Propagate stack usage.
(cgraph_check_inline_limits): Limit stack growth.
* cfgexpand.c: Include tree-inline.h.
(account_stack_vars): New function.
(expand_one_var): New param to just account the stack; return estimated
size.
(expand_used_vars_for_block): Update call of expand_one_var.
(account_used_vars_for_block): New function.
(estimated_stack_frame_size): Likewise.
(init_vars_expansion, fini_vars_expansion): Break out from..
(expand_used_vars): ... here.
* tree-inline.h (estimated_stack_frame_size): Declare.
* params.def (PARAM_LARGE_STACK_FRAME, PARAM_STACK_FRAME_GROWTH): New.
From-SVN: r119281
|
|
* builtins.c, config/arm/arm.c, config/i386/cygwin.h,
config/i386/i386.c, config/ia64/ia64.c, config/s390/fixdfdi.h,
config/sh/sh.c, config/sh/sh.h, df-scan.c, except.c,
haifa-sched.c, optabs.c, rtl.h, sched-deps.c, sched-int.h,
sched-rgn.c, tree-inline.h, tree-ssa-dom.c,
tree-ssa-loop-prefetch.c, tree-ssa-operands.c,
tree-vect-patterns.c, tree-vrp.c: Fix comment typos. Follow
spelling convensions.
* config/ia64/ia64.opt, doc/contrib.texi, doc/invoke.texi,
doc/passes.texi, doc/tm.texi, doc/tree-ssa.texi: Fix comment
typos. Follow spelling conventions.
From-SVN: r112782
|
|
Merge from gomp branch:
* Makefile.in (TREE_INLINE_H): New. Use it as needed.
* tree-inline.h (struct copy_body_data): Move from tree-inline.c
and rename from struct inline_data. Rename callee* to dst*;
caller* to src*; add copy_decl hook, transform_call_graph_edges,
transform_new_cfg, transform_return_to_modify, and
transform_lang_insert_block flags; remove cloning_p, versioning_p,
update_clones_p.
(copy_body_r, insert_decl_map, remap_decl, remap_type): Declare.
(copy_decl_for_dup): Remove.
* tree-inline.c (struct inline_data): Move to header.
(insert_decl_map): Export.
(remap_decl): Update for member name changes. Use copy_decl hook.
Allow for replacement to be a non-decl. Remove dead code.
(remap_type_1): Check for existing mapping.
(remap_type): Export.
(remap_decls): Update for member name changes.
(remap_block, copy_bb, copy_cfg_body, copy_generic_body): Likewise.
(copy_body, setup_one_parameter, declare_return_variable): Likewise.
(expand_call_inline, optimize_inline_calls, clone_body): Likewise.
(copy_tree_r, mark_local_for_remap_r, unsave_expr_now): Likewise.
(tree_function_versioning, build_duplicate_type): Likewise.
(copy_body_r): Likewise. Export.
(copy_decl_for_dup): Split into ...
(copy_decl_for_dup_finish, copy_decl_to_var,
copy_decl_no_change, copy_decl_maybe_to_var): ... these.
(replace_ref_tree, inlining_p): Remove.
From-SVN: r109797
|
|
* cgraph.c (cgraph_insert_node_to_hashtable): New function.
* cgraph.h (cgraph_node): Add inline_decl.
(cgraph_insert_node_to_hashtable): Declare.
(save_inline_function_body): Declare.
* cgraphunit.c (verify_cgraph_node): Inline edges might point to inline
clones.
(cgraph_preserve_function_body_p): Do not presrve when dump is enabled.
(cgraph_function_versioning): Update call of tree_function_versioning.
(save_inline_function_body): New function.
* function.h (struct function): Kill saved_eh, saved_cfg, saved_args,
saved_static_chain_decl, saved_blocks and saved-unexpanded_var_list.
* ipa-inline.c (cgraph_mark_inline_edge): Look for inline clones.
(cgraph_default_inline_p): Likewise.
(cgraph_decide_inlining_incrementally): Likewise.
* tree-inline.c (inline_data): Kill saving_p add update_clones_p.
(copy_bb): Kill saving; do updating of clones.
(copy_cfg_body): Kill saving.
(initialize_inlined-parameters): Likewise.
(expand_call_inline): Likewise.
(save_body): Kill.
(tree_function_versioning): New parameter "update_clones".
(inlining_p): Kill saving.
* tree-inline.h (tree_function_versioning): Update prototype.
* tree-optimize.c (tree_rest_of_compilation): Use clonning instead of
saving.
From-SVN: r109580
|
|
From-SVN: r102626
|
|
From-SVN: r101317
|
|
* 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
|
|
* 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
|
|
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
|
|
* tree-inline.c (remap_save_expr): Make it static.
* tree-inline.h: Remove the corresponding prototype.
From-SVN: r90313
|
|
* 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
|
|
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
|
|
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
|
|
From-SVN: r81764
|
|
* 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-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
|
|
* 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
|
|
* genattrtab.h, hosthooks-def.h, hosthooks.h, langhooks-def.h,
langhooks.h, tree-inline.h: Replace "GNU CC" with "GCC".
From-SVN: r64298
|
|
* 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
|
|
* 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
|
|
* 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
|
|
* 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
|
|
* 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
|