aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.h
AgeCommit message (Collapse)AuthorFilesLines
2012-01-11tree.h (build_function_decl_skip_args): Add boolean parameter.Eric Botcazou1-4/+4
* tree.h (build_function_decl_skip_args): Add boolean parameter. (build_function_type_skip_args): Delete. * tree.c (build_function_type_skip_args): Make static and add SKIP_RETURN parameter. Fix thinko in the handling of variants. (build_function_decl_skip_args): Add SKIP_RETURN parameter and pass it to build_function_type_skip_args. * cgraph.h (cgraph_function_versioning): Add boolean parameter. (tree_function_versioning): Likewise. * cgraph.c (cgraph_create_virtual_clone): Adjust call to build_function_decl_skip_args. * cgraphunit.c (cgraph_function_versioning): Add SKIP_RETURN parameter and pass it to build_function_decl_skip_args/tree_function_versioning. (cgraph_materialize_clone): Adjust call to tree_function_versioning. * ipa-inline-transform.c (save_inline_function_body): Likewise. * trans-mem.c (ipa_tm_create_version): Likewise. * tree-sra.c (modify_function): Ditto for cgraph_function_versioning. * tree-inline.c (declare_return_variable): Remove always-true test. (tree_function_versioning): Add SKIP_RETURN parameter. If the function returns non-void and SKIP_RETURN, create a void-typed RESULT_DECL. * ipa-split.c (split_function): Skip the return value for the split part if it doesn't return. From-SVN: r183102
2012-01-06correct commentJason Merrill1-1/+1
From-SVN: r182965
2011-12-01re PR middle-end/51273 (ICE: vector VEC(inline_summary_t,base) index domain ↵Patrick Marlier1-0/+2
error, in inline_summary at ipa-inline.h:193 with -O -fgnu-tm, transaction_safe and overloaded contructor) PR middle-end/51273 * cgraph.h (cgraph_call_node_duplication_hooks): Declare. * cgraph.c (cgraph_call_node_duplication_hooks): Make global. * cgraphunit.c (cgraph_copy_node_for_versioning): Call it. From-SVN: r181887
2011-11-14sw-1.c: Force rep;movsb.Zolotukhin Michael1-0/+2
* gcc.target/i386/sw-1.c: Force rep;movsb. * config/i386/i386.h (processor_costs): Add second dimension to stringop_algs array. * config/i386/i386.c (cost models): Initialize second dimension of stringop_algs arrays. (core_cost): New costs based on generic64 costs with updated stringop values. (promote_duplicated_reg): Add support for vector modes, add declaration. (promote_duplicated_reg_to_size): Likewise. (processor_target): Set core costs for core variants. (expand_set_or_movmem_via_loop_with_iter): New function. (expand_set_or_movmem_via_loop): Enable reuse of the same iters in different loops, produced by this function. (emit_strset): New function. (expand_movmem_epilogue): Add epilogue generation for bigger sizes, use SSE-moves where possible. (expand_setmem_epilogue): Likewise. (expand_movmem_prologue): Likewise for prologue. (expand_setmem_prologue): Likewise. (expand_constant_movmem_prologue): Likewise. (expand_constant_setmem_prologue): Likewise. (decide_alg): Add new argument align_unknown. Fix algorithm of strategy selection if TARGET_INLINE_ALL_STRINGOPS is set; Skip sse_loop (decide_alignment): Update desired alignment according to chosen move mode. (ix86_expand_movmem): Change unrolled_loop strategy to use SSE-moves. (ix86_expand_setmem): Likewise. (ix86_slow_unaligned_access): Implementation of new hook slow_unaligned_access. * config/i386/i386.md (strset): Enable half-SSE moves. * config/i386/sse.md (vec_dupv4si): Add expand for vec_dupv4si. (vec_dupv2di): Add expand for vec_dupv2di. Co-Authored-By: Jan Hubicka <jh@suse.cz> From-SVN: r181357
2011-11-08Merge from transactional-memory branch.Aldy Hernandez1-0/+20
From-SVN: r181154
2011-09-06ipa-inline.h (struct inline_summary): Move versionable flag...Martin Jambor1-1/+4
2011-09-06 Martin Jambor <mjambor@suse.cz> * ipa-inline.h (struct inline_summary): Move versionable flag... * cgraph.h (struct cgraph_local_info): ...here * ipa-cp.c (determine_versionability): Use the new versionable flag. (determine_versionability): Likewise. (ipcp_versionable_function_p): Likewise. (ipcp_generate_summary): Likewise. * ipa-inline-analysis.c (dump_inline_summary): Do not dump the versionable flag. (compute_inline_parameters): Do not clear the versionable flag. (inline_read_section): Do not stream the versionable flag. (inline_write_summary): Likewise. * lto-cgraph.c (lto_output_node): Stream the versionable flag. (input_overwrite_node): Likewise. From-SVN: r178598
2011-09-02cgraph.h (cgraph_indirect_call_info): Removed field thunk_delta.Martin Jambor1-5/+1
2011-09-02 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Removed field thunk_delta. * gimple-fold.c (gimple_get_virt_method_for_binfo): Rewritten to use BINFO_VTABLE. Parameter delta removed, all callers updated. * tree.c (free_lang_data_in_binfo): Clear BINFO_VIRTUALs instead BINFO_VTABLE. * cgraph.c (cgraph_make_edge_direct): Removed parameter delta, updated all calls. * cgraphunit.c (cgraph_redirect_edge_call_stmt_to_callee): Removed handling of thunk_delta. * ipa-cp.c (get_indirect_edge_target): Removed parameter delta. (devirtualization_time_bonus): Do not handle thunk deltas. (ipcp_discover_new_direct_edges): Likewise. * ipa-prop.c (ipa_make_edge_direct_to_target): Likewise. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. * lto-cgraph.c (output_cgraph_opt_summary_p): Likewise. Mark parameter set as unused. (output_edge_opt_summary): Likewise. Mark both parameters as unused. * lto-cgraph.c (output_cgraph_opt_summary_p): Likewise. Mark parameter set as unused. (output_edge_opt_summary): Likewise. Mark both parameters as unused. (input_edge_opt_summary): Likewise. * lto-streamer-out.c (lto_output_ts_binfo_tree_pointers): Do not stream BINFO_VIRTUALS at all. * lto-streamer-in.c (lto_input_ts_binfo_tree_pointers): Likewise. * testsuite/g++.dg/ipa/devirt-3.C: Added a distraction method. * testsuite/g++.dg/ipa/ivinline-7.C: Added a test for direct call discovery, xfailed test for inlining. * testsuite/g++.dg/ipa/ivinline-9.C: Likewise. From-SVN: r178472
2011-07-12cgraph.h (cgraph_get_node_or_alias): Removed declaration.Martin Jambor1-1/+0
2011-07-12 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_get_node_or_alias): Removed declaration. * cgraph.c (cgraph_get_node_or_alias): Removed. (change_decl_assembler_name): Changed all calls to cgraph_get_node_or_alias to a call to cgraph_get_node. (cgraph_make_decl_local): Likewise. * lto-symtab.c (lto_symtab_resolve_symbols): Likewise. * varasm.c (default_binds_local_p_1): Likewise. (decl_binds_to_current_def_p): Likewise. From-SVN: r176196
2011-07-08cgraph.c (cgraph_add_to_same_comdat_group): New.Jason Merrill1-0/+1
gcc/ * cgraph.c (cgraph_add_to_same_comdat_group): New. * cgraph.h: Declare it. * ipa.c (function_and_variable_visibility): Make sure thunks have the right visibility. gcc/cp/ * method.c (use_thunk): Use cgraph_add_to_same_comdat_group. * optimize.c (maybe_clone_body): Likewise. * semantics.c (maybe_add_lambda_conv_op): Likewise. From-SVN: r176071
2011-07-01re PR middle-end/49596 (FAIL: gcc.dg/torture/pr43879_1.c)Richard Guenther1-1/+2
2011-07-01 Richard Guenther <rguenther@suse.de> PR middle-end/49596 * cgraph.h (varpool_all_refs_explicit_p): Not analyzed nodes may have unknown refs. From-SVN: r175753
2011-06-22re PR tree-optimization/49493 (ICE: in insert_vi_for_tree, at ↵Richard Guenther1-4/+4
tree-ssa-structalias.c:2637 with -O -fipa-pta) 2011-06-22 Richard Guenther <rguenther@suse.de> PR tree-optimization/49493 * tree-ssa-structalias.c (get_constraint_for_ssa_var): Refer to the alias target of variables. (associate_varinfo_to_alias_1): Remove. (ipa_pta_execute): Do not associate aliases with anything. * cgraph.h (varpool_alias_aliased_node): Fix cut&paste errors. (cgraph_function_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_variable_node): Likewise. * gcc.dg/ipa/ipa-pta-17.c: New testcase. From-SVN: r175300
2011-06-18lto-symtab.c (lto_varpool_replace_node): Remove code handling extra name ↵Jan Hubicka1-3/+49
aliases. * lto-symtab.c (lto_varpool_replace_node): Remove code handling extra name aliases. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_merge_cgraph_nodes): Update alias_of pointers. * cgraphbuild.c (record_reference): Remove extra body alias code. (mark_load): Likewise. (mark_store): Likewise. * cgraph.h (varpool_node): Remove extra_name filed; add alias_of and extraname_alias. (varpool_create_variable_alias, varpool_for_node_and_aliases): Declare. (varpool_alias_aliased_node): New inline function. (varpool_variable_node): New function. * cgraphunit.c (handle_alias_pairs): Handle also variable aliases. * ipa-ref.c (ipa_record_reference): Allow aliases on variables. * lto-cgraph.c (lto_output_varpool_node): Update streaming. (input_varpool_node): Likewise. * lto-streamer-out.c (produce_symtab): Remove extra name aliases. (varpool_externally_visible_p): Remove extra body alias code. (function_and_variable_visibility): Likewise. * tree-ssa-structalias.c (associate_varinfo_to_alias_1): New function. (ipa_pta_execute): Use it. * varpool.c (varpool_remove_node): Remove extra name alias code. (varpool_mark_needed_node): Likewise. (varpool_analyze_pending_decls): Analyze aliases. (assemble_aliases): New functoin. (varpool_assemble_decl): Use it. (varpool_create_variable_alias): New function. (varpool_extra_name_alias): Rewrite. (varpool_for_node_and_aliases): New function. From-SVN: r175167
2011-06-13cgraph.c (cgraph_for_node_thunks_and_aliases, [...]): Fix thinko in ↵Jan Hubicka1-14/+1
recursive walking. * cgraph.c (cgraph_for_node_thunks_and_aliases, cgraph_for_node_and_aliases): Fix thinko in recursive walking. (nonremovable_p): New function. (cgraph_can_remove_if_no_direct_calls_p): New function. (used_from_object_file_p): New functoin. (cgraph_will_be_removed_from_program_if_no_direct_calls): Look for references from aliases. * cgraph.h (cgraph_can_remove_if_no_direct_calls_p): Bring offline. * ipa-inline.c (check_caller_edge): New function. (want_inline_function_called_once_p): Use it; accept aliases called once, too. * ipa-inline-analysis.c (do_estimate_growth): Remove FIXME. From-SVN: r174985
2011-06-11lto-symtab.c (lto_cgraph_replace_node): Kill same body alias code.Jan Hubicka1-11/+43
* lto-symtab.c (lto_cgraph_replace_node): Kill same body alias code. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_merge_cgraph_nodes): Update merging of aliases. * cgraph.c (same_body_aliases_done): New global var. (cgraph_same_body_alias_1): Rename to ... (cgraph_create_function_alias): ... this one; reorg to new representation. (cgraph_same_body_alias): Use cgraph_create_function_alias; record references when asked to. (cgraph_add_thunk): Fix formating. (cgraph_get_node): Kill same body alias code. (cgraph_node_for_asm): Likewise. (cgraph_remove_same_body_alias): Remove. (cgraph_remove_node): Kill same body alias code. (cgraph_mark_address_taken_node): Mark also the aliased function as having address taken. (dump_cgraph_node): Dump same body aliases. (cgraph_for_node_thunks_and_aliases): Update for new alias representation. (cgraph_for_node_and_aliases): Likewise. * cgraph.h (same_body): Kll pointer. (same_body_alias): Update comment. (same_body_aliases_done): Declare. (cgraph_remove_same_body_alias): Remove declaration. (cgraph_create_function_alias): Declare. (cgraph_process_same_body_aliases): Declare. (cgraph_function_with_gimple_body_p): Check for alias. (cgraph_can_remove_if_no_direct_calls_p): Look for aliases. (cgraph_alias_aliased_node): New function. (cgraph_function_node): Update for new aliases. (cgraph_function_or_thunk_node): Likewise. * ipa-inline-transform.c (can_remove_node_now_p): Look for aliases. (inline_call): Remove dead aliases. * cgraphunit.c (cgraph_decide_is_function_needed): Disable assembler name hack for same body aliases. (clone_of_p): Look through aliases. (verify_cgraph_node): Verify aliases. (cgraph_analyze_function): Analyze aliases; fixup C++ bugs. (cgraph_process_same_body_aliases): New function. (process_function_and_variable_attributes): Disable weakref warning on alias. (cgraph_analyze_functions): Handle aliases. (cgraph_mark_functions_to_output): Handle aliases same way as thunks. (assemble_thunks): Rename to ... (assemble_thunks_and_aliases): ... this one; handle aliases, too. (cgraph_expand_function): Remove alias output code. (cgraph_output_in_order): Skip aliases. (cgraph_preserve_function_body_p): Aliases don't need preserving. * ipa-ref.c (ipa_ref_use_name): Add alias reference. (ipa_record_reference): Do not assert on alias references. (ipa_ref_has_aliases_p): New function. * ipa-ref.h (enum ipa_ref_use): Add IPA_REF_ALIAS. (ipa_ref_has_aliases_p): Declare. * lto-cgraph.c (lto_output_node): Handle aliases. (input_node): Likewise. * lto-streamer-out.c (lto_output): Skip aliases. (produce_symtab): Kill same_body_alias code. * ipa-utils.c (ipa_reverse_postorder): Add FIXME. (ipa_reverse_postorder): Use cgraph_only_called_directly_or_aliased_p. * ipa-inline.c (update_caller_keys): Walk aliases. (inline_small_functions): Fix thinko in previous patch. * ipa.c (cgraph_externally_visible_p): Do not walk aliases. (function_and_variable_visibility): Do not walk same body aliases. * tree-ssa-structalias.c (associate_varinfo_to_alias): New function. (ipa_pta_execute): Use it. * lto.c (add_cgraph_node_to_partition_1): Break out from ... (add_cgraph_node_to_partition) ... here; walk aliases. (lto_1_to_1_map): Remove same body alias code. (promote_fn): Likewise. (lto_promote_cross_file_statics): Update comment. * decl2.c (cp_write_global_declarations): Process aliases; look trhough same body aliases. From-SVN: r174952
2011-06-10cgraph.h (cgraph_only_called_directly_or_aliased_p): Rename from ...Jan Hubicka1-12/+62
* cgraph.h (cgraph_only_called_directly_or_aliased_p): Rename from ... (cgraph_only_called_directly_p): ... this one; bring offline. (resolution_used_from_other_file_p, cgraph_used_from_object_file_p, varpool_used_from_object_file_p): Drop names from the declaratoin. (cgraph_for_node_thunks_and_aliases, cgraph_for_node_and_aliases, collect_callers_of_node): New. (cgraph_function_node, cgraph_function_or_thunk_node): New functions. (cgraph_edge_recursive_p): Use cgraph_function_node. * cgraph.c (cgraph_add_thunk): Check that thunk is not already alias. (cgraph_node_cannot_be_local_p_1): Break out from ... (cgraph_node_can_be_local_p): ... here; walk aliases. (cgraph_for_node_thunks_and_aliases): New function. (cgraph_for_node_and_aliases): New function. (cgraph_make_node_local_1): Break out from ... (cgraph_make_node_local) ... here; use cgraph_for_node_thunks_and_aliases. (cgraph_set_nothrow_flag_1): Break out from ... (cgraph_set_nothrow_flag) ... here; use cgraph_for_node_thunks_and_aliases. (cgraph_set_const_flag_1): Break out from ... (cgraph_set_const_flag) ... here; use cgraph_for_node_thunks_and_aliases. (cgraph_set_pure_flag_1): Break out from ... (cgraph_set_pure_flag) ... here; use cgraph_for_node_thunks_and_aliases. (cgraph_propagate_frequency_1): Break out from ... (cgraph_propagate_frequency) ... here; use cgraph_for_node_thunks_and_aliases. (cgraph_used_from_object_file_p): Do not care about aliases. (cgraph_not_only_called_directly_p_1, cgraph_only_called_directly_p): New functions. (collect_callers_of_node_1, collect_callers_of_node): New functions. From-SVN: r174871
2011-05-31cgraph.h (cgraph_inline_failed_t): Give enum a nameJan Hubicka1-1/+1
* cgraph.h (cgraph_inline_failed_t): Give enum a name * lto-cgraph.c (LDPR_NUM_KNOWN): New macro. (LTO_cgraph_tags): Add LTO_cgraph_last_tag. (lto_output_edge): Use output_enum and var_len_unsigned. (lto_output_varpool_node): Likewise. (input_overwrite_node): Do not take resolution parameter; extract it from a bitpack. (input_node): Do not read resolution; use input_enum and var_len_unsigned. (input_varpool_node): Likewise. (input_edge): Likewise. (input_cgraph_1): Likewise. From-SVN: r174487
2011-05-08cgraph.c (cgraph_clone_node): Add call_duplication_hook parameter.Jan Hubicka1-1/+2
* cgraph.c (cgraph_clone_node): Add call_duplication_hook parameter. (cgraph_create_virtual_clone): Call hooks once virtual clone is finished. * cgraph.h (cgraph_clone_node): Update prototype. * ipa-cp.c (ipcp_estimate_growth): Use estimate_ipcp_clone_size_and_time. * ipa-inline-transform.c (clone_inlined_nodes): Update. * lto-cgraph.c (input_node): Update. * ipa-inline.c (recursive_inlining): Update. * ipa-inline.h (estimate_ipcp_clone_size_and_time): New function. (evaluate_conditions_for_known_args): Break out from ... (evaluate_conditions_for_edge): ... here. (evaluate_conditions_for_ipcp_clone): New function. (inline_node_duplication_hook): Update clone summary based on parameter map. (estimate_callee_size_and_time): Rename to ... (estimate_node_size_and_time): take NODE instead of EDGE; take POSSIBLE_TRUTHS as argument. (estimate_callee_size_and_time): Update. (estimate_ipcp_clone_size_and_time): New function. (do_estimate_edge_time): Update. From-SVN: r173551
2011-05-06cgraph.c (cgraph_add_thunk): Create real function node instead of alias node...Jan Hubicka1-0/+73
* cgraph.c (cgraph_add_thunk): Create real function node instead of alias node; finalize it and mark needed/reachale; arrange visibility to be right and add it into the corresponding same comdat group list. (dump_cgraph_node): Dump thunks. * cgraph.h (cgraph_first_defined_function, cgraph_next_defined_function, cgraph_function_with_gimple_body_p, cgraph_first_function_with_gimple_body, cgraph_next_function_with_gimple_body): New functions. (FOR_EACH_FUNCTION_WITH_GIMPLE_BODY, FOR_EACH_DEFINED_FUNCTION): New macros. * ipa-cp.c (ipcp_need_redirect_p): Thunks can't be redirected. (ipcp_generate_summary): Use FOR_EACH_FUNCTION_WITH_GIMPLE_BODY. * cgraphunit.c (cgraph_finalize_function): Only look into possible devirtualization when optimizing. (verify_cgraph_node): Verify thunks. (cgraph_analyze_function): Analyze thunks. (cgraph_mark_functions_to_output): Output thunks only in combination with function they are assigned to. (assemble_thunk): Turn thunk into non-thunk; don't try to turn alias into normal node. (assemble_thunks): New functoin. (cgraph_expand_function): Use it. * lto-cgraph.c (lto_output_node): Stream thunks. (input_overwrite_node): Stream in thunks. * ipa-pure-const.c (analyze_function): Thunks do nothing interesting. * lto-streamer-out.c (lto_output): Do not try to output thunk's body. * ipa-inline.c (inline_small_functions): Use FOR_EACH_DEFINED_FUNCTION. * ipa-inline-analysis.c (compute_inline_parameters): "Analyze" thunks. (inline_analyze_function): Do not care about thunk jump functions. (inline_generate_summary):Use FOR_EACH_DEFINED_FUNCTION. * ipa-prop.c (ipa_prop_write_jump_functions): Use cgraph_function_with_gimple_body_p. * passes.c (do_per_function_toporder): Use cgraph_function_with_gimple_body_p. (execute_one_pass);Use FOR_EACH_FUNCTION_WITH_GIMPLE_BODY. (ipa_write_summaries): Use cgraph_function_with_gimple_body_p. (function_called_by_processed_nodes_p): Likewise. * lto.c (lto_materialize_function): Use cgraph_function_with_gimple_body_p. (add_cgraph_node_to_partition): Do not re-add items to partition; handle thunks. (add_varpool_node_to_partition): Do not re-add items to partition. From-SVN: r173517
2011-05-03cgraph.h (cgraph_node_set_def, [...]): Move out of GTY; replace hash by ↵Jan Hubicka1-30/+10
pointer map. * cgraph.h (cgraph_node_set_def, varpool_node_set_def): Move out of GTY; replace hash by pointer map. (cgraph_node_set_element_def, cgraph_node_set_element, const_cgraph_node_set_element, varpool_node_set_element_def, varpool_node_set_element, const_varpool_node_set_element): Remove. (free_cgraph_node_set, free_varpool_node_set): New function. (cgraph_node_set_size, varpool_node_set_size): Use vector size. * tree-emutls.c: Free varpool node set. * ipa-utils.c (cgraph_node_set_new, cgraph_node_set_add, cgraph_node_set_remove, cgraph_node_set_find, dump_cgraph_node_set, debug_cgraph_node_set, free_cgraph_node_set, varpool_node_set_new, varpool_node_set_add, varpool_node_set_remove, varpool_node_set_find, dump_varpool_node_set, free_varpool_node_set, debug_varpool_node_set): Move here from ipa.c; implement using pointer_map * ipa.c (cgraph_node_set_new, cgraph_node_set_add, cgraph_node_set_remove, cgraph_node_set_find, dump_cgraph_node_set, debug_cgraph_node_set, varpool_node_set_new, varpool_node_set_add, varpool_node_set_remove, varpool_node_set_find, dump_varpool_node_set, debug_varpool_node_set): Move to ipa-uitls.c. * lto/lto.c (ltrans_partition_def): Remove GTY annotations. (ltrans_partitions): Move to heap. (new_partition): Update. (free_ltrans_partitions): New function. (lto_wpa_write_files): Use it. * passes.c (ipa_write_summaries): Update. From-SVN: r173334
2011-04-30cgraph.h (cgraph_postorder): Remove declaration.Martin Jambor1-1/+0
2011-04-29 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_postorder): Remove declaration. * ipa-utils.h (ipa_free_postorder_info): Declare. (ipa_reverse_postorder): Likewise. * cgraphunit.c: Include ipa-utils.h. (cgraph_expand_all_functions): Update call to ipa_reverse_postorder. * ipa-inline.c: Include ipa-utils.h. (ipa_inline): Update call to ipa_reverse_postorder. * ipa-pure-const.c (propagate_pure_const): Update call to ipa_reduced_postorder and ipa_print_order. Call ipa_free_postorder_info to clean up. (propagate_nothrow): Likewise. * ipa-reference.c (propagate): Removed a useless call to ipa_utils_reduced_inorder, updated a call to ipa_reduced_postorder and ipa_print_order. Call ipa_free_postorder_info to clean up. * ipa.c: Include ipa-utils.h. (ipa_profile): Update call to ipa_reverse_postorder. (cgraph_postorder): Moved to... * ipa-utils.c (ipa_reverse_postorder): ...here and renamed. (ipa_utils_print_order): Renamed to ipa_print_order. (ipa_utils_reduced_inorder): Renamed to ipa_reduced_postorder. Updated comments. (ipa_free_postorder_info): New function. * passes.c: Include ipa-utils.h. (do_per_function_toporder): Update call to ipa_reverse_postorder. (ipa_write_summaries): Likewise. * Makefile.in (passes.o): Add IPA_UTILS_H to dependencies. (cgraphunit.o): Likewise. (ipa.o): Likewise. (ipa-inline.o): Likewise. lto/ * lto.c: Include ipa-utils.h. (lto_balanced_map): Update call to ipa_reverse_postorder. * Make-lang.in (lto/lto.o): Add IPA_UTILS_H to dependencies. From-SVN: r173197
2011-04-29cgraphunit.c (cgraph_preserve_function_body_p): Accept a cgraph node instead ↵Martin Jambor1-1/+1
of a decl. 2011-04-29 Martin Jambor <mjambor@suse.cz> * cgraphunit.c (cgraph_preserve_function_body_p): Accept a cgraph node instead of a decl. Update all callers. * cgraph.h: Update declaration. From-SVN: r173138
2011-04-26cgraphbuild.c (build_cgraph_edges): Update call of cgraph_create_edge and ↵Jan Hubicka1-10/+5
cgraph_create_indirect_edge. * cgraphbuild.c (build_cgraph_edges): Update call of cgraph_create_edge and cgraph_create_indirect_edge. * cgraph.c (cgraph_create_edge_including_clones, cgraph_create_edge_1, cgraph_allocate_init_indirect_info, cgraph_update_edges_for_call_stmt_node): Do not take nest argument; do not initialize call_stmt_size/time. (dump_cgraph_node): Do not dump nest. (cgraph_clone_edge): Do not take loop_nest argument; do not propagate it; do not clone call_stmt_size/time. (cgraph_clone_node): Likewise. (cgraph_create_virtual_clone): Update. * cgraph.h (struct cgraph_edge): Remove call_stmt_size/call_stmt_time/loop_nest. (cgraph_create_edge, cgraph_create_indirect_edge, cgraph_create_edge_including_clones, cgraph_clone_node): Update prototype. * tree-emutls.c (gen_emutls_addr): Update. * ipa-inline-transform.c (update_noncloned_frequencies): Do not handle loop_nest; handle indirect calls, too. (clone_inlined_nodes): Do not care about updating inline summaries. * cgraphunit.c (cgraph_copy_node_for_versioning): Update. * lto-cgraph.c (lto_output_edge, input_node, input_edge): Do not stream call_stmt_size/call_stmt_time/loop_nest. * ipa-inline.c (edge_badness): Update. (ipa_inline): dump summaries after inlining. * ipa-inline.h (struct inline_edge_summary, inline_edge_summary_t): new. (inline_edge_summary): New function. * ipa-inline-analysis.c (edge_duplication_hook_holder): New holder. (inline_edge_removal_hook): Handle edge summaries. (inline_edge_duplication_hook): New hook. (inline_summary_alloc): Alloc hooks. (initialize_growth_caches): Do not register removal hooks. (free_growth_caches); Do not free removal hook. (dump_inline_edge_summary): New function. (dump_inline_summary): Use it. (estimate_function_body_sizes, estimate_edge_size_and_time): Update. (inline_update_callee_summaries): New function. (inline_merge_summary): Use it. (do_estimate_edge_time, do_estimate_edge_growth): Update. (read_inline_edge_summary): New function. (inline_read_section): Use it. (write_inline_edge_summary): New function. (inline_write_summary): Use it. (inline_free_summary): Free edge new holders. * tree-inline.c (copy_bb): Update. From-SVN: r172989
2011-04-22gengtype.c (open_base_files): Add ipa-inline.h include.Jan Hubicka1-5/+0
* gengtype.c (open_base_files): Add ipa-inline.h include. * ipa-cp.c (ipcp_get_lattice, ipcp_lattice_from_jfunc): Move to ipa-prop.c update all uses. * ipa-prop.c: (ipa_get_lattice, ipa_lattice_from_jfunc): ... here. * ipa-inline-transform.c (inline_call): Use inline_merge_summary to merge summary of inlined function into former caller. * ipa-inline.c (max_benefit): Remove. (edge_badness): Compensate for removal of benefits. (update_caller_keys): Use reset_node_growth_cache/reset_edge_growth_cache. (update_callee_keys): Likewise. (update_all_callee_keys): Likewise. (inline_small_functions): Do not collect max_benefit; do not reset stimated_growth; call free_growth_caches and initialize_growth_caches. * ipa-inline.h (struct condition, type clause_t, struct predicate, struct size_time_entry): New structures. (INLINE_SIZE_SCALE, INLINE_TIME_SCALE, MAX_CLAUSES): New constants. (inline_summary): Remove size_inlining_benefit, time_inlining_benefit and estimated_growth. (edge_growth_cache_entry): New structure. (node_growth_cache, edge_growth_cache): New global vars. (estimate_growth): Turn into inline. (inline_merge_summary, do_estimate_edge_growth, do_estimate_edge_time, initialize_growth_caches, free_growth_caches): Declare. (estimate_edge_growth): Rewrite. (estimate_edge_time): Implement as inline cache lookup. (reset_node_growth_cache, reset_edge_growth_cache): New inline functions. (MAX_TIME): Reduce to allow multiplicatoin by INLINE_SIZE_SCALE. (NUM_CONDITIONS): New constant. (predicate_conditions): New enum. (IS_NOT_CONSTANT): New constant. (edge_removal_hook_holder): New var. (node_growth_cache, edge_growth_cache): New global vars. (true_predicate, single_cond_predicate, false_predicate, not_inlined_predicate, add_condition, add_clause, and_predicates, or_predicates, predicates_equal_p, evaulate_predicate, dump_condition, dump_clause, dump_predicate, account_size_time, evaulate_conditions_for_edge): New functions. (inline_summary_alloc): Move to heap. (inline_node_removal_hook): Clear condition and entry vectors. (inline_edge_removal_hook): New function. (initialize_growth_caches, free_growth_caches): New function. (dump_inline_summary): Update. (edge_execution_predicate): New function. (will_be_nonconstant_predicate): New function. (estimate_function_body_sizes): Compute BB and constantness predicates. (compute_inline_parameters): Do not clear estimated_growth. (estimate_edge_size_and_time): New function. (estimate_calls_size_and_time): New function. (estimate_callee_size_and_time): New function. (remap_predicate): New function. (inline_merge_summary): New function. (do_estimate_edge_time): New function based on... (estimate_edge_time): ... this one. (do_estimate_edge_growth): New function. (do_estimate_growth): New function based on.... (estimate_growth): ... this one. (inline_analyze_function): Analyze after deciding on jump functions. (inline_read_section): New function. (inline_read_summary): Use it. (inline_write_summary): Write all the new data. * ipa-prop.c (ipa_get_param_decl_index): Export. (ipa_lattice_from_jfunc): Move here from ipa-cp.c * ipa-prop.h (ipa_get_param_decl_index, ipa_lattice_from_jfunc): Declare. (ipa_get_lattice): Move hre from ipa-cp.c * Makefile.in (GTFILES): Add ipa-inline.h and ipa-inline-analysis.c * params.def (PARAM_EARLY_INLINING_INSNS): Set to 11. * cgraph.h (cgraph_clone_inlined_nodes, compute_inline_parameters, cgraph_edge_inlinable_p): Remove. * cgraphunit.c: Include ipainline.h (cgraph_process_new_functions): Update call of compute_inline_parameters. * gcc.dg/tree-ssa/pr38699.c: Fix testcase. From-SVN: r172873
2011-04-22Remove cgraph pidXinliang David Li1-5/+0
From-SVN: r172848
2011-04-19cgraph.h (save_inline_function_body): Remove.Jan Hubicka1-2/+0
* cgraph.h (save_inline_function_body): Remove. * ipa-inline-transform.c: New file, broke out of... * ipa-inline.c: ... this one; Update toplevel comment. (ncalls_inlined, nfunctions_inlined): Move to ipa-inline-transform.c; make global. (update_noncloned_frequencies): Move to ipa-inline-transform.c (cgraph_mark_inline_edge): Rename to inline_call; move to ipa-inline-transform.c. (cgraph_clone_inlined_nodes): Rename to clone_inlined_nodes; move to ipa-inline-transform.c (recursive_inlining, inline_small_functions, flatten_function, ipa_inline, inline_always_inline_functions, early_inline_small_functions): Update. (inline_transform): Move to ipa-inline-transform.c. * ipa-inline.h (inline_call, inline_transform, clone_inlined_nodes): Declare. * Makefile.in (ipa-inline-transform.o): New file. * cgraphunit.c (save_inline_function_body): Move to ipa-inline-transform.c From-SVN: r172739
2011-04-19cgraph.h (cgraph_optimize_for_size_p): Declare.Jan Hubicka1-0/+1
* cgraph.h (cgraph_optimize_for_size_p): Declare. * ipa-cp.c (ipcp_insert_stage): Use cgraph_optimize_for_size_p. * predict.c (cgraph_optimize_for_size_p): Break out from ... (optimize_function_for_size_p) ... here. From-SVN: r172711
2011-04-17cgrpah.h (struct cgraph_node): Remove finalized_by_frontend.Jan Hubicka1-2/+0
* cgrpah.h (struct cgraph_node): Remove finalized_by_frontend. * cgrpahunit.c (cgraph_finalize_function): Do not set finalized_by_frontend. * lto-cgraph.c (lto_output_node, input_overwrite_node): Do not stream finalized_by_frontend. From-SVN: r172614
2011-04-17re PR middle-end/20991 (ICE in cgraph_mark_reachable_node)Jan Hubicka1-4/+0
* cgraph.c (cgraph_clone_node): Do not handle vtable_method * cgraph.h (struct cgraph_local_info): Drop vtable_method. * cgraphunit.c (cgraph_copy_node_for_versioning): Drop vtable_method. * lto-cgraph.c (lto_output_node, input_overwrite_node): Drop vtable method. * gimple-fold.c (can_refer_decl_in_current_unit_p): Mention PR20991 in gimple-fold.c * varasm.c (mark_decl_referenced): Drop vtable_method handling code. * cp/class.c (cp_fold_obj_type_ref): Drop vtable_method. From-SVN: r172613
2011-04-16cgraphbuild.c: Include ipa-inline.h.Jan Hubicka1-22/+0
* cgraphbuild.c: Include ipa-inline.h. (reset_inline_failed): Use initialize_inline_failed. * cgraph.c: Include ipa-inline.h. (cgraph_create_node_1): Do not initialize estimated_growth. (initialize_inline_failed): More to ipa-inline-analysis.c (dump_cgraph_node): Do not dump inline flags. * cgraph.h (cgraph_local_info): Remove inlineable, versionable and disregard_inline_limits flags. (cgrpah_global_info): Remove estimated_stack_size, stack_frame_offset, time, size, estimated_growth. * ipa-cp.c (ipcp_versionable_function_p, ipcp_generate_summary): Update. * cgraphunit.c (cgraph_decide_is_function_needed): Use DECL_DISREGARD_INLINE_LIMITS. (cgraph_analyze_function): Do not initialize node->local.disregard_inline_limits. * lto-cgraph.c (lto_output_node, input_overwrite_node): Do not stream inlinable, versionable and disregard_inline_limits. * ipa-inline.c (cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_edge_badness, update_caller_keys, update_callee_keys, add_new_edges_to_heap): Update. (cgraph_decide_inlining_of_small_function): Update; set CIF_FUNCTION_NOT_INLINABLE for uninlinable functions. (cgraph_decide_inlining, cgraph_edge_early_inlinable_p, cgraph_decide_inlining_incrementally): Update. * ipa-inline.h (inline_summary): Add inlinable, versionable, disregard_inline_limits, estimated_stack_size, stack_frame_offset, time, size and estimated_growth parameters. (estimate_edge_growth): Update. (initialize_inline_failed): Declare. * ipa-split.c: Include ipa-inline.h (execute_split_functions): Update. * ipa.c (cgraph_postorder): Use DECL_DISREGARD_INLINE_LIMITS. (cgraph_remove_unreachable_nodes): Do not clear inlinable flag. (record_cdtor_fn): Use DECL_DISREGARD_INLINE_LIMITS. * ipa-inline-analysis.c (inline_node_removal_hook): Update; set estimated_growth to INT_MIN. (inline_node_duplication_hook): Likewise. (dump_inline_summary): Dump new fields. (compute_inline_parameters): Update. (estimate_edge_time, estimate_time_after_inlining, estimate_size_after_inlining, estimate_growth, inline_read_summary, inline_write_summary): (initialize_inline_failed): Move here from cgraph.c. * tree-sra.c: Include ipa-inline.h. (ipa_sra_preliminary_function_checks): Update. * lto/lto.c (lto_balanced_map): Update. Update. * Makefile.in: (cgraph.o, cgraphbuild.o): Add dependency on ipa-inline.h From-SVN: r172581
2011-04-14cgraph.c (dump_cgraph_node): Do not dump inline summaries.Jan Hubicka1-19/+0
* cgraph.c (dump_cgraph_node): Do not dump inline summaries. * cgraph.h (struct inline_summary): Move to ipa-inline.h (cgraph_local_info): Remove inline_summary. * ipa-cp.c: Include ipa-inline.h. (ipcp_cloning_candidate_p, ipcp_estimate_growth, ipcp_estimate_cloning_cost, ipcp_insert_stage): Use inline_summary accesor. * lto-cgraph.c (lto_output_node): Do not stream inline summary. (input_overwrite_node): Do not set inline summary. (input_node): Do not stream inline summary. * ipa-inline.c (cgraph_decide_inlining): Dump inline summaries. (cgraph_decide_inlining_incrementally): Do not try to estimate overall growth; we do not have inline parameters computed for that anyway. (cgraph_early_inlining): After inlining compute call_stmt_sizes. * ipa-inline.h (struct inline_summary): Move here from ipa-inline.h (inline_summary_t): New type and VECtor. (debug_inline_summary, dump_inline_summaries): Declare. (inline_summary): Use VOCtor. (estimate_edge_growth): Kill hack computing call stmt size directly. * lto-section-in.c (lto_section_name): Add inline section. * ipa-inline-analysis.c: Include lto-streamer.h (node_removal_hook_holder, node_duplication_hook_holder): New holders (inline_node_removal_hook, inline_node_duplication_hook): New functions. (inline_summary_vec): Define. (inline_summary_alloc, dump_inline_summary, debug_inline_summary, dump_inline_summaries): New functions. (estimate_function_body_sizes): Properly compute size/time of outgoing calls. (compute_inline_parameters): Alloc inline_summary; do not compute size/time of incomming calls. (estimate_edge_time): Avoid missing time summary hack. (inline_read_summary): Read inline summary info. (inline_write_summary): Write inline summary info. (inline_free_summary): Free all hooks and inline summary vector. * lto-streamer.h: Add LTO_section_inline_summary section. * Makefile.in (ipa-cp.o, ipa-inline-analysis.o): Update dependencies. * ipa.c (cgraph_remove_unreachable_nodes): Fix dump file formating. * lto.c: Include ipa-inline.h (add_cgraph_node_to_partition, undo_partition): Use inline_summary accessor. (ipa_node_duplication_hook): Fix declaration. * Make-lang.in (lto.o): Update dependencies. From-SVN: r172430
2011-04-12cgraph.h (cgraph_node): Remove function declaration.Martin Jambor1-1/+2
2011-04-12 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_node): Remove function declaration. (cgraph_create_node): Declare. (cgraph_get_create_node): Likewise. * cgraph.c (cgraph_create_node): Renamed to cgraph_create_node_1. Updated all callers. (cgraph_node): Renamed to cgraph_create_node, assert that a node for the decl does not already exist. Call cgraph_get_create_node instead of cgraph_node. (cgraph_get_create_node): New function. (cgraph_same_body_alias): Update comment. (cgraph_set_call_stmt): Call cgraph_get_node instead of cgraph_node, assert it does not return NULL. (cgraph_update_edges_for_call_stmt): Likewise. (cgraph_clone_edge): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_update_edges_for_call_stmt_node): Call cgraph_get_create_node instead of cgraph_node. (cgraph_add_new_function): Call cgraph_create_node or cgraph_get_create_node instead of cgraph_node. * cgraphbuild.c (record_reference): Call cgraph_get_create_node instead of cgraph_node. (record_eh_tables): Likewise. (mark_address): Likewise. (mark_load): Likewise. (build_cgraph_edges): Call cgraph_get_create_node instead of cgraph_node. (rebuild_cgraph_edges): Likewise. * cgraphunit.c (cgraph_finalize_function): Call cgraph_get_create_node instead of cgraph_node. (cgraph_copy_node_for_versioning): Call cgraph_create_node instead of cgraph_node. * lto-symtab.c (lto_symtab_merge_cgraph_nodes_1): Call cgraph_create_node instead of cgraph_node. * c-decl.c (finish_function): Call cgraph_get_create_node instead of cgraph_node. * lto-cgraph.c (input_node): Likewise. * lto-streamer-in.c (input_function): Likewise. * varasm.c (mark_decl_referenced): Likewise. (assemble_alias): Likewise. gcc/c-family/ * c-gimplify.c (c_genericize): Call cgraph_get_create_node instead of cgraph_node. gcc/cp/ * cp/class.c (cp_fold_obj_type_ref): Call cgraph_get_create_node instead of cgraph_node. * cp/decl2.c (cxx_callgraph_analyze_expr): Likewise. (cp_write_global_declarations): Likewise. * cp/optimize.c (maybe_clone_body): Likewise. * cp/semantics.c (maybe_add_lambda_conv_op): Likewise. * cp/mangle.c (mangle_decl): Likewise. * cp/method.c (make_alias_for_thunk): Likewise. (use_thunk): Likewise. gcc/ada/ * gcc-interface/utils.c (end_subprog_body): Call cgraph_get_create_node instead of cgraph_node. gcc/fortran/ * trans-decl.c (gfc_generate_function_code): Call cgraph_get_create_node instead of cgraph_node. gcc/objc/ * objc-act.c (mark_referenced_methods): Call cgraph_get_create_node instead of cgraph_node. From-SVN: r172307
2011-04-06re PR middle-end/47663 (Very simple wrapper not inlined)Richard Guenther1-0/+15
2011-04-06 Richard Guenther <rguenther@suse.de> PR tree-optimization/47663 * cgraph.h (struct cgraph_edge): Add call_stmt_size and call_stmt_time fields. (cgraph_edge_inlinable_p): Declare. (cgraph_edge_recursive_p): New inline function. * cgraph.c (cgraph_create_edge_1): Initialize call_stmt_size. (cgraph_clone_edge): Copy it. * ipa-inline.c (cgraph_estimate_edge_time): New function. Account for call stmt time. (cgraph_estimate_time_after_inlining): Take edge argument. (cgraph_estimate_edge_growth): Account call stmt size. (cgraph_estimate_size_after_inlining): Take edge argument. (cgraph_mark_inline_edge): Adjust. (cgraph_check_inline_limits): Likewise. (cgraph_recursive_inlining_p): Remove. (cgraph_edge_badness): Use cgraph_edge_recursive_p. (cgraph_decide_recursive_inlining): Take edge argument and adjust. (cgraph_decide_inlining_of_small_functions): Do not avoid diags for recursive inlining here. (cgraph_flatten): Adjust. (cgraph_decide_inlining_incrementally): Likewise. (estimate_function_body_sizes): Remove call cost handling. (compute_inline_parameters): Initialize caller edge call costs. (cgraph_estimate_edge_growth): New function. (cgraph_estimate_growth): Use it. (cgraph_edge_badness): Likewise. (cgraph_check_inline_limits): Take an edge argument. (cgraph_decide_inlining_of_small_functions): Adjust. (cgraph_decide_inlining): Likewise. * tree-inline.c (estimate_num_insns): Only account for call return value if it is used. (expand_call_inline): Avoid diagnostics on recursive inline functions here. * lto-cgraph.c (lto_output_edge): Output edge call costs. (input_edge): Input edge call costs. * gcc.dg/tree-ssa/inline-8.c: New testcase. From-SVN: r172023
2011-03-28tree-inline.c (expand_call_inline): Do not check that destination node is ↵Martin Jambor1-0/+1
analyzed. 2011-03-28 Martin Jambor <mjambor@suse.cz> * tree-inline.c (expand_call_inline): Do not check that destination node is analyzed. (optimize_inline_calls): Assert that destination node is analyzed. * cgraph.c (cgraph_add_new_function): Call cgraph_analyze_function, do not call tree_lowering_passes. * cgraph.h (cgraph_analyze_function): Declare. * cgraphunit.c (cgraph_analyze_function): Make public. From-SVN: r171602
2011-03-04re PR lto/47497 (SPEC CPU 2006 failed to link with LTO -fuse-linker-plugin ↵Jan Hubicka1-2/+2
-fwhole-program) PR lto/47497 * lto-symtab.c (lto_cgraph_replace_node): Do not set thunk.alias. (lto_symtab_merge_cgraph_nodes_1): Update thunk.alias pointers here. * cgraph.h (cgraph_same_body_alias, cgraph_add_thunk): Add node pointers. * cgraph.c (cgraph_same_body_alias_1, cgraph_same_body_alias, cgraph_add_thunk): Add node pointers. * lto-cgraph.c (lto_output_node): Verify that thunks&aliases are associated to right node. (input_node): Update use of cgraph_same_body_alias and cgraph_add_thunk. * optimize.c (maybe_clone_body): Update call of cgraph_same_body_alias and cgraph_add_thunk. * method.c (make_alias_for_thunk, use_thunk): Likewise. * mangle.c (mangle_decl): Likewise. From-SVN: r170682
2011-02-15re PR debug/47106 (-fcompare-debug failure (length) with -fpartial-inlining ↵Alexandre Oliva1-1/+1
-flto -fconserve-stack) PR debug/47106 PR debug/47402 * cgraph.h (compute_inline_parameters): Return void. * ipa-inline.c (compute_inline_parameters): Adjust. From-SVN: r170188
2011-02-11cgraph.c: Fix comment typos.Nathan Froyd1-1/+1
* cgraph.c: Fix comment typos. * cgraph.h: Likewise. * cgraphunit.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref.c: Likewise. * ipa-reference.c: Likewise. From-SVN: r170052
2011-02-03re PR middle-end/31490 (Compile error section type conflict)Jakub Jelinek1-1/+2
PR middle-end/31490 * output.h (SECTION_RELRO): Define. (SECTION_MACH_DEP): Adjust. (get_variable_section): New prototype. * varpool.c (varpool_finalize_named_section_flags): New function. (varpool_assemble_pending_decls): Call it. * cgraph.h (varpool_finalize_named_section_flags): New prototype. * cgraphunit.c (cgraph_output_in_order): Call varpool_finalize_named_section_flags. * varasm.c (get_section): Allow section flags conflicts between relro and read-only sections if the section hasn't been declared yet. Set SECTION_OVERRIDE after diagnosing section type conflict. (get_variable_section): No longer static. (default_section_type_flags): Use SECTION_WRITE | SECTION_RELRO for readonly sections that need relocations. (decl_readonly_section_1): New function. (decl_readonly_section): Use it. Revert: 2010-11-17 Dinar Temirbulatov <dtemirbulatov@gmail.com> Steve Ellcey <sje@cup.hp.com> PR middle-end/31490 * varasm.c (categorize_decl_for_section): Ignore reloc_rw_mask if section attribute used. * gcc.dg/pr31490-2.c: New test. * gcc.dg/pr31490-3.c: New test. * gcc.dg/pr31490-4.c: New test. From-SVN: r169804
2011-01-26re PR tree-optimization/47237 (builtin_apply_args broken WRT local ABI changes.)Jan Hubicka1-0/+4
PR target/47237 * cgraph.h (cgraph_local_info): New field can_change_signature. * ipa-cp.c (ipcp_update_callgraph): Only compute args_to_skip if callee signature can change. (ipcp_estimate_growth): Call sequence simplify only if calle signature can change. (ipcp_insert_stage): Only compute args_to_skip if signature can change. (cgraph_function_versioning): We can not change signature of functions that don't allow that. * lto-cgraph.c (lto_output_node): Stream local.can_change_signature. (lto_input_node): Likewise. * ipa-inline.c (compute_inline_parameters): Compute local.can_change_signature. * ipa-split.c (visit_bb): Never split away APPLY_ARGS. * tree-sra.c (ipa_sra_preliminary_function_checks): Give up on functions that can not change signature. * i386.c (ix86_function_regparm, ix86_function_sseregparm, init_cumulative_args): Do not use local calling conventions for functions that can not change signature. From-SVN: r169290
2011-01-03re PR tree-optimization/46984 (g++.dg/torture/pr45699.C FAILs with ↵Martin Jambor1-6/+8
-fno-early-inlining -flto) 2011-01-03 Martin Jambor <mjambor@suse.cz> PR tree-optimization/46984 * cgraph.h (cgraph_indirect_call_info): make field thunk_delta HOST_WIDE_INT. (cgraph_create_indirect_edge): Fixed line length. (cgraph_indirect_call_info): Declare. (cgraph_make_edge_direct) Update declaration. * cgraph.c (cgraph_allocate_init_indirect_info): New function. (cgraph_create_indirect_edge): Use it. (cgraph_make_edge_direct): Made delta HOST_WIDE_INT. Updated all callees. * cgraphunit.c (cgraph_redirect_edge_call_stmt_to_callee): Update for the new thunk_delta representation. * ipa-prop.c (ipa_make_edge_direct_to_target): Convert delta to HOST_WIDE_INT. (ipa_write_indirect_edge_info): Remove streaming of thunk_delta. (ipa_read_indirect_edge_info): Likewise. * lto-cgraph.c (output_edge_opt_summary): New function. (output_node_opt_summary): Call it on all outgoing edges. (input_edge_opt_summary): New function. (input_node_opt_summary): Call it on all outgoing edges. * testsuite/g++.dg/ipa/pr46984.C: New test. From-SVN: r168420
2010-12-15re PR tree-optimization/46053 (g++.dg/torture/pr45699.C FAILs with ↵Martin Jambor1-1/+4
-fno-early-inlining) 2010-12-15 Martin Jambor <mjambor@suse.cz> PR tree-optimization/46053 PR middle-end/46287 PR middle-end/46242 * cgraph.h (cgraph_indirect_call_info): New field thunk_delta. * gimple.h (gimple_fold_obj_type_ref): Declaration removed. (gimple_fold_call): Declare. (gimple_adjust_this_by_delta): Likewise. * cgraph.c (cgraph_make_edge_direct): New parameter delta. Updated all users. (cgraph_clone_edge): Create a copy of indirect_info also for direct edges. * cgraphunit.c (cgraph_redirect_edge_call_stmt_to_callee): Adjust this parameters. * gimple-fold.c (gimple_fold_obj_type_ref_known_binfo): Renamed to gimple_get_virt_mehtod_for_binfo, new parameter delta. Do not search through thunks, in fact bail out if we encounter one, check that BINFO_VIRTUALS is not NULL. (gimple_adjust_this_by_delta): New function. (gimple_fold_obj_type_ref): Removed. (gimple_fold_obj_type_ref_call): New function. (fold_gimple_call): Renamed to gimple_fold_call, made external. Updated users. Call gimple_fold_obj_type_ref_call instead of gimple_fold_obj_type_ref. * ipa-cp.c (ipcp_process_devirtualization_opportunities): Process thunk deltas. (ipcp_discover_new_direct_edges): Likewise. * ipa-prop.c (ipa_make_edge_direct_to_target): New parameter delta. Updated callers. (ipa_write_indirect_edge_info): Stream thunk_delta. (ipa_read_indirect_edge_info): Likewise. * tree-ssa-ccp.c (ccp_fold_stmt): Use gimple_fold_call instead of gimple_fold_obj_type_ref. * testsuite/g++.dg/ipa/pr46053.C: New test. * testsuite/g++.dg/ipa/pr46287-1.C: Likewise. * testsuite/g++.dg/ipa/pr46287-2.C: Likewise. * testsuite/g++.dg/ipa/pr46287-3.C: Likewise. * testsuite/g++.dg/torture/covariant-1.C: Likewise. * testsuite/g++.dg/torture/pr46287.C: Likewise. From-SVN: r167855
2010-12-04re PR driver/46760 (LTO bootstrap doesn't work with FDO)Jan Hubicka1-0/+3
PR tree-optimization/46760 * cgraph.c (cgraph_create_node): Initialize count_materialization_scale. * cgraph.h (struct cgraph_node): Add count_materialization_scale. * lto-cgraph.c (lto_output_edge): Fix assert. (lto_output_node): Output count_materialization_scale. (output_profile_summary): Output only runs and sum_max. (input_node): Input count_materialization_scale. (input_profile_summary): Read data into file specific gcov summary. (merge_profile_summaries): New function. (input_cgraph): Update call of input_profile_summary; call merge_profile_summaries. * lto-streamer-in.c (input_cfg): Add count_materialization_scale arg; rescale counts at read in. (intput_bb): Likewise. (input_function): Update call of input_bb. (lto_read_body): Update call of input_cfg. * lto-streamer.h: Inlclude gcov-io.h (lto_file_decl_data): Add gcov_ctr_summary. From-SVN: r167458
2010-11-23tree.h (DECL_HAS_IMPLICIT_SECTION_NAME_P): New macro.Jan Hubicka1-14/+0
* tree.h (DECL_HAS_IMPLICIT_SECTION_NAME_P): New macro. (tree_decl_with_vis): Add implicit_section_name_p. * targhooks.h (default_function_section): Declare. * target.def (function_section): New hook. * defaults.h (HOT_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Remove. * predict.c (choose_function_section): Remove. (estimate_bb_frequencies): Do not use choose_function_section. * coretypes.h (enum node_frequency): Move here from cgraph.h * cgraph.h (enum node_frequency): Remove. * varasm.c (initialize_cold_section_name, unlikely_text_section, unlikely_text_section_p): Remove. (named_subsection_entry): New structure. (get_text_section): New function. (default_function_section): New function. (function_section_1): Break out from ...; handle profile info. (function_section): ... here. (unlikely_text_section): Remove. (unlikely_text_section_p): Use function_section_1. (assemble_start_function): Do not initialize cold section. (default_section_type_flags): Do not special case cold subsection. (switch_to_section): Likewise. * output.h (get_text_section): Define. * config/i386/winnt.c: Do not special case cold section. * config/darwin-protos.h (darwin_function_section): Declare. * config/microblaze/microblaze.h (HOT_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Remove. * config/ia64/hpux.h (HOT_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Remove. (TARGET_ASM_FUNCTION_SECTION): Define to ia64_hpux_function_section. * config/ia64/ia64.c (ia64_hpux_function_section): New function. * config/darwin.c (machopic_select_section): Use darwin_function_section. (darwin_function_section): New function. * config/darwin.h (HOT_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Remove. (TARGET_ASM_FUNCTION_SECTION): Define. * system.h (HOT_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Poison. From-SVN: r167085
2010-11-20cgraph.c (ld_plugin_symbol_resolution_names): New.Jan Hubicka1-0/+2
* cgraph.c (ld_plugin_symbol_resolution_names): New. (dump_cgraph_node): Dump resolution. * cgraph.h (ld_plugin_symbol_resolution_names): Declare. (cgraph_comdat_can_be_unshared_p): Dclare. * lto-streamer-out.c (produce_symtab): Use cgraph_comdat_can_be_unshared_p. * ipa.c (cgraph_address_taken_from_non_vtable_p): New function. (cgraph_comdat_can_be_unshared_p): New function based on logic in cgraph_externally_visible_p. (cgraph_externally_visible_p): Use it. (varpool_externally_visible_p): Virtual tables can be unshared. * varpool.c (dump_varpool_node): Dump resolution. From-SVN: r166985
2010-11-16cgraph.h (+varpool_can_remove_if_no_refs): Move here from ......Jan Hubicka1-0/+12
* cgraph.h (+varpool_can_remove_if_no_refs): Move here from ...; when !flag_toplevel_reorder do not remove unless variable is COMDAT or ARTIFICIAL. * ipa.c (varpool_can_remove_if_no_refs): ... here. (cgraph_remove_unreachable_nodes): Only analyzed nodes needs to stay. * cgraphunit.c (cgraph_analyze_functions): Dump varpool, too. * varpool.c (decide_is_variable_needed): Do not handle visibility issues. (varpool_finalize_decl): Likewise. (varpool_remove_unreferenced_decls): Use varpool_mark_needed_node; update outdated comment on DECL_RTL_SET_P check. From-SVN: r166812
2010-10-26re PR lto/45736 (ICE: in cgraph_remove_unreachable_nodes, at ipa.c:245 with ↵Jan Hubicka1-3/+6
-flto and attribute((constructor))) PR middle-end/45736 * cgraph.c (cgraph_set_readonly_flag): Rename to... (cgraph_set_const_flags) ... this one; get also looping argument; clear constructor/destructor flags. (cgraph_set_pure_flag): Likewise. (cgraph_set_looping_const_or_pure_flag): Remove. (cgraph_can_remove_if_no_direct_calls_and_refs): Do not try to optimize away static ctors/dtors; it does not work on inline clones; external functions can always be rmeoved. (cgraph_will_be_removed_from_program_if_no_direct_calls): Assert on inline clones; in LTO external functions always can go. (cgraph_used_from_object_file_p): Handle EXTERNAL functions correctly. (cgraph_mark_address_taken_node): Assert that we are not taking address of inline clone. (cgraph_can_remove_if_no_direct_calls_p): We always eventually remove external functions. * ipa-cp.c (ipcp_cloning_candidate_p): Do not clone functions with address taken. (ipcp_initialize_node_lattices): Only local functions can be handled without cloning. * cgraph.h (cgraph_set_readonly_flag, cgraph_set_looping_const_or_pure_flag): Remove. (cgraph_set_const_flag): Declare. (cgraph_set_pure_flag): Update. * ipa-pure-const (propagate_pure_const, local_pure_const): Update flags setting code. * ipa.c (cgraph_remove_unreachable_nodes): Fix formating; do not look at inline clones; fix handling of external definitions. (cgraph_postorder): Do not look at inline clones in the first pass. (function_and_variable_visibility): Drop constructors/destructor flags at pure and const functions. * tree-profile.c (tree_profiling): Update. * ipa-inline.c (cgraph_clone_inlined_nodes): Always clone functions with address taken; external functions do not account to whole program size. (cgraph_decide_inlining): Likewise; do not try to inline functions already inlined. * testsuite/gcc.dg/lto/pr45736_0.c: New function. From-SVN: r165972
2010-10-16cgraph.c (dump_cgraph_node): Dump same_comdat_group, only_called_at_startup ↵Jan Hubicka1-0/+4
and only_called_at_exit. * cgraph.c (dump_cgraph_node): Dump same_comdat_group, only_called_at_startup and only_called_at_exit. (cgraph_propagate_frequency): Compute only_called_at_startup and only_called_at_exit. * cgraph.h (struct cgraph_node): New fileds only_called_at_startup and only_called_at_exit. * lto-cgraph.c (lto_output_node, input_overwrite_node): Stream the new flags. * predict.c (compute_function_frequency): Initialize the new flags. From-SVN: r165560
2010-10-15re PR rtl-optimization/45621 (ICE: verify_cgraph_node failed: inlined_to ↵Jan Hubicka1-5/+2
pointer is set but no predecessors found with -fipa-cp-clone -flto) PR middle-end/45621 * g++.dg/lto/pr45621.h : New. * g++.dg/lto/pr45621_0.C: New. * g++.dg/lto/pr45621_1.C: New. * cgraph.c (cgraph_update_edges_for_call_stmt_node): When new call is redirected to clone, be happy. * cgraph.h (cgraph node): Enable former_clone_of unconditinally. * cgraphunit.c (verify_cgraph_node, cgraph_materialize_clone): Handle former_clone_of unconditinally. From-SVN: r165492
2010-09-24lto-symtab.c (lto_symtab_entry_def): Add guessed field.Jan Hubicka1-14/+14
* lto-symtab.c (lto_symtab_entry_def): Add guessed field. (lto_symtab_resolve_symbols): Set it. (lto_symtab_merge_decls_1): Do not compute used_from_object_file; store resolution field in cgraph/varpool. * cgraph.c (cgraph_same_body_alias, cgraph_add_thunk): Return node. (cgraph_get_node_or_alias, cgraph_get_node_or_alias): Constify. (cgraph_dump_node): Drop used_from_object_file. (cgraph_clone_node, cgraph_create_virtual_clone): Likewise. (cgraph_function_body_availability): Use decl_replaceable_p. (cgraph_make_node_local): Set resolution to LDPR_PREVAILING_DEF_IRONLY. (cgraph_can_remove_if_no_direct_calls_and_refs): Use cgraph_used_from_object_file_p. (cgraph_will_be_removed_from_program_if_no_direct_calls): Use cgraph_used_from_object_file_p. (resolution_used_from_other_file_p): New functoin. (cgraph_used_from_object_file_p): New predicate. * cgraph.h: Include plugin-api.h (struct cgraph_local_info): Remove used_from_object_file. (struct cgraph_node): Add resolution field. (struct varpool_node): Likewise; remove used_from_object_file; reove const_value_known. (cgraph_get_node, cgraph_get_node_or_alias, cgraph_node, cgraph_same_body_alias, cgraph_add_thunk): Update prototypes. (resolution_used_from_other_file_p, cgraph_used_from_object_file_p, varpool_used_from_object_file_p): Declare. (varpool_get_node, varpool_extra_name_alias): Update prototype. * tree.h (DECL_REPLACEABLE_P): Remove. (decl_replaceable_p, decl_binds_to_current_def_p): Declare. * final.c (rest_of_clean_state): Use decl_binds_to_current_def_p. * lto-cgraph.c (lto_output_node, lto_output_varpool_node, input_overwrite_node, input_node, input_varpool_node): Stream resolution. * expr.c (expand_expr_real_1): Use const_value_known_p * ipa.c (ipa_discover_readonly_nonaddressable_var): Do not set const_value_known. (cgraph_externally_visible_p): Use cgraph_used_from_object_file_p. (function_and_variable_visibility): Set resolution for local vars and functions. use varpool_used_from_object_file_p. * varasm.c (resolution_to_local_definition_p, resolution_local_p): New static functions. (default_binds_local_p_1): Use resolutoin info. (decl_binds_to_current_def_p, decl_replaceable_p): New functions. * varpool.c (varpool_get_node): Constify. (const_value_known_p): Do not use vnode->const_value_known; use decl_replaceable_p. (varpool_finalize_decl): Do not set const_value_known. (cgraph_variable_initializer_availability): Use decl_replaceable_p (varpool_extra_name_alias): Return new node. (varpool_used_from_object_file_p): New function. * decl.c (finish_function): Use decl_replaceable_p * method.c (make_alias_for_thunk): Update call of cgraph_same_body_alias. * lto.c (lto_promote_cross_file_statics): Use const_value_known_p. From-SVN: r164610
2010-09-20re PR tree-optimization/45605 (Missed devirtualization)Jan Hubicka1-1/+1
PR tree-optimize/45605 * cgraph.h (const_value_known_p): Declare. (varpool_decide_const_value_known): Remove. * tree-ssa-ccp.c (get_base_constructor): Use it. * lto-cgraph.c (compute_ltrans_boundary): Likewise. * expr.c (string_constant): Likewise. * tree-ssa-loop-ivcanon.c (constant_after_peeling): Likewise. * ipa.c (ipa_discover_readonly_nonaddressable_var, function_and_variable_visibility): Likewise. * gimplify.c (gimplify_call_expr): Likewise. * gimple-fold.c (get_symbol_constant_value): Likewise. * varpool.c (varpool_decide_const_value_known): Replace by... (const_value_known_p): ... this one; handle other kinds of DECLs too and work for automatic vars. (varpool_finalize_decl): Use const_value_known_p. * lto.c (lto_promote_cross_file_statics): Use const_value_known_p. * g++.dg/tree-ssa/pr45605.C: New testcase. From-SVN: r164438
2010-09-03cgraph.h (struct varpool_node): Add const_value_known.Jan Hubicka1-0/+3
* cgraph.h (struct varpool_node): Add const_value_known. (varpool_decide_const_value_known): Declare. * tree-ssa-ccp.c (fold_const_aggregate_ref): Update initializer folding. * lto-cgraph.c (lto_output_varpool_node): Store const_value_known. (input_varpool_node): Restore const_value_known. * tree-ssa-loop-ivcanon (constant_after_peeling): Check varpool for initializer folding. * ipa.c (ipa_discover_readonly_nonaddressable_var, function_and_variable_visibility): Compute const_value_known. * gimple-fold.c (get_symbol_constant_value): Use varpool for initializer folding. * varpool.c (varpool_decide_const_value_known): New function. From-SVN: r163808