Commit Graph

79 Commits

Author SHA1 Message Date
Jan Hubicka a7dbc1cbe5 ipa-inline-analysis.c (eliminated_by_inlining_prob): Handle &this->field expressions.
* ipa-inline-analysis.c (eliminated_by_inlining_prob): Handle
	&this->field expressions.

From-SVN: r192899
2012-10-28 23:59:31 +00:00
Jan Hubicka bf3f651054 inlinehint-3.c: New testcase.
* gcc.dg/ipa/inlinehint-3.c: New testcase.
	* ipa-inline.c (edge_badness): Fix overflow.
	(inline_small_functions): Initialize SCCs correctly.
	(do_estimate_edge_time, do_estimate_edge_hints): Skip self
	recursive functions in SCC hints.

From-SVN: r192891
2012-10-28 12:00:32 +00:00
Jan Hubicka b48ccf0df6 ipa-inline.c (edge_badness): Reduce precision; use scc hints.
* ipa-inline.c (edge_badness): Reduce precision; use scc hints.
	(inline_small_functions): Fix dumps; update all callees after inlining.
	* ipa-inline.h (INLINE_HINT_in_scc, INLINE_HINT_same_scc): New constants.
	(inline summary): Add SCC_NO.
	* ipa-inline-analysis.c (dump_inline_hints): Dump SCC hints.
	(reset_inline_summary): Reset scc_no.
	(estimate_node_size_and_time): Set in_scc hint.
	(do_estimate_edge_time): Add same_scc hint.
	(do_estimate_edge_hints): Likewise.

From-SVN: r192888
2012-10-28 09:50:58 +00:00
Jan Hubicka 0f378cb5db ipa-cp.c (ipcp_discover_new_direct_edges): If something was turned to direct call update the summary.
* ipa-cp.c (ipcp_discover_new_direct_edges): If something was turned
	to direct call update the summary.
	* ipa-inline-transform.c (inline_call): Sanity check that summaries
	match the predicted effect; fix updating of summary after edge
	redirection.
	* ipa-inline-analysis.c (inline_node_duplication_hook): Do not try
	to update the summary and recompute it instead.
	(estimate_function_body_sizes): Fix self size estimation; double
	check that it agrees with inline_update_overall_summary.
	(estimate_edge_size_and_time): Handle devirtualizaiton costs.
	(estimate_edge_devirt_benefit): Update to be called from
	estimate_edge_size_and_time.
	(estimate_calls_size_and_time): Update.
	(estimate_node_size_and_time): Watch overflows.
	(inline_merge_summary): Likewise.
	* ipa-prob.c: Include ipa-inline.h
	(ipa_make_edge_direct_to_target): After redirection update the summary.

From-SVN: r192821
2012-10-25 19:23:15 +00:00
Jan Hubicka ed901e4c61 ipa-inline-analysis.c (do_estimate_edge_time): Return actual time spent by the inlined sequence.
* ipa-inline-analysis.c (do_estimate_edge_time): Return actual
	time spent by the inlined sequence.
	(do_estimate_edge_growth): Rename to ...
	(do_estimate_edge_time): ... this one; return size of inlined
	sequence.
	* ipa-inline.h (do_estimate_edge_size): New.
	(do_estimate_edge_growth): Remove.
	(estimate_edge_size): New function.
	(estimate_edge_growth): Use it.

From-SVN: r192185
2012-10-07 18:58:04 +00:00
Martin Jambor af16bc762a function.c (push_cfun): Check old current_function_decl matches old cfun...
2012-09-20  Martin Jambor  <mjambor@suse.cz>

	* function.c (push_cfun): Check old current_function_decl matches
	old cfun, set new current_function_decl to the decl of the new
	cfun.
	(push_struct_function): Likewise.
	(pop_cfun): Likewise.
	(allocate_struct_function): Move call to
	invoke_set_current_function_hook to the end of the function.
	* cfgexpand.c (estimated_stack_frame_size): Do not set and restore
	current_function_decl.
	* cgraph.c (cgraph_release_function_body): Likewise.
	* cgraphunit.c (cgraph_process_new_functions): Likewise.
	(cgraph_add_new_function): Likewise.
	(cgraph_analyze_function): Likewise.
	(assemble_thunk): Set cfun to NULL at the end.
	(expand_function): Move call to set_cfun downwards.
	* gimple-low.c (record_vars_into): Only check current_function_decl
	before possibly doing push_cfun.
	* gimplify.c (gimplify_function_tree): Do not set and restore
	current_function_decl.
	* ipa-inline-analysis.c (compute_inline_parameters): Likewise.
	(inline_analyze_function): Likewise.
	* ipa-prop.c (ipa_analyze_node): Likewise.
	* ipa-pure-const.c (analyze_function): Likewise.
	* lto-streamer-in.c (lto_input_function_body): Do not set
	current_function_decl.
	* lto-streamer-out.c (output_function): Do not set and restore
	current_function_decl.
	* omp-low.c (finalize_task_copyfn): Likewise.
	(expand_omp_taskreg): Likewise.
	(create_task_copyfn): Likewise, move push_cfun up quite a bit.
	* passes.c (dump_passes): Do not set and restore current_function_decl.
	(do_per_function): Likewise.
	(do_per_function_toporder): Likewise.
	* trans-mem.c (ipa_tm_scan_irr_function): Likewise.
	(ipa_tm_transform_transaction): Likewise.
	(ipa_tm_transform_clone): Likewise.
	(ipa_tm_execute): Likewise.
	* tree-emutls.c (lower_emutls_function_body): Likewise.
	* tree-inline.c (initialize_cfun): Do not call pop_cfun.
	(tree_function_versioning): Do not call push_cfun, do not set and
	restore current_function_decl.  Remove assert checking consistency of
	cfun and current_function_decl.
	* tree-profile.c (tree_profiling): Do not set and restore
	current_function_decl.
	* tree-sra.c (convert_callers_for_node): Do not set
	current_function_decl.
	(convert_callers): Do not restore current_function_decl.
	(modify_function): Do not set current_function_decl.
	* tree-ssa-structalias.c (ipa_pta_execute): Do not set and restore
	current_function_decl.

fortran/
	* trans-decl.c (gfc_get_extern_function_decl): Push NULL cfun.  Do not
	set and restore current_function_decl.
	(gfc_init_coarray_decl): Do not set and restore current_function_decl.

lto/
	* lto.c (lto_materialize_function): Call push_struct_function and
	pop_cfun.

From-SVN: r191577
2012-09-20 18:35:40 +02:00
Jan Hubicka 128e0d8944 re PR fortran/48636 (Enable more inlining with -O2 and higher)
PR fortran/48636
	* gcc.dg/ipa/inlinehint-2.c: New testcase.
	* ipa-inline-analysis.c (dump_inline_hints): Dump loop stride.
	(set_hint_predicate): New function.
	(reset_inline_summary): Reset loop stride.
	(remap_predicate_after_duplication): New function.
	(remap_hint_predicate_after_duplication): New function.
	(inline_node_duplication_hook): Update.
	(dump_inline_summary): Dump stride summaries.
	(estimate_function_body_sizes): Compute strides.
	(remap_hint_predicate): New function.
	(inline_merge_summary): Use it.
	(inline_read_section): Read stride.
	(inline_write_summary): Write stride.
	* ipa-inline.c (want_inline_small_function_p): Handle strides.
	(edge_badness): Likewise.
	* ipa-inline.h (inline_hints_vals): Add stride hint.
	(inline_summary): Update stride.

From-SVN: r191232
2012-09-12 21:51:14 +00:00
Diego Novillo f32682ca25 Remove unnecessary VEC function overloads.
Several VEC member functions that accept an element 'T' used to have
two overloads: one taking 'T', the second taking 'T *'.

This used to be needed because of the interface dichotomy between
vectors of objects and vectors of pointers.  In the past, vectors of
pointers would use pass-by-value semantics, but vectors of objects
would use pass-by-reference semantics.  This is no longer necessary,
but the distinction had remained.

The main side-effect of this change is some code reduction in code
that manipulates vectors of objects.  For instance,

-  struct iterator_use *iuse;
-
-  iuse = VEC_safe_push (iterator_use, heap, iterator_uses, NULL);
-  iuse->iterator = iterator;
-  iuse->ptr = ptr;
+  struct iterator_use iuse = {iterator, ptr};
+  VEC_safe_push (iterator_use, heap, iterator_uses, iuse);

Compile time performance was not affected.

Tested on x86_64 and ppc64.

Also built all-gcc on all targets using VEC routines: arm, bfin, c6x,
epiphany, ia64, mips, sh, spu, and vms.

2012-09-10  Diego Novillo  <dnovillo@google.com>

	* vec.h (vec_t::quick_push): Remove overload that accepts 'T *'.
	Update all users.
	(vec_t::safe_push): Likewise.
	(vec_t::quick_insert): Likewise.
	(vec_t::lower_bound): Likewise.
	(vec_t::safe_insert): Likewise.
	(vec_t::replace): Change second argument to 'T &'.

From-SVN: r191165
2012-09-10 20:04:13 -04:00
Martin Jambor be279f8651 ipa-inline-analysis.c (estimate_function_body_sizes): Allocate nonconstant_names after calculate_dominance_info and loop_optimizer_init.
2012-08-31  Martin Jambor  <mjambor@suse.cz>

	* ipa-inline-analysis.c (estimate_function_body_sizes): Allocate
	nonconstant_names after calculate_dominance_info and
	loop_optimizer_init.

From-SVN: r190841
2012-08-31 21:16:21 +02:00
Martin Jambor 0336096575 re PR middle-end/54409 (internal compiler error: in remap_predicate, at ipa-inline-analysis.c:2710)
2012-08-31  Martin Jambor  <mjambor@suse.cz>

	PR middle-end/54409
	* ipa-inline-analysis.c (remap_predicate): Fix the offset_map
	checking condition.

	* gcc/testsuite/gcc.dg/torture/pr54409.c: New test.

From-SVN: r190833
2012-08-31 16:05:45 +02:00
Martin Jambor 48679f6e24 ipa-inline-analysis.c (phi_result_unknown_predicate): New function.
2012-08-31  Martin Jambor  <mjambor@suse.cz>

	* ipa-inline-analysis.c (phi_result_unknown_predicate): New function.
	(predicate_for_phi_result): Likewise.
	(estimate_function_body_sizes): Use the above two functions.

	* testsuite/gfortran.dg/pr48636.f90: Add dump scan checks.

From-SVN: r190832
2012-08-31 15:48:37 +02:00
Martin Jambor 172e74fa37 re PR middle-end/54394 (fatigue2 -flto run time regression)
2012-08-31  Martin Jambor  <mjambor@suse.cz>

	PR middle-end/54394
	* ipa-inline-analysis.c (estimate_function_body_sizes): Compute
	dominance info and loops whenever optimizing.

From-SVN: r190831
2012-08-31 15:13:03 +02:00
Jan Hubicka 2daffc4799 re PR fortran/48636 (Enable more inlining with -O2 and higher)
PR fortran/48636
	* ipa-inline.c (want_inline_small_function_p): Take loop_iterations hint.
	(edge_badness): Likewise.
	* ipa-inline.h (inline_hints_vals): Add INLINE_HINT_loop_iterations.
	(inline_summary): Add loop_iterations.
	* ipa-inline-analysis.c: Include tree-scalar-evolution.h.
	(dump_inline_hints): Dump loop_iterations.
	(reset_inline_summary): Free loop_iterations.
	(inline_node_duplication_hook): Update loop_iterations.
	(dump_inline_summary): Dump loop_iterations.
	(will_be_nonconstant_expr_predicate): New function.
	(estimate_function_body_sizes): Analyze loops.
	(estimate_node_size_and_time): Set hint loop_iterations.
	(inline_merge_summary): Merge loop iterations.
	(inline_read_section): Stream in loop_iterations.
	(inline_write_summary): Stream out loop_iterations.

From-SVN: r190556
2012-08-21 06:54:01 +00:00
Jan Hubicka 37678631a8 re PR lto/45375 ([meta-bug] Issues with building Mozilla (i.e. Firefox) with LTO)
PR lto/45375
	* ipa-inline.c (want_inline_small_function_p): Bypass
	inline limits for hinted functions.
	(edge_badness): Dump hints; decrease badness for hinted funcitons.
	* ipa-inline.h (enum inline_hints_vals): New enum.
	(inline_hints): New type.
	(edge_growth_cache_entry): Add hints.
	(dump_inline_summary): Update.
	(dump_inline_hints): Declare.
	(do_estimate_edge_hints): Declare.
	(estimate_edge_hints): New inline function.
	(reset_edge_growth_cache): Update.
	* predict.c (cgraph_maybe_hot_edge_p): Do not ice on indirect edges.
	* ipa-inline-analysis.c (dump_inline_hints): New function.
	(estimate_edge_devirt_benefit): Return true when function should be
	hinted.
	(estimate_calls_size_and_time): New hints argument; set it when
	devritualization happens.
	(estimate_node_size_and_time): New hints argument.
	(do_estimate_edge_time): Cache hints.
	(do_estimate_edge_growth): Update.	
	(do_estimate_edge_hints): New function

From-SVN: r190509
2012-08-19 05:55:20 +00:00
Steven Bosscher 63ef63bfad timevar.def (TV_VARPOOL, [...]): Remove.
* timevar.def (TV_VARPOOL, TV_WHOPR_WPA_LTRANS_EXEC, TV_LIFE,
	TV_LIFE_UPDATE, TV_DF_UREC, TV_INLINE_HEURISTICS,
	TV_TREE_LINEAR_TRANSFORM, TV_TREE_LOOP_INIT, TV_TREE_LOOP_FINI,
	TV_VPT, TV_LOCAL_ALLOC, TV_GLOBAL_ALLOC, TV_SEQABSTR): Remove.
	(TV_IPA_INLINING, TV_FLATTEN_INLINING, TV_EARLY_INLINING,
	TV_INLINE_PARAMETERS, TV_LOOP_INIT, TV_LOOP_FINI): New.
	* timevar.c (timevar_print): Make printing width of timevar names
	more flexible, but enforce maximum length.
	* ipa-inline.c (pass_early_inline): Use TV_EARLY_INLINING.
	(pass_ipa_inline): Use TV_IPA_INLINING.
	* ipa-inline-analysis.c (pass_inline_parameters): Use
	TV_INLINE_HEURISTICS.
	* tree-ssa-loop.c (pass_tree_loop_init): No timevar for wrapper pass.
	(pass_tree_loop_done): Likewise.
	* final.c (pass_shorten_branches): Use TV_SHORTEN_BRANCH.
	* loop-init.c (loop_optimizer_init): Push/pop TV_LOOP_INIT.
	(loop_optimizer_finalize): Push/pop TV_LOOP_FINI.

From-SVN: r190409
2012-08-15 08:47:13 +00:00
Diego Novillo 0823efedd0 backport: As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html...
Merge from cxx-conversion branch (http://gcc.gnu.org/wiki/cxx-conversion).

As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html, this patch
changes the default bootstrap process so that stage 1 always builds with a C++
compiler.

Other than the bootstrap change, the patch makes no functional changes to the
compiler.  Everything should build as it does now in trunk.  The main
changes in this patch are:

1- Configuration changes.
2- Re-write of VEC.
3- Re-write of gengtype to support C++ templates and
   user-provided marking functions.
4- New hash table class.
5- Re-write double_int.
6- Implement tree macros as inline functions so they can be
   called from gdb.

As discussed before, several of these changes do not fully change
the call sites to use the new APIs.

The bootstrap changes have already been tested on a wide range of
targets (http://gcc.gnu.org/wiki/CppBuildStatus).  Additionally,
I have tested the merged trunk on: x86_64-unknown-linux-gnu,
mips64el-unknown-linux-gnu, powerpc64-unknown-linux-gnu,
i686-pc-linux-gnu, and ia64-unknown-linux-gnu.

ChangeLog
2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.

	* Makefile.tpl (STAGE[+id+]_CXXFLAGS): Remove
	POSTSTAGE1_CONFIGURE_FLAGS.
	* Makefile.in: Regenerate.
	* configure.ac (ENABLE_BUILD_WITH_CXX): Remove.  Update all users.
	Force C++ when bootstrapping.
	* configure: Regenerate.


libcpp/ChangeLog
2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.  Configury.

	* Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
	* configure.ac: Likewise.
	* configure: Regenerate.

2012-08-14   Lawrence Crowl  <crowl@google.com>

	Merge from cxx-conversion branch.  New C++ hash table.

	* include/symtab.h (typedef struct ht hash_table): Change the typedef
	name to cpp_hash_table.  Update all users of the typedef.

gcc/ChangeLog
2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.  Configury.

	* configure.ac (CXX_FOR_BUILD): Define and substitute.
	(BUILD_CXXFLAGS): Define.
	Remove all handlers of ENABLE_BUILD_WITH_CXX.
	Force all build to be with C++.
	* Makefile.in (BUILD_CXXFLAGS): Use it.
	Remove all handlers of ENABLE_BUILD_WITH_CXX.
	* configure: Regenerate.
	* config.in: Regenerate.
	* doc/install.texi: Remove documentation for --enable-build-with-cxx
	and --enable-build-poststage1-with-cxx.

2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.  Re-implement VEC in C++.

	* vec.c (vec_heap_free): Convert into a template function.
	(vec_gc_o_reserve_1): Make extern.
	(vec_gc_p_reserve): Remove.
	(vec_gc_p_reserve_exact): Remove.
	(vec_gc_o_reserve): Remove.
	(vec_gc_o_reserve_exact): Remove.
	(vec_heap_o_reserve_1): Make extern.
	(vec_heap_p_reserve): Remove.
	(vec_heap_p_reserve_exact): Remove.
	(vec_heap_o_reserve): Remove.
	(vec_heap_o_reserve_exact): Remove.
	(vec_stack_p_reserve): Remove.
	(vec_stack_p_reserve_exact): Remove.
	* vec.h (VEC_CHECK_INFO, VEC_CHECK_DECL, VEC_CHECK_PASS,
	VEC_ASSERT, VEC_ASSERT_FAIL, vec_assert_fail): Move earlier
	in the file.
	(VEC): Define to vec_t<T>.
	(vec_allocation_t): Define.
	(struct vec_prefix): Move earlier in the file.
	(vec_t<T>): New template.
	(DEF_VEC_I, DEF_VECL_ALLOC_I, DEF_VEC_P, DEF_VEC_ALLOC_P,
	DEF_VEC_O, DEF_VEC_ALLOC_P, DEF_VEC_O, DEF_VEC_ALLOC_O,
	DEF_VEC_ALLOC_P_STACK, DEF_VEC_ALLOC_O_STACK,
	DEF_VEC_ALLOC_I_STACK): Expand to 'struct vec_swallow_trailing_semi'.
	(DEF_VEC_A): Provide template instantiations for
	GC/PCH markers that do not traverse the vector.
	(vec_stack_p_reserve): Remove.
	(vec_stack_p_reserve_exact): Remove.
	(vec_stack_p_reserve_exact_1): Remove.
	(vec_stack_o_reserve): Remove.
	(vec_stack_o_reserve_exact): Remove.
	(vec_stack_free): Re-write as a template function.
	(vec_reserve): New template function.
	(vec_reserve_exact): New template function.
	(vec_heap_free): New template function if GATHER_STATISTICS is
	defined.  Otherwise, macro that expands to free().
	(VEC_length_1): New template function.
	(VEC_length): Call it.
	(VEC_empty_1): New template function.
	(VEC_empty): Call it.
	(VEC_address_1): New template function.
	(VEC_address): Call it.
	(VEC_last_1): New template function.
	(VEC_last): Call it.  Change return type to T&.
	Change all users that used VEC_Os.
	(VEC_index_1): New template function.
	(VEC_index): Call it.  Return a T& instead of a T*.
	Update all callers that were using VEC_O before.
	(VEC_iterate_1): New template function.
	(VEC_iterate): Call it.
	(VEC_embedded_size_1): New template function.
	(VEC_embedded_size): Call it.
	(VEC_embedded_init_1): New template function.
	(VEC_embedded_init): Call it.
	(VEC_alloc_1): New template function.
	(VEC_alloc): Call it.  If A is 'stack', call XALLOCAVAR to
	do the allocation.
	(VEC_free_1): New template function.
	(VEC_free): Call it.
	(VEC_copy_1): New template function.
	(VEC_copy): Call it.
	(VEC_space_1): New template function
	(VEC_space): Call it.
	(VEC_reserve_1): New template function.
	(VEC_reserve): Call it.
	(VEC_reserve_exact_1): New template function.
	(VEC_reserve_exact): Call it.
	(VEC_splice_1): New template function.
	(VEC_splice): Call it.
	(VEC_safe_splice_1): New template function.
	(VEC_safe_splice): Call it.
	(VEC_quick_push_1): New template function.  Create two overloads, one
	accepting T, the other accepting T *.  Update all callers
	where T and T * are ambiguous.
	(VEC_quick_push): Call it.
	(VEC_safe_push_1): New template function. Create two overloads, one
	accepting T, the other accepting T *.  Update all callers
	where T and T * are ambiguous.
	(VEC_safe_push): Call it.
	(VEC_pop_1): New template function.
	(VEC_pop): Call it.
	(VEC_truncate_1): New template function.
	(VEC_truncate): Call it.
	(VEC_safe_grow_1): New template function.
	(VEC_safe_grow): Call it.
	(VEC_safe_grow_cleared_1): New template function.
	(VEC_safe_grow_cleared): Call it.
	(VEC_replace_1): New template function.
	(VEC_replace): Call it.  Always accept T instead of T*.
	Update all callers that used VEC_Os.
	(VEC_quick_insert_1): New template function.
	(VEC_quick_insert): Call it.
	(VEC_safe_insert_1): New template function.
	(VEC_safe_insert): Call it.
	(VEC_ordered_remove_1): New template function.
	(VEC_ordered_remove): Call it.
	(VEC_unordered_remove_1): New template function.
	(VEC_unordered_remove): Call it.
	(VEC_block_remove_1): New template function.
	(VEC_block_remove): Call it.
	(VEC_lower_bound_1): New template function.
	(VEC_lower_bound): Call it.
	(VEC_OP): Remove.
	(DEF_VEC_FUNC_P): Remove.
	(DEF_VEC_ALLOC_FUNC_P): Remove.
	(DEF_VEC_NONALLOC_FUNCS_P): Remove.
	(DEF_VEC_FUNC_O): Remove.
	(DEF_VEC_ALLOC_FUNC_O): Remove.
	(DEF_VEC_NONALLOC_FUNCS_O): Remove.
	(DEF_VEC_ALLOC_FUNC_I): Remove.
	(DEF_VEC_NONALLOC_FUNCS_I): Remove.
	(DEF_VEC_ALLOC_FUNC_P_STACK): Remove.
	(DEF_VEC_ALLOC_FUNC_O_STACK): Remove.
	(DEF_VEC_ALLOC_FUNC_I_STACK): Remove.
	(vec_reserve_exact): New template function.

	* gengtype-lex.l (DEF_VEC_ALLOC_[IOP]/{EOID}): Remove.
	* gengtype-parse.c (token_names): Remove DEF_VEC_ALLOC_[IOP].
	(typedef_name): Emit vec_t<C1> instead of VEC_C1_C2.
	(def_vec_alloc): Remove.  Update all callers.
	* gengtype.c (filter_type_name): New.
	(output_mangled_typename): Call it.
	(write_func_for_structure): Likewise.
	(write_types): Likewise.
	(write_root): Likewise.
	(write_typed_alloc_def): Likewise.
	(note_def_vec): Emit vec_t<TYPE_NAME> instead of VEC_TYPE_NAME_base.
	(note_def_vec_alloc): Remove.
	* gengtype.h (note_def_vec_alloc): Remove.
	(DEFVEC_ALLOC): Remove token code.

	* df-scan.c (df_bb_verify): Remove call to df_free_collection_rec
	inside the insn traversal loop.
	* gimplify.c (gimplify_compound_lval): Rename STACK to EXPR_STACK.
	* ipa-inline.c (inline_small_functions): Rename HEAP to EDGE_HEAP.
	* reg-stack.c (stack): Rename to STACK_PTR.  Update all users.
	* tree-vrp.c (stack): Rename to EQUIV_STACK.  Update all users.

	* config/bfin/bfin.c (hwloop_optimize): Update some calls to
	VEC_* for vectors of non-pointers.
	* config/c6x/c6x.c (try_rename_operands): Likewise.
	(reshuffle_units): Likewise.
	* config/mips/mips.c (mips_multi_start): Likewise.
	(mips_multi_add): Likewise.
	(mips_multi_copy_insn): Likewise.
	(mips_multi_set_operand): Likewise.
	* hw-doloop.c (discover_loop): Likewise.
	(discover_loops): Likewise.
	(reorg_loops): Likewise.

2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.  C++ support in gengtype.

	* coretypes.h (gt_pointer_operator): Move from ...
	* ggc.h: ... here.
	* doc/gty.texi: Document support for C++ templates and
	user-provided markers.
	* gcc/gengtype-lex.l: Update copyright year.
	Remove support for recognizing DEF_VEC_O, DEF_VEC_P and
	DEFVEC_I.
	* gengtype-parse.c: Update copyright year.
	(token_names): Remove DEF_VEC_O, DEF_VEC_P and DEF_VEC_I.
	(require_template_declaration): New.
	(typedef_name): Call it.
	(type): Replace IS_UNION with KIND. Replace all users.
	(def_vec): Remove.  Update all users.
	* gengtype-state.c (type_lineloc): Handle TYPE_USER_STRUCT.
	(write_state_user_struct_type): New.
	(write_state_type): Call it.
	(read_state_user_struct_type): New.
	(read_state_type): Call it.
	* gengtype.c: Update copyright year.
	(dump_pair): Move declaration to the top.
	(dump_type): Likewise.
	(dump_type_list): Likewise.
	(dbgprint_count_type_at): Handle TYPE_USER_STRUCT.
	(create_user_defined_type): New.
	(resolve_typedef): Call it.
	(new_structure): Replace argument ISUNION with KIND.
	Change users to refer to KIND directly.
	Update all callers.
	(find_structure): Likewise.
	(set_gc_used_type): Handle TYPE_USER_STRUCT.
	(create_file): Update HDR to include new copyright year.
	(struct walk_type_data): Add field IN_PTR_FIELD.
	(output_mangled_typename): Handle TYPE_USER_STRUCT.
	(walk_type): Set D->IN_PTR_FIELD when walking a TYPE_POINTER.
	Clear it afterwards.
	Handle TYPE_USER_STRUCT.
	(write_types_process_field): Handle TYPE_USER_STRUCT.
	(get_type_specifier): Move earlier in the file.
	(write_type_decl): New.
	(write_marker_function_name): New.
	(write_user_func_for_structure_ptr): New.
	(write_user_func_for_structure_body): New.
	(write_user_marking_functions): New.
	(write_func_for_structure): Call write_marker_function_name
	and write_type_decl.
	Do not call walk_type for TYPE_USER_STRUCT. Emit a call to the user
	function directly.
	Call write_user_marking_functions on TYPE_USER_STRUCTs.
	(write_types_local_user_process_field): New.
	(write_pch_user_walking_for_structure_body): New.
	(write_pch_user_walking_functions): New.
	(write_types_local_process_field): Handle TYPE_USER_STRUCT.
	(write_local_func_for_structure): Do not call walk_type for
	TYPE_USER_STRUCT. Instead, emit the call to gt_pch_nx directly.
	Call write_pch_user_walking_functions for TYPE_USER_STRUCTs.
	(write_root): Handle TYPE_USER_STRUCT.
	(vec_prefix_type): Remove.  Update all users.
	(note_def_vec): Remove.  Update all users.
	(dump_typekind): Handle TYPE_USER_STRUCT.
	(dump_type): Initialize SEEN_TYPES, if needed.
	Handle TYPE_USER_STRUCT.
	(dump_everything): Do not initialize SEEN_TYPES.
	* gengtype.h: Update copyright year.
	(enum typekind): Add TYPE_USER_STRUCT.
	(union_or_struct_p): Rename from UNION_OR_STRUCT_P.
	Convert into function.
	Add an overload taking const_type_p.
	Update all callers.
	(new_structure): Change second field to type enum typekind.
	Update all users.
	(find_structure): Likewise.
	(note_def_vec): Remove.
	(DEFVEC_OP): Remove.
	(DEFVEC_I): Remove.
	* ggc-page.c (gt_ggc_mx): Add entry points for marking
	'const char *&', 'unsigned char *&' and 'unsigned char&'.
	* ggc-zone.c (gt_ggc_mx): Add entry points for marking
	'const char *&' and 'unsigned char *&'.
	* stringpool.c (gt_pch_nx): Add entry points for marking
	'const char *&', 'unsigned char *&' and 'unsigned char&'.
	Add an entry point for the overload taking arguments 'unsigned char
	*', 'gt_pointer_operator' and 'void *'.
	* vec.h (struct vec_prefix): Remove GTY marker.
	(struct vec_t): Remove GTY((length)) attribute from field 'vec'.
	(gt_ggc_mx (vec_t<T> *)): New template function.
	(gt_pch_nx (vec_t<T> *)): New template function.
	(gt_pch_nx (vec_t<T *> *, gt_pointer_operator, void *)): New template
	function.
	(gt_pch_nx (vec_t<T> *, gt_pointer_operator, void *)): New template
	function.

	* basic-block.h (struct edge_def): Mark GTY((user)).
	Remove all GTY markers from fields.
	(gt_ggc_mx): Declare.
	(gt_pch_nx): Declare.
	* tree-cfg.c (gt_ggc_mx): New.
	(gt_pch_nx): New.

	* gengtype-lex.l (USER_GTY): Add pattern for "user".
	* gengtype-parse.c (option): Handle USER_GTY.
	(opts_have): New.
	(type): Call it.
	If the keyword 'user' is used, do not walk the fields
	of the structure.
	* gengtype.h (USER_GTY): Add.
	* doc/gty.texi: Update.

2012-08-14   Lawrence Crowl  <crowl@google.com>

	Merge cxx-conversion branch.  Implement C++ hash table.

	* hash-table.h: New. Implementation borrowed from libiberty/hashtab.c.
	* hash-table.c: Likewise.
	* tree-ssa-tail-merge.c: Include hash-table.h instead of hashtab.h.
	(static htab_t same_succ_htab): Change type to hash_table;
	move specification of helper functions from create call to declaration.
	Change users to invoke member functions.
	(same_succ_print_traverse): Make extern ssa_.... Change callers.
	Remove void* casting.
	(same_succ_hash): Likewise.
	(same_succ_equal): Likewise.
	(same_succ_delete): Likewise.
	* tree-ssa-threadupdate.c: Include hash-table.h.
	(struct local_info): Rename to ssa_local_info_t to avoid overloading
	the type name local_info with the variable name local_info.
	(static htab_t redirection_data): Change type to hash_table.
	Move specification of helper functions from create call to declaration.
	Change users to invoke member functions.
	(redirection_data_hash): Make extern ssa_.... Change callers.
	Remove void* casting.
	(redirection_data_eq): Likewise.
	(fix_duplicate_block_edges): Likewise.
	(create_duplicates): Likewise.
	(fixup_template_block): Likewise.
	(redirect_edges): Likewise.
	(lookup_redirection_data): Change types associated with the hash table
	from void* to their actual type. Remove unnecessary casts.
	* tree-ssa-ccp.c: Include hash-table.h.
	(typedef gimple_htab): New.  Uses hash_table.  Replace specific uses
	of htab_t with gimple_htab.  Change users to invoke member functions.
	Move specification of helper functions from create call to declaration.
	* tree-ssa-coalesce.c: Include hash-table.h instead of hashtab.h.
	(hash_ssa_name_by_var): Make extern. Remove void* casting.
	(eq_ssa_name_by_var): Likewise.
	(coalesce_ssa_name): Change type of local static htab_t ssa_name_hash
	to hash_table. Change users to invoke member functions.
	Move specification of helper functions from create call to declaration.
	* coverage.c: Include hash-table.h instead of hashtab.h.
	(static htab_t counts_hash): Change type to hash_table;
	move specification of helper functions from create call to declaration.
	Change users to invoke member functions.
	(htab_counts_entry_hash): Make extern. Rename with coverage_... instead
	of htab_... Remove void* casting.
	(htab_counts_entry_eq): Likewise.
	(htab_counts_entry_del): Likewise.
	* tree-ssa-pre.c: Include hash-table.h instead of hashtab.h.
	(static htab_t expression_to_id): Change type to hash_table.
	Move specification of helper functions from create call to declaration.
	Change users to invoke member functions.
	(static htab_t phi_translate_table): Likewise.
	(pre_expr_eq): Make extern ssa_.... Change callers.
	Remove void* casting.
	(pre_expr_hash): Likewise.
	(expr_pred_trans_hash): Likewise.
	(expr_pred_trans_eq): Likewise.
	(alloc_expression_id): Change types associated with the hash table
	from void* to their actual type. Remove unnecessary casts.
	(lookup_expression_id): Likewise.
	(phi_trans_lookup): Likewise.
	(phi_trans_add): Likewise.
	* stringpool.c: Rename uses of libcpp typedef hash_table to
	cpp_hash_table.
	* Makefile.in: Add hash-table.o to OBJS-libcommon-target.
	Add $(HASH_TABLE_H). Add new dependences on $(HASH_TABLE_H).

2012-08-14   Lawrence Crowl  <crowl@google.com>

	Merge from cxx-conversion branch.  Re-write double_int in C++.

	* hash-table.h
	(typedef double_int): Change to struct (POD).
	(double_int::make): New overloads for int to double-int conversion.
	(double_int::mask): New.
	(double_int::max_value): New.
	(double_int::min_value): New.
	(double_int::operator ++): New.
	(double_int::operator --): New.
	(double_int::operator *=): New.
	(double_int::operator +=): New.
	(double_int::operator -=): New.
	(double_int::to_signed): New.
	(double_int::to_unsigned): New.
	(double_int::fits_unsigned): New.
	(double_int::fits_signed): New.
	(double_int::fits): New.
	(double_int::trailing_zeros): New.
	(double_int::popcount): New.
	(double_int::multiple_of): New.
	(double_int::set_bit): New.
	(double_int::mul_with_sign): New.
	(double_int::operator * (binary)): New.
	(double_int::operator + (binary)): New.
	(double_int::operator - (binary)): New.
	(double_int::operator - (unary)): New.
	(double_int::operator ~ (unary)): New.
	(double_int::operator & (binary)): New.
	(double_int::operator | (binary)): New.
	(double_int::operator ^ (binary)): New.
	(double_int::and_not): New.
	(double_int::lshift): New.
	(double_int::rshift): New.
	(double_int::alshift): New.
	(double_int::arshift): New.
	(double_int::llshift): New.
	(double_int::lrshift): New.
	(double_int::lrotate): New.
	(double_int::rrotate): New.
	(double_int::div): New.
	(double_int::sdiv): New.
	(double_int::udiv): New.
	(double_int::mod): New.
	(double_int::smod): New.
	(double_int::umod): New.
	(double_int::divmod): New.
	(double_int::sdivmod): New.
	(double_int::udivmod): New.
	(double_int::ext): New.
	(double_int::zext): New.
	(double_int::sext): New.
	(double_int::is_zero): New.
	(double_int::is_one): New.
	(double_int::is_minus_one): New.
	(double_int::is_negative): New.
	(double_int::cmp): New.
	(double_int::ucmp): New.
	(double_int::scmp): New.
	(double_int::ult): New.
	(double_int::ugt): New.
	(double_int::slt): New.
	(double_int::sgt): New.
	(double_int::max): New.
	(double_int::smax): New.
	(double_int::umax): New.
	(double_int::min): New.
	(double_int::smin): New.
	(double_int::umin): New.
	(double_int::operator ==): New.
	(double_int::operator !=): New.
	(shwi_to_double_int): Change implementation to use member function.
	(double_int_minus_one): Likewise.
	(double_int_zero): Likewise.
	(double_int_one): Likewise.
	(double_int_two): Likewise.
	(double_int_ten): Likewise.
	(uhwi_to_double_int): Likewise.
	(double_int_to_shwi): Likewise.
	(double_int_to_uhwi): Likewise.
	(double_int_fits_in_uhwi_p): Likewise.
	(double_int_fits_in_shwi_p): Likewise.
	(double_int_fits_in_hwi_p): Likewise.
	(double_int_mul): Likewise.
	(double_int_mul_with_sign): Likewise.
	(double_int_add): Likewise.
	(double_int_sub): Likewise.
	(double_int_neg): Likewise.
	(double_int_div): Likewise.
	(double_int_sdiv): Likewise.
	(double_int_udiv): Likewise.
	(double_int_mod): Likewise.
	(double_int_smod): Likewise.
	(double_int_umod): Likewise.
	(double_int_divmod): Likewise.
	(double_int_sdivmod): Likewise.
	(double_int_udivmod): Likewise.
	(double_int_multiple_of): Likewise.
	(double_int_setbit): Likewise.
	(double_int_ctz): Likewise.
	(double_int_not): Likewise.
	(double_int_ior): Likewise.
	(double_int_and): Likewise.
	(double_int_and_not): Likewise.
	(double_int_xor): Likewise.
	(double_int_lshift): Likewise.
	(double_int_rshift): Likewise.
	(double_int_lrotate): Likewise.
	(double_int_rrotate): Likewise.
	(double_int_cmp): Likewise.
	(double_int_scmp): Likewise.
	(double_int_ucmp): Likewise.
	(double_int_max): Likewise.
	(double_int_smax): Likewise.
	(double_int_umax): Likewise.
	(double_int_min): Likewise.
	(double_int_smin): Likewise.
	(double_int_umin): Likewise.
	(double_int_ext): Likewise.
	(double_int_sext): Likewise.
	(double_int_zext): Likewise.
	(double_int_mask): Likewise.
	(double_int_max_value): Likewise.
	(double_int_min_value): Likewise.
	(double_int_zero_p): Likewise.
	(double_int_one_p): Likewise.
	(double_int_minus_one_p): Likewise.
	(double_int_equal_p): Likewise.
	(double_int_popcount): Likewise.
	* hash-table.c
	(double_int_mask): Reuse implementation for double_int::mask.
	(double_int_max_value): Likewise.
	(double_int_min_value): Likewise.
	(double_int_ext): Likewise.
	(double_int_zext): Likewise.
	(double_int_sext): Likewise.
	(double_int_mul_with_sign): Likewise.
	(double_int_divmod): Likewise.
	(double_int_sdivmod): Likewise.
	(double_int_udivmod): Likewise.
	(double_int_div): Likewise.
	(double_int_sdiv): Likewise.
	(double_int_udiv): Likewise.
	(double_int_mod): Likewise.
	(double_int_smod): Likewise.
	(double_int_umod): Likewise.
	(double_int_multiple_of): Likewise.
	(double_int_lshift): Likewise.
	(double_int_rshift): Likewise.
	(double_int_lrotate): Likewise.
	(double_int_rrotate): Likewise.
	(double_int_cmp): Likewise.
	(double_int_ucmp): Likewise.
	(double_int_scmp): Likewise.
	(double_int_max): Likewise.
	(double_int_smax): Likewise.
	(double_int_umax): Likewise.
	(double_int_min): Likewise.
	(double_int_smin): Likewise.
	(double_int_umin): Likewise.
	(double_int_min): Likewise.
	(double_int_min): Likewise.
	(double_int_min): Likewise.
	(double_int_min): Likewise.
	(double_int_min): Likewise.
	(double_int_min): Likewise.
	(double_int::alshift): New.
	(double_int::arshift): New.
	(double_int::llshift): New.
	(double_int::lrshift): New.
	(double_int::ult): New.
	(double_int::ugt): New.
	(double_int::slt): New.
	(double_int::sgt): New.
	(double_int_setbit): Reuse implementation for double_int::set_bit,
	which avoids a name conflict with a macro.
	(double_int_double_int_ctz): Reuse implementation for
	double_int::trailing_zeros.
	(double_int_fits_in_shwi_p): Reuse implementation for
	double_int::fits_signed.
	(double_int_fits_in_hwi_p): Reuse implementation for double_int::fits.
	(double_int_mul): Reuse implementation for binary
	double_int::operator *.
	(double_int_add): Likewise.
	(double_int_sub): Likewise.
	(double_int_neg): Reuse implementation for unary
	double_int::operator -.
	(double_int_max_value): Likewise.
	* fixed-value.c: Change to use member functions introduced above.

2012-08-14   Lawrence Crowl  <crowl@google.com>

	Merge cxx-conversion branch.  Support tree macro calling
	from gdb.

	* tree.h (tree_check): New.
	(TREE_CHECK): Use inline function above instead of __extension__.
	(tree_not_check): New.
	(TREE_NOT_CHECK): Use inline function above instead of __extension__.
	(tree_check2): New.
	(TREE_CHECK2): Use inline function above instead of __extension__.
	(tree_not_check2): New.
	(TREE_NOT_CHECK2): Use inline function above instead of __extension__.
	(tree_check3): New.
	(TREE_CHECK3): Use inline function above instead of __extension__.
	(tree_not_check3): New.
	(TREE_NOT_CHECK3): Use inline function above instead of __extension__.
	(tree_check4): New.
	(TREE_CHECK4): Use inline function above instead of __extension__.
	(tree_not_check4): New.
	(TREE_NOT_CHECK4): Use inline function above instead of __extension__.
	(tree_check5): New.
	(TREE_CHECK5): Use inline function above instead of __extension__.
	(tree_not_check5): New.
	(TREE_NOT_CHECK5): Use inline function above instead of __extension__.
	(contains_struct_check): New.
	(CONTAINS_STRUCT_CHECK): Use inline function above instead of
	__extension__.
	(tree_class_check): New.
	(TREE_CLASS_CHECK): Use inline function above instead of __extension__.
	(tree_range_check): New.
	(TREE_RANGE_CHECK): Use inline function above instead of __extension__.
	(omp_clause_subcode_check): New.
	(OMP_CLAUSE_SUBCODE_CHECK): Use inline function above instead of
	__extension__.
	(omp_clause_range_check): New.
	(OMP_CLAUSE_RANGE_CHECK): Use inline function above instead of
	__extension__.
	(expr_check): New.
	(EXPR_CHECK): Use inline function above instead of __extension__.
	(non_type_check): New.
	(NON_TYPE_CHECK): Use inline function above instead of __extension__.
	(tree_vec_elt_check): New.
	(TREE_VEC_ELT_CHECK): Use inline function above instead of
	__extension__.
	(omp_clause_elt_check): New.
	(OMP_CLAUSE_ELT_CHECK): Use inline function above instead of
	__extension__.
	(tree_operand_check): New.
	(TREE_OPERAND_CHECK): Use inline function above instead of
	__extension__.
	(tree_operand_check_code): New.
	(TREE_OPERAND_CHECK_CODE): Use inline function above instead of
	__extension__.
	(TREE_CHAIN): Simplify implementation.
	(TREE_TYPE): Simplify implementation.
	(tree_operand_length): Move for compilation dependences.
	* gdbinit.in: (macro define __FILE__): New.
	(macro define __LINE__): New.
	(skip "tree.h"): New.

gcc/cp/ChangeLog
2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.  Re-write VEC in C++.

	* call.c (add_function_candidate): Remove const qualifier
	from call to VEC_index.

2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.  Configury.

	* go-c.h: Remove all handlers of ENABLE_BUILD_WITH_CXX.
	* go-gcc.cc: Likewise.
	* go-system.h: Likewise.

From-SVN: r190402
2012-08-14 21:56:07 -04:00
Richard Guenther 391886c8e0 basic-block.h (struct basic_block): Remove loop_depth member, move flags and index members next to each other.
2012-08-13  Richard Guenther  <rguenther@suse.de>

	* basic-block.h (struct basic_block): Remove loop_depth
	member, move flags and index members next to each other.
	* cfgloop.h (bb_loop_depth): New inline function.
	* cfghooks.c (split_block): Do not set loop_depth.
	(duplicate_block): Likewise.
	* cfgloop.c (flow_loop_nodes_find): Likewise.
	(flow_loops_find): Likewise.
	(add_bb_to_loop): Likewise.
	(remove_bb_from_loops): Likewise.
	* cfgrtl.c (force_nonfallthru_and_redirect): Likewise.
	* gimple-streamer-in.c (input_bb): Do not stream loop_depth.
	* gimple-streamer-out.c (output_bb): Likewise.
	* bt-load.c: Include cfgloop.h.
	(migrate_btr_defs): Use bb_loop_depth.
	* cfg.c (dump_bb_info): Likewise.
	* final.c (compute_alignments): Likewise.
	* ira.c (update_equiv_regs): Likewise.
	* tree-ssa-copy.c (init_copy_prop): Likewise.
	* tree-ssa-dom.c (loop_depth_of_name): Likewise.
	* tree-ssa-forwprop.c: Include cfgloop.h.
	(forward_propagate_addr_expr): Use bb_loop_depth.
	* tree-ssa-pre.c (insert_into_preds_of_block): Likewise.
	* tree-ssa-sink.c (select_best_block): Likewise.
	* ipa-inline-analysis.c: Include cfgloop.h.
	(estimate_function_body_sizes): Use bb_loop_depth.
	* Makefile.in (tree-ssa-forwprop.o): Depend on $(CFGLOOP_H).
	(ipa-inline-analysis.o): Likewise.
	(bt-load.o): Likewise.

	* gcc.dg/tree-prof/update-loopch.c: Adjust.

From-SVN: r190346
2012-08-13 13:49:54 +00:00
Jan Hubicka f27c186710 tree-pass.h (write_summary, [...]): Remove set and vset arguments.
* tree-pass.h (write_summary, write_optimization_summary): Remove
	set and vset arguments.
	* ipa-cp.c (ipcp_write_summary): Remove set and vset arugments.
	(write_node_summary_p): Likewise; use the encoder.
	(ipa_reference_write_optimization_summary): Likewise.
	* lto-cgraph.c (output_cgraph_opt_summary): Use encoder.
	(lto_symtab_encoder_new): Initialize in_partition field.
	(lto_symtab_encoder_delete): Destroy in_partition field.
	(LCC_NOT_FOUND): Move to lto-streamer.h
	(lto_symtab_encoder_deref): Likewise.
	(lto_symtab_encoder_in_partition_p,
	lto_set_symtab_encoder_in_partition): New functions.
	(referenced_from_other_partition_p): Rewrite to use encoder.
	(reachable_from_other_partition_p): Likewise.
	(referenced_from_this_partition_p): Likewise.
	(reachable_from_this_partition_p): Likewise.
	(lto_output_node): Likewise.
	(lto_output_varpool_node): Likewise.
	(output_refs): Likewise.
	(compute_ltrans_boundary): Initialize in_partition fileds of
	the encoder.
	(output_symtab): Likewise.
	(input_refs): Match the changes in output_refs.
	(output_cgraph_opt_summary_p): Remove set argument.
	(output_node_opt_summary): Replace set by encoder.
	(output_cgraph_opt_summary): Remove set argument; use
	the encoder.
	* ipa-pure-const.c (pure_const_write_summary): Remove set and vset
	arguments; use the encoder.
	* lto-streamer-out.c (lto_output): Remove set and vset argument; use
	the encoder.
	(produce_symtab): Likewise.
	* ipa-inline.h (inline_write_summary): Remove set and vset arguments.
	* ipa-inline-analysis.c (inline_write_summary): Likewise.
	* ipa-prop.c (ipa_prop_write_jump_functions): Remove set argument;
	use encoder.
	* ipa-prop.h (ipa_prop_write_jump_functions): Likewise.
	* passes.c (ipa_write_summaries_2): Remove set and vset arguments.
	(ipa_write_summaries_1): Update.
	(ipa_write_optimization_summaries_1): Likewise.
	(ipa_write_optimization_summaries): Likewise.
	* lto-streamer.h (lto_symtab_encoder_t): Add in_partition.
	(lto_symtab_encoder_iterator): New type.
	(lto_symtab_encoder_deref): Make inline.
	(output_symtab, referenced_from_other_partition_p,
	reachable_from_other_partition_p, referenced_from_this_partition_p,
	reachable_from_this_partition_p): Update.
	(lsei_end_p, lsei_next, lsei_node, lsei_cgraph_node, lsei_varpool_node): New
	inline functions.
	(LCC_NOT_FOUND): New macro.
	(lto_symtab_encoder_deref, lsei_start, lsei_next_in_partition,
	lsei_start_in_partition, lsei_next_function_in_partition,
	lsei_start_function_in_partition, lsei_next_variable_in_partition,
	lsei_start_variable_in_partition): New inline functions.

	* lto-partition.c (set_referenced_from_other_partition_p,
	set_reachable_from_other_partition_p, set_referenced_from_this_partition_p):
	New functions.
	(lto_promote_cross_file_statics): Use them.

From-SVN: r190336
2012-08-13 02:37:51 +00:00
Martin Jambor 8810cc52c9 re PR fortran/48636 (Enable more inlining with -O2 and higher)
2012-08-11  Martin Jambor  <mjambor@suse.cz>

	PR fortran/48636
	* ipa-inline.h (condition): New fields offset, agg_contents and by_ref.
	* ipa-inline-analysis.c (agg_position_info): New type.
	(add_condition): New parameter aggpos, also store agg_contents, by_ref
	and offset.
	(dump_condition): Also dump aggregate conditions.
	(evaluate_conditions_for_known_args): Also handle aggregate
	conditions.  New parameter known_aggs.
	(evaluate_properties_for_edge): Gather known aggregate contents.
	(inline_node_duplication_hook): Pass NULL known_aggs to
	evaluate_conditions_for_known_args.
	(unmodified_parm): Split into unmodified_parm and unmodified_parm_1.
	(unmodified_parm_or_parm_agg_item): New function.
	(set_cond_stmt_execution_predicate): Handle values passed in
	aggregates.
	(set_switch_stmt_execution_predicate): Likewise.
	(will_be_nonconstant_predicate): Likewise.
	(estimate_edge_devirt_benefit): Pass new parameter known_aggs to
	ipa_get_indirect_edge_target.
	(estimate_calls_size_and_time): New parameter known_aggs, pass it
	recrsively to itself and to estimate_edge_devirt_benefit.
	(estimate_node_size_and_time): New vector known_aggs, pass it o
	functions which need it.
	(remap_predicate): New parameter offset_map, use it to remap aggregate
	conditions.
	(remap_edge_summaries): New parameter offset_map, pass it recursively
	to itself and to remap_predicate.
	(inline_merge_summary): Also create and populate vector offset_map.
	(do_estimate_edge_time): New vector of known aggregate contents,
	passed to functions which need it.
	(inline_read_section): Stream new fields of condition.
	(inline_write_summary): Likewise.
	* ipa-cp.c (ipa_get_indirect_edge_target): Also examine the aggregate
	contents.  Let all local callers pass NULL for known_aggs.

	* testsuite/gfortran.dg/pr48636.f90: New test.

From-SVN: r190313
2012-08-11 12:50:24 +02:00
Jan Hubicka 7380e6efdd cgraph.h (vector types for symtab_node): Add.
* cgraph.h (vector types for symtab_node): Add.
	* ipa-reference.c (ipa_reference_write_optimization_summary): Update
	for new symtab encoder.
	(ipa_reference_read_optimization_summary): Likewise.
	* lto-cgraph.c (output_varpool): Remove.
	(input_cgraph_opt_summary): Take symtab nodes vector as argument.
	(LTO_cgraph_tags): Rename to ...
	(LTO_symtab_tags): ... this one; add LTO_symtab_variable.
	(lto_cgraph_encoder_new): Rename to ...
	(lto_symtab_encoder_new): ... this on.
	(lto_cgraph_encoder_encode): Rename to ...
	(lto_symtab_encoder_encode): ... this one.
	(lto_cgraph_encoder_delete): Rename to ...
	(lto_symtab_encoder_delete): ... this one.
	(lto_cgraph_encoder_deref): Rename to ...
	(lto_symtab_encoder_deref): ... this one.
	(lto_cgraph_encoder_encode_body_p): Rename to ...
	(lto_symtab_encoder_encode_body_p): ... this one.
	(lto_varpool_encoder_new, lto_varpool_encoder_delete,
	lto_varpool_encoder_encode, lto_varpool_encoder_lookup,
	lto_varpool_encoder_deref): Remove.
	(lto_varpool_encoder_encode_initializer_p): Rename to ...
	(lto_symtab_encoder_encode_initializer_p): ... this one.
	(lto_set_varpool_encoder_encode_initializer): Rename to ...
	(lto_set_symtab_encoder_encode_initializer): ... this one.
	(lto_output_edge): Update.
	(lto_output_node): Update.
	(lto_output_varpool_node): Update; stream out LTO_symtab_variable tag.
	(lto_output_ref): Drop varpool_encoder; update.
	(add_node_to): Update.
	(add_references): Update.
	(output_outgoing_cgraph_edges): Update.
	(output_refs): Update.	
	(compute_ltrans_boundary): Update.
	(output_cgraph): Update; output varpools too.
	(input_overwrite_node): Update.
	(output_varpool): Remove.
	(input_node): Update.
	(input_ref): Update.
	(input_edge): Update.
	(input_cgraph_1): Update; input varpool too; unify fixup code.
	(input_varpool_1): Remove.
	(input_refs): Update.
	(input_cgraph): Update.
	(output_node_opt_summary): Update.
	(input_cgraph_opt_section): Update.
	(input_cgraph_opt_summary): Update.
	* ipa-pure-const.c (pure_const_write_summary): Update.
	(pure_const_read_summary): Update.
	* lto-streamer-out.c (lto_write_tree): Update.
	(lto_output): Likewise.
	(produce_symtab): Update.
	(produce_asm_for_decls): Update.
	* ipa-inline-analysis.c (inline_read_section): Update.
	(inline_write_summary): Update.
	* ipa-prop.c (ipa_write_node_info): Update.
	(ipa_prop_read_section): Update.
	* lto-streamer.h (lto_cgraph_encoder_d): Rename to ...
	(lto_symtab_encoder_d): ... this one;  add initializer.
	(lto_cgraph_encoder_t): Rename to ...
	(lto_symtab_encoder_t): ... this one.
	(lto_cgraph_encoder_size): Rename to ...
	(lto_symtab_encoder_size): ... this one.
	(lto_varpool_encoder_d): ... remove.
	(lto_varpool_encoder_t): Remove.
	(lto_out_decl_state): Remove cgraph_node_encoder, varpool_node_encoder
	add symtab_node_encoder.
	(lto_file_decl_data): Likewise.
	(lto_cgraph_encoder_deref, lto_cgraph_encoder_lookup,
	lto_cgraph_encoder_new, lto_cgraph_encoder_encode, lto_cgraph_encoder_delete,
	lto_cgraph_encoder_encode_body_p, lto_varpool_encoder_encode_body_p,
	lto_varpool_encoder_deref, lto_varpool_encoder_lookup, lto_varpool_encoder_new,
	lto_varpool_encoder_encode, lto_varpool_encoder_delete,
	lto_varpool_encoder_encode_initializer_p): Remove.
	(lto_symtab_encoder_deref, lto_symtab_encoder_lookup,
	lto_symtab_encoder_t, lto_symtab_encoder_encode, lto_symtab_encoder_delete,
	lto_symtab_encoder_encode_body_p, lto_symtab_encoder_encode_initializer_p):
	New.

From-SVN: r190309
2012-08-11 03:04:35 +00:00
Richard Guenther 70b5e7dc73 tree.h (SSA_NAME_VAR): Return NULL_TREE if an IDENTIFIER_NODE is recorded as var.
2012-08-10  Richard Guenther  <rguenther@suse.de>

	* tree.h (SSA_NAME_VAR): Return NULL_TREE if an IDENTIFIER_NODE
	is recorded as var.
	(SSA_NAME_IDENTIFIER): Return the IDENTIFIER_NODE of the SSA_NAME
	or its SSA_NAME_VAR.
	(SET_SSA_NAME_VAR_OR_IDENTIFIER): New setter.
	* tree-ssanames.c (make_ssa_name_fn): Handle creating anonymous
	SSA names by passing a type instead of a variable decl.
	(release_ssa_name): Use SET_SSA_NAME_VAR_OR_IDENTIFIER.
	(copy_ssa_name_fn): Handle anonymous SSA names.
	(replace_ssa_name_symbol): Use SET_SSA_NAME_VAR_OR_IDENTIFIER.
	* tree-flow-inline.h (make_temp_ssa_name): New inline function.
	* tree-pretty-print.c (dump_generic_node): Use SSA_NAME_IDENTIFIER,
	dump SSA names without a name as <anon>.
	* cfgexpand.c (expand_used_vars): Assing anonymous SSA names we are
	going to expand a decl.
	(gimple_expand_cfg): Assign all SSA names of a partition the
	decl we created for its leader.
	* tree-ssa.c (target_for_debug_bind): Handle SSA_NAMEs.
	(verify_ssa_name): Handle anonymous SSA names.
	(verify_def): Likewise.
	* tree-predcom.c (eliminate_temp_copies): Likewise.
	* tree-ssa-copyrename.c (copy_rename_partition_coalesce): Likewise.
	* tree-ssa-live.c (var_map_base_init): Compute conflicts for
	anonymous SSA names with the same type.
	(mark_all_vars_used_1): Handle anonymous SSA names.
	(verify_live_on_entry): Likewise.
	* tree-ssa-coalesce.c (abnormal_corrupt): Remove.
	(create_outofssa_var_map): Adjust with respect to conflicts we
	compute for anonymous SSA names.  Do not restrict abnormal
	coalescing.
	(coalesce_partitions): Do not restrict abnormal coalescing.
	Assert we only ever coalesce variables we computed conflicts for.
	* tree-ssa-ter.c (process_replaceable): Do not restrict TER
	of anonymous names.
	* expr.c (expand_expr_real_1): Handle anonymous SSA names
	expanded from IVOPTs by creating a raw REG here.
	* tree-cfg.c (replace_ssa_name): Handle anonymous SSA names.
	(dump_function_to_file): Dump anonymous SSA names alongside
	with their types in the variable list.
	(verify_gimple_return): Guard use of SSA_NAME_VAR.
	* tree-into-ssa.c (mark_for_renaming): Handle a NULL symbol.
	(rewrite_into_ssa): Make SSA names anonymous.
	* tree-ssa-structalias.c (alias_get_name): Rewrite.
	* tree-ssa-uninit.c (ssa_undefined_value_p): Handle anonymous
	SSA names.
	(warn_uninitialized_phi): Likewise.
	* tree-ssa-loop-ivopts.c (prepare_decl_rtl): Defer expanding
	anonymous SSA names to the expander.
	(determine_iv_cost): Anonymous SSA names are artificial.
	* tree-ssa-loop-manip.c (tree_transform_and_unroll_loop):
	Handle anonymous SSA names.
	* lto-streamer-out.c (output_ssa_names): Stream SSA_NAME_VAR
	or if NULL, the type of the SSA name.
	* tree-inline.c (remap_ssa_name): Handle anonymous SSA names,
	remap names as anonymous where appropriate.
	(insert_init_stmt): Pass SSA names down to insert_init_debug_bind.
	* tree-ssa-uncprop.c (uncprop_into_successor_phis): Adjust
	according to what we create conflicts for in out-of-SSA
	coalescing.
	* tree-parloops.c (separate_decls_in_region_name): Handle
	anonymous SSA names.
	(add_field_for_name): Likewise.
	* tree.c (get_name): Handle SSA names.
	* tree-ssa-loop-im.c (gen_lsm_tmp_name): Defer to get_name for
	SSA_NAMEs.
	* tree-vect-loop-manip.c (adjust_debug_stmts): Use
	virtual_operand_p.
	* tree-sra.c (create_access_replacement): Give up generating
	a DECL_DEBUG_EXPR for SSA names in the memory reference.
	(replace_removed_params_ssa_names): Guard use of SSA_NAME_VAR.
	* tree-complex.c (get_component_ssa_name): Handle anonymous
	SSA names.
	(set_component_ssa_name): Likewise.
	* tree-ssa-sccvn.c (visit_reference_op_load): Likewise.
	* tree-object-size.c (collect_object_sizes_for): Handle
	uninitialized SSA names properly.
	* ipa-inline-analysis.c (eliminated_by_inlining_prob): Guard use of
	SSA_NAME_VAR.
	* ipa-split.c (test_nonssa_use): Likewise.
	(consider_split): Likewise.
	(mark_nonssa_use): Likewise.

	c-family/
	* c-pretty-print.c (pp_c_expression): Handle anonymous SSA names.

	cp/
	* error.c (dump_expr): Likewise.

	* g++.dg/plugin/selfassign.c: Adjust.
	* gcc.dg/plugin/selfassign.c: Likewise.
	* gcc.dg/strlenopt-11.c: Likewise.
	* gcc.dg/strlenopt-13.c: Likewise.
	* gcc.dg/no-strict-overflow-4.c: Likewise.
	* gcc.dg/strict-overflow-4.c: Likewise.
	* gcc.dg/tree-ssa/alias-11.c: Likewise.
	* gcc.dg/tree-ssa/alias-6.c: Likewise.
	* gcc.dg/tree-ssa/asm-3.c: Likewise.
	* gcc.dg/tree-ssa/pr18908.c: Likewise.
	* gcc.dg/tree-ssa/pr19431.c: Likewise.
	* gcc.dg/tree-ssa/ssa-pre-21.c: Likewise.
	* gcc.dg/tree-ssa/phi-opt-10.c: Likewise.
	* gcc.dg/tree-ssa/phi-opt-7.c: Likewise.
	* gcc.dg/tree-ssa/slsr-27.c: Likewise.
	* gcc.dg/tree-ssa/slsr-28.c: Likewise.
	* gcc.dg/tree-ssa/slsr-29.c: Likewise.
	* gcc.dg/pr46309.c: Likewise.
	* gcc.dg/tree-ssa/loop-5.c: Likewise.

From-SVN: r190284
2012-08-10 08:29:29 +00:00
Jan Hubicka c170d40f35 re PR middle-end/54146 (Very slow compile with attribute((flatten)))
PR middle-end/54146
	* ipa-inline-transform.c (inline_call): Add UPDATE_OVERALL_SUMMARY
	parameter; honnor it.
	* ipa-inline.c (recursive_inlining): Update call
	of inline_call.
	(inline_small_functions): Likewise.
	(ipa_inline): Likewise.
	(inline_always_inline_functions): Likewise.
	(early_inline_small_functions): Likewise.
	(flatten_function): Do separate update of summary info.
	* ipa-inline.h (inline_update_overall_summary): Declare.
	(inline_call): Update.
	* ipa-inline-analysis.c (inline_merge_summary): Break out
	updating code to ...
	(inline_update_overall_summary): Likewise.

From-SVN: r190283
2012-08-10 07:52:23 +00:00
H.J. Lu a8da72b86c Add free inline summary pass after pass_early_local_passes
PR middle-end/53321
	PR middle-end/53865
	* ipa-inline-analysis.c (inline_free_summary): Return if
	inline_edge_summary_vec is NULL.

	* ipa-split.c (execute_split_functions): Check if a function
	is inlinable only if inline_edge_summary_vec != NULL.

	* ipa.c (symtab_remove_unreachable_nodes): Restore
	cgraph_propagate_frequency call when something was changed.
	(free_inline_summary): New function.
	(pass_ipa_free_inline_summary): New pass.

	* passes.c (init_optimization_passes): Add
	pass_ipa_free_inline_summary before pass_ipa_tree_profile.

	* timevar.def (TV_IPA_FREE_INLINE_SUMMARY): New.

	* tree-pass.h (pass_ipa_free_inline_summary): New.

From-SVN: r190090
2012-08-02 09:58:33 -07:00
Steven Bosscher 7ee2468b92 system.h (dump_file): Do not define.
gcc/
	* system.h (dump_file): Do not define.
	* tree-pass.h: Include dumpfile.h, which is a new file containing...
	(enum tree_dump_index, TDF_*, get_dump_file_name, dump_enabled_p,
	dump_initialized_p, dump_begin, dump_end, dump_node, dump_switch_p,
	dump_flag_name, dump_file, dump_flags, dump_file_name,
	get_dump_file_info, struct dump_file_info): all of this, moved to...
	* dumpfile.h: Here, new file.
	* tree-dump.h: Include dumpfile.h, but not tree-pass.h.
	(dump_stmt): Remove prototype for C++ specific function.
	(dump_enumerated_decls): Move prototype from here...
	* tree-flow.h (dump_enumerated_decls): ... to here.
	(get_ref_base_and_extent) Move prototype from here ...
	* tree.h (get_ref_base_and_extent) ... to here.
	* tree-ssa-live.c: Do not inclde tree-pretty-print.h, because
	gimple-pretty-print.h is enough.  Do not include tree-dump.h,
	include timevar.h and dumpfile.h instead.
	(struct numbered_tree_d, compare_decls_by_uid,
	dump_enumerated_decls_push, dump_enumerated_decls): Move from here ...
	* tree-dfa.c:(struct numbered_tree_d, compare_decls_by_uid,
	dump_enumerated_decls_push, dump_enumerated_decls):... to here.
	Do not include timevar.h.
	* tree.c: Do not include timevar.h.
	* tree-cfg.c: Do not include langhooks.h, tree-pretty-print.h, and
	timevar.h.
	(dump_cfg_stats): Use current_function_name.
	(gimple_cfg2vcg): Likewise.
	(dump_function_to_file): Likewise.
	* df-scan.c: Do not include tree-pass.h and timevar.h.
	Include dumpfile.h.
	(df_entry_block_bitmap_verify, df_exit_block_bitmap_verify): Do not
	use print_current_pass.
	* df-problems.c: Include dumpfile.h.
	Always define REG_DEAD_DEBUGGING, avoid #ifdef code, because it
	leads to errors in the code not selected.
	(df_note_compute): Do not print_rtl_with_bb here.  Fix compilation
	bug if REG_DEAD_DEBUGGING is not 0, get_insns is not available here.
	* lcm.c: Include dumpfile.h.
	Remove obsolete include of insn-attr.h.
	* dojump.c (do_compare_rtx_and_jump): Remove failure printing for
	missing probability notes.
	* stmt.c: Include dumpfile.h.
	(emit_case_decision_tree): Re-enable printing expand details only
	if TDF_DETAILS.
	* alias.c, auto-inc-dec.c, bb-reorder.c, caller-save.c, cfg.c, 
	cfgcleanup.c, cfgexpand.c, cfgloop.c, cfgloopmanip.c, cgraph.c, 
	cgraphclones.c, cgraphunit.c, combine.c, combine-stack-adj.c, 
	coverage.c, cprop.c, cse.c, cselib.c, dbgcnt.c, dce.c, df-core.c, 
	dse.c, dwarf2out.c, emit-rtl.c, except.c, expr.c, final.c, 
	function.c, fwprop.c, gcse.c, gimple-fold.c, 
	gimple-pretty-print.c, gimple-ssa-strength-reduction.c, 
	gimplify.c, graphite-blocking.c, graphite-clast-to-gimple.c, 
	graphite-dependences.c, graphite-interchange.c, 
	graphite-optimize-isl.c, graphite-poly.c, 
	graphite-sese-to-poly.c, haifa-sched.c, hw-doloop.c, ifcvt.c, 
	ipa.c, ipa-cp.c, ipa-inline-analysis.c, ipa-inline.c, 
	ipa-inline-transform.c, ipa-prop.c, ipa-pure-const.c, 
	ipa-reference.c, ipa-split.c, ipa-utils.c, ira.c, ira-emit.c, 
	jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, 
	loop-unroll.c, loop-unswitch.c, lower-subreg.c, 
	lto-section-out.c, lto-streamer-in.c, matrix-reorg.c, mcf.c, 
	mode-switching.c, modulo-sched.c, omega.c, omp-low.c, passes.c, 
	plugin.c, postreload.c, postreload-gcse.c, predict.c, print-rtl.c, 
	print-tree.c, profile.c, recog.c, ree.c, regcprop.c, reginfo.c, 
	regmove.c, regrename.c, reg-stack.c, reload1.c, reorg.c, 
	sched-rgn.c, sched-vis.c, sel-sched.c, sel-sched-ir.c, 
	store-motion.c, tracer.c, trans-mem.c, tree-affine.c, 
	tree-call-cdce.c, tree-cfgcleanup.c, tree-chrec.c, 
	tree-data-ref.c, tree-diagnostic.c, tree-dump.c,
	tree-eh.c, tree-flow-inline.h, tree-if-conv.c, tree-into-ssa.c, 
	tree-mudflap.c, tree-nrv.c, tree-object-size.c, 
	tree-optimize.c, tree-outof-ssa.c, tree-predcom.c, 
	tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, 
	tree-sra.c, tree-ssa-address.c, tree-ssa-alias.c, tree-ssa.c, 
	tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, 
	tree-ssa-copyrename.c,, tree-ssa-dce.c, tree-ssa-dom.c, 
	tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, 
	tree-ssa-loop.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, 
	tree-ssa-loop-ivcanon.c, tree-ssa-loop-ivopts.c, 
	tree-ssa-loop-manip.c, tree-ssa-loop-niter.c, 
	tree-ssa-loop-prefetch.c, tree-ssa-loop-unswitch.c, 
	tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, 
	tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-propagate.c, 
	tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-sink.c, 
	tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-ter.c, 
	tree-ssa-threadedge.c, tree-ssa-threadupdate.c, 
	tree-ssa-uncprop.c, tree-ssa-uninit.c, 
	tree-switch-conversion.c, tree-tailcall.c, 
	tree-vect-data-refs.c, tree-vect-loop.c, 
	tree-vect-loop-manip.c, tree-vectorizer.c, 
	tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, 
	tree-vrp.c, value-prof.c, var-tracking.c, web.c: Include tree-pass.h
	only if needed.  If tree-pass.h is included, do not include timevar.h
	and dumpfile.h.  If tree-pass.h is not included but dump_file, or
	dump_flags, or the TDF_* flags are used, include dumpfile.h.
	If gimple-pretty-print.h is included, don't include tree-pretty-print.h.
	Remove assorted unnecessary includes.

	* config/mn10300/mn10300.c, config/c6x/c6x.c, config/ia64/ia64.c,
	config/arm/arm.c, config/bfin/bfin.c, config/frv/frv.c,
	config/spu/spu.c, config/mep/mep.c, config/i386/i386.c:
	Include dumpfile.h.
	* config/rl78/rl78.c: Include dumpfile.h instead of tree-pass.h.
	* arm/t-arm, avr/t-avr, i386/t-i386, ia64/t-ia64, mep/t-mep,
	spu/t-spu-elf: Fix dependencies.

c-family/
	* c-gimplify.c: Include dumpfile.h instead of tree-dump.h.
	* c-ada-spec.c: Likewise.
	* c-dump.c (dump_stmt): Move to cp/dump.c, the only user.

c/
	* c-decl.c: Include dumpfile.h instead of tree-dump.h.
	* Make-lang.in: Fix dependencies.

cp/
	* dump.c (dump_stmt): Moved here from c-dump.c.
	* optimize.c: Include dumpfile.h instead of tree-dump.h.
	* class.c: Likewise.
	* decl2.c: Likewise.
	* Make-lang.in: Fix dependencies.

fortran/
	* f95-lang.c: Include dumpfile.h instead of tree-dump.h.
	* Make-lang.in: Fix dependencies.

java/
	* java-gimplify.c Include dumpfile.h instead of tree-dump.h
	* Make-lang.in: Fix dependencies.

lto/
	* lto.c: Do not include timevar.h.
	* Make-lang.in: Fix dependencies.

ada/
	* gcc-interface/utils.c: Include timevar.h.
	* Make-lang.in: Fix dependencies.

From-SVN: r189519
2012-07-16 11:32:42 +00:00
Martin Jambor 7b872d9e65 ipa-prop.h (ipa_get_jf_known_type_offset): New function.
2012-06-03  Martin Jambor  <mjambor@suse.cz>

	* ipa-prop.h (ipa_get_jf_known_type_offset): New function.
	(ipa_get_jf_known_type_base_type): Likewise.
	(ipa_get_jf_known_type_component_type): Likewise.
	(ipa_get_jf_constant): Likewise.
	(ipa_get_jf_pass_through_formal_id): Likewise.
	(ipa_get_jf_pass_through_operation): Likewise.
	(ipa_get_jf_ancestor_offset): Likewise.
	(ipa_get_jf_ancestor_type): Likewise.
	(ipa_get_jf_ancestor_formal_id): Likewise.
	(ipa_get_jf_member_ptr_pfn): Likewise.
	* ipa-prop.c (ipa_set_jf_known_type): New function.
	(ipa_set_jf_constant): Likewise.
	(ipa_set_jf_simple_pass_through): Likewise.
	(ipa_set_jf_arith_pass_through): Likewise.
	(ipa_set_ancestor_jf): Likewise.
	(fill_member_ptr_cst_jump_function): Moved up and renamed to
	ipa_set_jf_member_ptr_cst.
	(detect_type_change_1): Use the new jump function creation functions.
	(compute_complex_assign_jump_func): Likewise.
	(compute_complex_ancestor_jump_func): Likewise.
	(compute_known_type_jump_func): Likewise.
	(compute_scalar_jump_functions): Likewise.
	(compute_pass_through_member_ptrs): Likewise.
	(determine_cst_member_ptr): Likewise.
	(combine_known_type_and_ancestor_jfs): Likewise.
	(try_make_edge_direct_simple_call): Likewise.
	(try_make_edge_direct_virtual_call): Likewise.
	(update_indirect_edges_after_inlining): Likewise.
	* ipa-cp.c (ipa_get_jf_pass_through_result): Use jump function
	access functions.  Incorporat NOP_EXPR and BINFO handling from its
	callers.
	(ipa_get_jf_ancestor_result): Likewise.  Incorporate handling BINFOs
	which was in its callers.
	(ipa_value_from_jfunc): Use jump function access functions.  Some
	functionality moved to functions above.
	(propagate_vals_accross_ancestor): Likewise.
	(propagate_vals_accross_pass_through): Use jump function access
	functions.
	(propagate_accross_jump_function): Likewise.
	* ipa-inline-analysis.c (remap_edge_change_prob): Use jump function
	access functions.
	(inline_merge_summary): Likewise.

From-SVN: r188156
2012-06-04 00:10:19 +02:00
Joseph Myers 073a899888 LANGUAGES: Fix typos.
* LANGUAGES: Fix typos.
	* Makefile.in: Fix typos.
	* alias.c: Fix typos.
	* auto-inc-dec.c: Fix typos.
	* bb-reorder.c: Fix typos.
	* cfgcleanup.c: Fix typos.
	* cgraph.c: Fix typos.
	* cgraph.h: Fix typos.
	* cgraphunit.c: Fix typos.
	* collect2-aix.h: Fix typos.
	* collect2.c: Fix typos.
	* compare-elim.c: Fix typos.
	* config/alpha/vms.h: Fix typos.
	* config/arm/README-interworking: Fix typos.
	* config/arm/arm.c: Fix typos.
	* config/arm/iterators.md: Fix typos.
	* config/arm/vxworks.h: Fix typos.
	* config/avr/avr.c: Fix typos.
	* config/avr/avr.h: Fix typos.
	* config/avr/avr.md: Fix typos.
	* config/avr/builtins.def: Fix typos.
	* config/c6x/c6x.c: Fix typos.
	* config/cr16/cr16.c: Fix typos.
	* config/cr16/cr16.md: Fix typos.
	* config/cris/cris.md: Fix typos.
	* config/darwin.c: Fix typos.
	* config/darwin.opt: Fix typos.
	* config/i386/i386-c.c: Fix typos.
	* config/i386/i386.c: Fix typos.
	* config/ia64/ia64.c: Fix typos.
	* config/m68k/cf.md: Fix typos.
	* config/mep/mep.c: Fix typos.
	* config/microblaze/microblaze.c: Fix typos.
	* config/microblaze/microblaze.h: Fix typos.
	* config/mn10300/mn10300.c: Fix typos.
	* config/mn10300/mn10300.md: Fix typos.
	* config/pa/pa.c: Fix typos.
	* config/picochip/picochip.h: Fix typos.
	* config/rs6000/a2.md: Fix typos.
	* config/rs6000/rs6000.c: Fix typos.
	* config/rs6000/vector.md: Fix typos.
	* config/rx/rx.md: Fix typos.
	* config/rx/rx.opt: Fix typos.
	* config/s390/2097.md: Fix typos.
	* config/s390/s390.c: Fix typos.
	* config/s390/s390.h: Fix typos.
	* config/sh/sh.c: Fix typos.
	* config/sh/sh.md: Fix typos.
	* config/sparc/sync.md: Fix typos.
	* config/spu/spu.c: Fix typos.
	* config/spu/spu.md: Fix typos.
	* config/vms/vms.c: Fix typos.
	* config/vxworks-dummy.h: Fix typos.
	* config/vxworks.h: Fix typos.
	* cselib.c: Fix typos.
	* df-scan.c: Fix typos.
	* df.h: Fix typos.
	* doc/extend.texi: Fix typos.
	* doc/install.texi: Fix typos.
	* doc/invoke.texi: Fix typos.
	* doc/md.texi: Fix typos.
	* doc/plugins.texi: Fix typos.
	* doc/rtl.texi: Fix typos.
	* dse.c: Fix typos.
	* dwarf2asm.c: Fix typos.
	* dwarf2out.c: Fix typos.
	* except.h: Fix typos.
	* expr.c: Fix typos.
	* fold-const.c: Fix typos.
	* gcc.c: Fix typos.
	* gcse.c: Fix typos.
	* genautomata.c: Fix typos.
	* gengtype-state.c: Fix typos.
	* gengtype.c: Fix typos.
	* genhooks.c: Fix typos.
	* gimple-fold.c: Fix typos.
	* gimple-pretty-print.c: Fix typos.
	* gimple.c: Fix typos.
	* gimple.h: Fix typos.
	* gimplify.c: Fix typos.
	* graphite-interchange.c: Fix typos.
	* graphite-sese-to-poly.c: Fix typos.
	* ifcvt.c: Fix typos.
	* input.c: Fix typos.
	* ipa-cp.c: Fix typos.
	* ipa-inline-analysis.c: Fix typos.
	* ipa-inline-transform.c: Fix typos.
	* ipa-inline.c: Fix typos.
	* ipa-pure-const.c: Fix typos.
	* ipa-ref.h: Fix typos.
	* ipa-reference.c: Fix typos.
	* ipa-utils.c: Fix typos.
	* ipa.c: Fix typos.
	* ira-emit.c: Fix typos.
	* ira-lives.c: Fix typos.
	* lto-streamer.c: Fix typos.
	* lto-streamer.h: Fix typos.
	* lto-wrapper.c: Fix typos.
	* mcf.c: Fix typos.
	* mode-switching.c: Fix typos.
	* modulo-sched.c: Fix typos.
	* plugin.c: Fix typos.
	* postreload.c: Fix typos.
	* sched-deps.c: Fix typos.
	* sel-sched-ir.c: Fix typos.
	* sel-sched-ir.h: Fix typos.
	* sel-sched.c: Fix typos.
	* sese.c: Fix typos.
	* stor-layout.c: Fix typos.
	* target-hooks-macros.h: Fix typos.
	* target.def: Fix typos.
	* trans-mem.c: Fix typos.
	* tree-eh.c: Fix typos.
	* tree-predcom.c: Fix typos.
	* tree-sra.c: Fix typos.
	* tree-ssa-address.c: Fix typos.
	* tree-ssa-loop-ivopts.c: Fix typos.
	* tree-ssa-loop-niter.c: Fix typos.
	* tree-ssa-math-opts.c: Fix typos.
	* tree-ssa-pre.c: Fix typos.
	* tree-ssa-propagate.c: Fix typos.
	* tree-ssa-reassoc.c: Fix typos.
	* tree-ssa-sccvn.c: Fix typos.
	* tree-ssa-ter.c: Fix typos.
	* tree-ssa-uninit.c: Fix typos.
	* tree-ssanames.c: Fix typos.
	* tree-vect-generic.c: Fix typos.
	* tree-vect-slp.c: Fix typos.
	* tree.c: Fix typos.
	* tree.h: Fix typos.
	* varasm.c: Fix typos.
	* varpool.c: Fix typos.

From-SVN: r187959
2012-05-29 15:14:06 +01:00
Martin Jambor fb9098887b ipa-inline-analysis.c (inline_merge_summary): Free operand_map.
2012-05-23  Martin Jambor  <mjambor@suse.cz>

    * ipa-inline-analysis.c (inline_merge_summary): Free operand_map.

From-SVN: r187817
2012-05-24 00:23:54 +02:00
Jan Hubicka 65c70e6b03 cgraph.h (FOR_EACH_VARIABLE, [...]): New macros.
* cgraph.h (FOR_EACH_VARIABLE, FOR_EACH_VARIABLE, FOR_EACH_FUNCTION):
	New macros.
	* lto-symtab.c (lto_symtab_merge_cgraph_nodes): Use FOR_EACH
	walkers to walk cgraph and varpool.
	* cgraph.c (cgraph_node_for_asm): Likewise.
	(dump_cgraph): Likewise.
	* value-prof.c (init_node_map): Likewise.
	* tree.c (free_lang_data_in_cgraph): Likewise.
	* tree-emutls.c: (ipa_lower_emutls): Likewise.
	* ipa-reference.c (generate_summary, propagate): Likewise.
	* cgraphunit.c (verify_cgraph, cgraph_process_same_body_aliases,
	cgraph_mark_functions_to_output, cgraph_output_in_order,
	output_weakrefs, cgraph_materialize_all_clones,
	cgraph_optimize): Likewise.
	* lto-cgraph.c (merge_profile_summaries): Likewise.
	(input_cgraph): Likewise.
	* ipa-pure-const.c (generate_summary): Likewise.
	(propagate): Likwise.
	* ipa-utils.c (ipa_reduced_postorder): Likewise.
	(ipa_free_postorder_info): Likewise.
	(ipa_reverse_postorder): Likewise.
	* ipa-inline.c (ipa_inline): Likewise.
	* matrix-reorg.c (find_matrices_decl): Likewise.
	(matrix_reorg): Likewise.
	* tree-vectorizer.c (increase_alignment): Likewise.
	* ipa.c (cgraph_remove_unreachable_nodes): Likewise.
	(function_and_variable_visibility): Likewise.
	(whole_program_function_and_variable_visibility): Likewise.
	(ipa_cdtor_merge): Likewise.
	* trans-mem.c (ipa_tm_execute): Likewise.
	* ipa-inline-analysis.c (dump_inline_summaries): Likewise.
	* ipa-prop.c (ipa_print_all_jump_functions): Likewise.
	(ipa_print_all_params): Likewise.
	(ipa_update_after_lto_read): Likewise.
	* tree-profie.c (tree_profiling): Likewise.
	* tree-ssa-structalias.c (ipa_pta_execute): Likewise.
	* passes.c (dump_passes): Likewise.
	(do_per_function): Likewise.
	(ipa_write_summaries): Likewise.
	* varpool.c (dump_varpool): Likewise.
	(varpool_node_for_asm): Likewise.
	(varpool_assemble_pending_decls): Likewise.


	* decl2.c (collect_candidates_for_java_method_alias): Use FOR_EACH
        walkers to walk cgraph and varpool.

	* lto.c (read_cgraph_and_symbols): Use FOR_EACH
        walkers to walk cgraph and varpool.
	(materialize_cgraph): Likewise.
	* lto-partition.c (lto_1_to_1_map): Likewise.
	(lto_balanced_map): Likewise.
	(lto_promote_cross_file_statics): Likewise.

From-SVN: r186492
2012-04-16 12:04:17 +00:00
Jan Hubicka 960bfb6929 cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
	(symtab_node): Turn to union typedef.
	(symtab_node_base): New structure.
	(symtab_type): Add SYMTAB_SYMBOL tag.
	* cgraph.c: Update references to fields
	(cgraph_hash, assembler_name_hash): Turn into symtab_node.
	(cgraph_local_info): Remove lto_file_data
	and externally_visible.
	(cgraph_node): Remove decl; same_comdat_group list;
	aux; ref_list; order; address_taken; reachable_from_other_parittion,
	in_other_partition; resolution.
	(varpool_node): Remove decl; same_comdat_group;
	ref_list; lto_file_data; aux; order; resolution; externally_visible;
	used_from_other_partition; in_other_partition.
	(symtab_node_def); New union.
	(cgraph, varpool): Update.
	(varpool_first_static_initializer, varpool_next_static_initializer,
	cgraph_only_called_directly_or_aliased_p,
	varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
	varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
	varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
	field references.
	* cgraph.c: Likewise.
	* cgraphbuild.c: Likewise.
	* lto-symtab.c: Likewise.
	* c-gimplify.c: Likewise.
	* value-prof.c: Likewise.
	* tree.c: Likewise.
	* ipa-cp.c: Likewise.
	* tree-emutls.c: Likewise.
	* ipa-inline-transform.c: Likwise.
	* ipa-reference.c: Likewise.
	* cgraphunit.c: Likewise.
	* ipa-ref.c: Likewise.
	* lto-cgraph.c: Likewise.
	* ipa-ref-inline.h: Likewise.
	* ipa-pure-const.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* ipa-utils.c: Likewise.
	* ipa-inline.c: Likewise.
	* matrix-reorg.c: Likewise.
	* tree-eh.c: Likewise.
	* tree-vectorizer.c: Likewise.
	* ipa-split.c: Likewise.
	* ipa.c: Likewise.
	* trans-mem.c: Likewise.
	* ipa-inline-analysis.c: Likewise.
	* gimplify.c: Likewise.
	* cfgexpand.c: Likewise.
	* tree-sra.c: Likewise.
	* ipa-prop.c: Likewise.
	* varasm.c: Likewise.
	* tree-nested.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-profile.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* passes.c: Likewise.
	* varpool.c: Likewise.

	* tree.c: Update field referenced for new cgraph/varpool layout.
	* decl2.c: Likewise.

	* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
	cgraph/varpool layout.

	* lto.c: Update field referenced for new cgraph/varpool layout.
	* lto-partition.c: Likewise.

From-SVN: r186450
2012-04-14 10:24:59 +00:00
Jan Hubicka d028561e3c re PR tree-optimization/51680 (g++ 4.7 fails to inline trivial template stuff)
PR tree-optimize/51680
	* ipa-inline-analyss.c (evaluate_properties_for_edge): Fix conditoin on when
	known_vals needs to be computed; cleanup.

From-SVN: r182995
2012-01-08 16:39:00 +00:00
Jan Hubicka f45b2a8a5e re PR tree-optimization/51600 (ice in estimate_local_effects)
PR tree-optimization/51600
	* ipa-inline-analysis.c (estimate_edge_devirt_benefit): Disable code
	that benefits small functions.

From-SVN: r182984
2012-01-08 00:16:18 +00:00
Eric Botcazou 4ad9a9de2d lto-streamer-out.c (write_symbol): Use proper 64-bit host type.
* lto-streamer-out.c (write_symbol): Use proper 64-bit host type.
	* lto-cgraph.c (input_cgraph_opt_section): Use 'int' for offsets.
	* lto-streamer-in.c (lto_read_body): Likewise.
	(lto_input_toplevel_asms): Likewise.
	* lto-section-in.c (lto_create_simple_input_block): Likewise.
	* ipa-inline-analysis.c (inline_read_section): Likewise.
	* ipa-prop.c (ipa_prop_read_section): Likewise.

	* df.h (DF_NOTE): Fix typo in comment.
lto/
	* lto.h (lto_parse_hex): Delete.
	* lto.c (lto_read_decls): Use 'int' for offsets.
	(lto_parse_hex): Make static and return proper 64-bit host type.
	(lto_resolution_read): Use proper 64-bit host type.

From-SVN: r182310
2011-12-13 21:59:39 +00:00
Richard Guenther 89faf322d8 cgraph.c (cgraph_create_edge_1): Initialize call_stmt_cannot_inline_p from the stmt if possible.
2011-12-05  Richard Guenther  <rguenther@suse.de>

	* cgraph.c (cgraph_create_edge_1): Initialize
	call_stmt_cannot_inline_p from the stmt if possible.
	(cgraph_make_edge_direct): Likewise.
	* gimple-streamer-in.c (input_gimple_stmt): Do not
	call gimple_call_set_cannot_inline.
	* gimple.h (enum gf_mask): Remove GF_CALL_CANNOT_INLINE, shift
	values.
	(gimple_call_set_cannot_inline): Remove.
	(gimple_call_cannot_inline_p): Likewise.
	* ipa-inline-analysis.c (initialize_inline_failed): Look
	at the edge call_stmt_cannot_inline_p flag.
	* ipa-inline.c (can_inline_edge_p): Likewise.
	(early_inliner): Only update the edge flag.
	* ipa-prop.c (update_indirect_edges_after_inlining): Likewise.
	(ipa_modify_call_arguments): Do not call gimple_call_set_cannot_inline.
	* cgraphunit.c (assemble_thunk): Likewise.
	* gimple-fold.c (gimple_fold_call): Likewise.

	* tree.h (CALL_CANNOT_INLINE_P): Remove.
	* tree-mudflap.c (mf_xform_statements): Do not modify alloca calls.
	* builtins.c (expand_builtin_alloca): With -fmudflap do not expand
	alloca calls inline.
	* cfgexpand.c (expand_call_stmt): Do not set CALL_CANNOT_INLINE_P.
	* gimple.c (gimple_build_call_from_tree): Do not read
	CALL_CANNOT_INLINE_P.
	* gimplify.c (gimplify_call_expr): Do not copy CALL_CANNOT_INLINE_P.

From-SVN: r182001
2011-12-05 08:51:53 +00:00
Maxim Kuvyrkov d2d668fbbb ipa-cp.c (ipa_value_from_jfunc): Make global.
* ipa-cp.c (ipa_value_from_jfunc): Make global.
	(ipa_cst_from_jfunc): Remove, use ipa_value_from_jfunc instead.
	(get_indirect_edge_target): Rename, make global.
	(devirtualization_time_bonus, estimate_local_effects,)
	(ipcp_discover_new_direct_edges): Update.
	* ipa-inline-analysis.c (evaluate_conditions_for_edge):
	Generalize to also handle types.  Rename to ...
	(evaluate_properties_for_edge): Use instead of
	evaluate_conditions_for_edge.
	(estimate_edge_devirt_benefit): New function.
	(estimate_calls_size_and_time): Use it.
	(estimate_node_size_and_time, estimate_ipcp_clone_size_and_time,)
	(inline_merge_summary):	Update.
	(do_estimate_edge_time, do_estimate_edge_growth): Update.  Calculate
	parameter information at the call site and pass it on to subroutines.
	* tree-inline.c (estimate_num_insns): Distinguish between direct and
	indirect calls.
	(init_inline_once): Set size and time costs or indirect calls.
	* tree-inline.h (eni_weights): Add indirect_call_cost.

From-SVN: r181377
2011-11-15 03:46:08 +00:00
Richard Guenther 03cb5f3988 re PR tree-optimization/51039 (ICE: in estimate_function_body_sizes, at ipa-inline-analysis.c:1977 with -finline-small-functions -fno-ipa-pure-const and passing incompatible function ptr)
2011-11-09  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/51039
	* tree-cfg.c (verify_gimple_call): Verify that
	gimple_call_cannot_inline_p is returning a conservative
	correct result according to gimple_check_call_matching_types.
	* ipa-inline-analysis.c (estimate_function_body_sizes): Remove
	code dealing with un-inlinablility.
	* gimple-streamer-in.c (input_gimple_stmt): Update the
	non-inlinable flag.

	* gcc.dg/pr51039.c: New testcase.

From-SVN: r181205
2011-11-09 13:43:02 +00:00
Richard Sandiford 93b765d091 ipa-inline-analysis.c (MAX_TIME): Update comment.
gcc/
	* ipa-inline-analysis.c (MAX_TIME): Update comment.

From-SVN: r179446
2011-10-03 08:11:43 +00:00
Jan Hubicka 78e5ce9f1e * ipa-inline-analysis.c (inline_summary_alloc): Bounds check.
From-SVN: r179428
2011-10-02 14:28:18 +00:00
Jan Hubicka 1c52c60148 ipa-inline-analysis.c (reset_inline_edge_summary): New function.
* ipa-inline-analysis.c (reset_inline_edge_summary): New function.
	(reset_inline_summary): New function.
	(compute_inline_parameters, inline_node_removal_hook,
	inline_edge_removal_hook): Use it.
	(inline_free_summary): Reset holders correctly.
	(inline_generate_summary): Free summary before computing it.

From-SVN: r179427
2011-10-02 13:59:28 +00:00
Jan Hubicka 99e299a8c7 * ipa-inline-analysis.c (MAX_TIME): Reduce to avoid overflows.
From-SVN: r179274
2011-09-27 15:27:41 +00:00
Jan Hubicka 2ceb2339b1 inline-5.c: New testcase.
* gcc.dg/ipa/inline-5.c: New testcase.
	* ipa-inline-analysis.c (eliminated_by_inlining_prob): Handle parameters
	passed by reference; handle loads from non-SSA scalars and update comments.

From-SVN: r179273
2011-09-27 15:08:31 +00:00
Richard Sandiford 0578e4172d ipa-inline-analysis.c (predicate_probability): Avoid comparison between signed and unsigned.
gcc/
	* ipa-inline-analysis.c (predicate_probability): Avoid comparison
	between signed and unsigned.

From-SVN: r179268
2011-09-27 13:01:31 +00:00
Jan Hubicka 25837a2f78 inline-1.c: new testcase.
* gcc.dg/ipa/inline-1.c: new testcase.
	* gcc.dg/ipa/inline-2.c: new testcase.
	* gcc.dg/ipa/inline-3.c: new testcase.
	* gcc.dg/ipa/inline-4.c: new testcase.

	* ipa-inline-transform.c (inline_call): Add comment.
	* ipa-inline.h (inline_param_summary): New structure and vector.
	(struct inline_edge_summary): Add param field.
	* ipa-inline-analysis.c (CHANGED): New constant.
	(add_clause): Handle CHANGED and NOT_CONSTANT.
	(predicate_probability): New function.
	(dump_condition): Dump CHANGED predicate.
	(evaluate_conditions_for_known_args): Handle ERROR_MARK as marker
	of unknown function wide invariant.
	(evaluate_conditions_for_edge): Handle change probabilities.
	(inline_edge_duplication_hook): Copy param summaries.
	(inline_edge_removal_hook): Free param summaries.
	(dump_inline_edge_summary): Fix dumping of indirect edges and callee sizes;
	dump param summaries.
	(will_be_nonconstant_predicate): Use CHANGED predicate.
	(record_modified_bb_info): New structure.
	(record_modified): New function.
	(param_change_prob): New function.
	(estimate_function_body_sizes): Compute param summaries.
	(estimate_edge_size_and_time): Add probability argument.
	(estimate_node_size_and_time): Add inline_param_summary argument;
	handle predicate probabilities.
	(remap_predicate): Fix formating.
	(remap_edge_change_prob): New function.
	(remap_edge_summaries): Rename from ...; use remap_edge_change_prob.
	(remap_edge_predicates): ... this one.
	(inline_merge_summary): Remap edge summaries; handle predicate probabilities;
	remove param summaries after we are done.
	(do_estimate_edge_time): Update.
	(do_estimate_edge_growth): Update.
	(read_inline_edge_summary): Read param info.
	(inline_read_summary): Fix formating.
	(write_inline_edge_summary): Write param summaries.

From-SVN: r179126
2011-09-23 17:30:34 +00:00
Jan Hubicka 9e990d1436 * ipa-inline-analysis.c: Fix overly long lines.
From-SVN: r179084
2011-09-22 12:20:22 +00:00
Jan Hubicka 5ee53a0674 ipa-inline-transform.c (inline_call): Always update jump functions after inlining.
* ipa-inline-transform.c (inline_call): Always update jump functions
	after inlining.
	* ipa-inline.c (ipa_inline): Likewise; do not call
	ipa_create_all_structures_for_iinln.
	(ipa_inline): Always free jump functions.
	* ipa-inline-analysis.c (evaluate_conditions_for_edge): Remove
	hack.
	(remap_edge_predicates): Fix pasto.
	(inline_merge_summary): Remove nlined edge predicate; remove hack.
	(inline_analyze_function): Always initialize jump functions.
	(inline_generate_summary): Likewise.
	(inline_write_summary): Always write jump functions when ipa-cp
	is not doing that.
	(inline_read_summary): Always read jump functions when ipa-cp
	is not doing that.
	* ipa-prop.c (iinlining_processed_edges): Remove.
	(update_indirect_edges_after_inlining): Do not use
	iinlining_processed_edges; instead set param_index to -1.
	(propagate_info_to_inlined_callees): Only try to indirect inlining
	when asked to do so; update jump functions of indirect calls, too;
	remove jump functions of the inlined edge.
	(ipa_edge_duplication_hook): Do not copy iinlining_processed_edges.
	(ipa_create_all_structures_for_iinln): Remove.
	(ipa_free_all_structures_after_iinln): Do not free
	iinlining_processed_edges.
	* ipa-prop.h (ipa_create_all_structures_for_iinln): Remove.

From-SVN: r179083
2011-09-22 11:57:43 +00:00
Jan Hubicka 5f9f351709 ipa-inline-analsis.c (compute_inline_parameters): Set cfun and current_function_decl.
* ipa-inline-analsis.c (compute_inline_parameters): Set
	cfun and current_function_decl.

From-SVN: r179065
2011-09-21 23:11:08 +00:00
Jan Hubicka b439486d5e ipa-inline.c (relative_time_benefit): Fix wrong bracketting.
* ipa-inline.c (relative_time_benefit): Fix wrong bracketting.
	* ipa-inline.h (estimate_edge_time): Fix pasto.
	* ipa-inline-analysis.c (do_estiamte_edge_time): Remove capping.

From-SVN: r179064
2011-09-21 23:10:07 +00:00
Jan Hubicka 116b9c0785 re PR tree-optimization/50433 (ACATS c460010 fails to compile)
PR tree-optimization/50433
	* ipa-inline-analysis.c (eliminated_by_inlining_prob): Use get_base_address.

From-SVN: r179046
2011-09-21 13:10:31 +00:00
Jan Hubicka a61bd0304c ipa-inline-analysis.c (add_condition): Add conditions parameter; simplify obviously true clauses.
* ipa-inline-analysis.c (add_condition): Add conditions parameter;
	simplify obviously true clauses.
	(and_predicates, or_predicates): Add conditions parameter.
	(inline_duplication_hoook): Update.
	(mark_modified): New function.
	(unmodified_parm): New function.
	(eliminated_by_inlining_prob, (set_cond_stmt_execution_predicate,
	set_switch_stmt_execution_predicate, will_be_nonconstant_predicate):
	Use unmodified_parm.
	(estimate_function_body_sizes): Update.
	(remap_predicate): Update.

From-SVN: r178881
2011-09-15 12:15:43 +00:00
Martin Jambor 124f1be6a9 ipa-inline.h (struct inline_summary): Move versionable flag...
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-06 16:46:55 +02:00
Jan Hubicka c5ceeb8763 ipa-inline-analysis.c (set_cond_stmt_execution_predicate): Check that parameter is SSA name.
* ipa-inline-analysis.c (set_cond_stmt_execution_predicate): Check that
	parameter is SSA name.

From-SVN: r178524
2011-09-05 07:39:36 +00:00