Commit Graph

56 Commits

Author SHA1 Message Date
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
Martin Jambor 201176d348 re PR middle-end/49886 (pass_split_functions cannot deal with function type attributes)
2011-08-31  Martin Jambor  <mjambor@suse.cz>

	PR middle-end/49886
	* ipa-inline-analysis.c (compute_inline_parameters): Set
	can_change_signature of noes with typde attributes.
	* ipa-split.c (split_function): Do not skip any arguments if
	can_change_signature is set.

	* testsuite/gcc.c-torture/execute/pr49886.c: New testcase.

From-SVN: r178386
2011-08-31 19:17:19 +02:00
Diego Novillo 412288f1c0 data-streamer.h (streamer_write_zero): Rename from output_zero.
* data-streamer.h (streamer_write_zero): Rename from output_zero.
 	(streamer_write_uhwi): Rename from lto_output_uleb128.
 	(streamer_write_hwi): Rename from output_sleb128.
 	(streamer_write_string): Rename from lto_output_string.
 	(streamer_string_index): Rename from lto_string_index.
 	(streamer_write_string_with_length): Rename from
 	lto_output_string_with_length.
 	(streamer_write_uhwi_stream): Rename from lto_output_uleb128_stream.
 	(streamer_write_hwi_stream): Rename from lto_output_sleb128_stream.
 	(streamer_read_string): Rename from lto_input_string.
 	(streamer_read_indexed_string): Rename from input_string_internal.
 	(streamer_read_uhwi): Rename from lto_input_uleb128.
 	(streamer_read_hwi): Rename from lto_input_sleb128.
 	(streamer_write_hwi_in_range): Rename from lto_output_int_in_range.
 	(streamer_read_hwi_in_range): Rename from lto_input_int_in_range.
 	(streamer_write_enum): Rename from lto_output_enum.
 	(streamer_read_enum): Rename from lto_input_enum.
 	(streamer_write_record_start): Rename from output_record_start.
 	(streamer_read_record_start): Rename from input_record_start.
 	(streamer_write_bitpack): Rename from lto_output_bitpack.
 	(streamer_read_bitpack): Rename from lto_input_bitpack.
 	(streamer_write_char_stream): Rename from lto_output_1_stream.
 	(streamer_read_uchar): Rename from lto_input_1_unsigned.
 	* tree-streamer.h (streamer_cache_d): Rename from lto_streamer_cache_d.
 	(streamer_handle_as_builtin_p): Rename from lto_stream_as_builtin_p.
 	(streamer_read_string_cst): Rename from input_string_cst.
 	(streamer_read_chain): Rename from lto_input_chain.
 	(streamer_alloc_tree): Rename from lto_materialize_tree.
 	(streamer_read_tree_body): Rename from lto_input_tree_pointers.
 	(streamer_get_pickled_tree): Rename from lto_get_pickled_tree.
 	(streamer_get_builtin_tree): Rename from lto_get_builtin_tree.
 	(streamer_read_integer_cst): Rename from lto_input_integer_cst.
 	(streamer_read_tree_bitfields): Rename from tree_read_bitfields.
 	(streamer_write_chain): Rename from lto_output_chain.
 	(streamer_write_tree_header): Rename from lto_output_tree_header.
 	(streamer_pack_tree_bitfields): Rename from pack_value_fields.
 	(streamer_write_tree_body): Rename from lto_output_tree_pointers.
 	(streamer_write_integer_cst): Rename from lto_output_integer_cst.
 	(streamer_write_builtin): Rename from lto_output_builtin_tree.
 	(streamer_check_handled_ts_structures): Rename from
 	check_handled_ts_structures.
 	(streamer_tree_cache_insert): Rename from lto_streamer_cache_insert.
 	(streamer_tree_cache_insert_at): Rename from
 	lto_streamer_cache_insert_at.
 	(streamer_tree_cache_append): Rename from lto_streamer_cache_append.
 	(streamer_tree_cache_lookup): Rename from lto_streamer_cache_lookup.
 	(streamer_tree_cache_get): Rename from lto_streamer_cache_get.
 	(streamer_tree_cache_create): Rename from lto_streamer_cache_create.
 	(streamer_tree_cache_delete): Rename from lto_streamer_cache_delete.
 	* tree-streamer-out.c (write_string_cst): Rename from output_string_cst.
 	(write_identifier): Rename from output_identifier.
 	(write_ts_common_tree_pointers): Rename from
 	lto_output_ts_common_tree_pointers.
 	(write_ts_vector_tree_pointers): Rename from
 	lto_output_ts_vector_tree_pointers.
 	(write_ts_complex_tree_pointers): Rename from
 	lto_output_ts_complex_tree_pointers.
 	(write_ts_decl_minimal_tree_pointers): Rename from
 	lto_output_ts_decl_minimal_tree_pointers.
 	(write_ts_decl_common_tree_pointers): Rename from
 	lto_output_ts_decl_common_tree_pointers.
 	(write_ts_decl_non_common_tree_pointers): Rename from
 	lto_output_ts_decl_non_common_tree_pointers.
 	(write_ts_decl_with_vis_tree_pointers): Rename from
 	lto_output_ts_decl_with_vis_tree_pointers.
 	(write_ts_field_decl_tree_pointers): Rename from
 	lto_output_ts_field_decl_tree_pointers.
 	(write_ts_function_decl_tree_pointers): Rename from
 	lto_output_ts_function_decl_tree_pointers.
 	(write_ts_type_common_tree_pointers): Rename from
 	lto_output_ts_type_common_tree_pointers.
 	(write_ts_type_non_common_tree_pointers): Rename from
 	lto_output_ts_type_non_common_tree_pointers.
 	(write_ts_list_tree_pointers): Rename from
 	lto_output_ts_list_tree_pointers.
 	(write_ts_vec_tree_pointers): Rename from
 	lto_output_ts_vec_tree_pointers.
 	(write_ts_exp_tree_pointers): Rename from
 	lto_output_ts_exp_tree_pointers.
 	(write_ts_block_tree_pointers): Rename from
 	lto_output_ts_block_tree_pointers.
 	(write_ts_binfo_tree_pointers): Rename from
 	lto_output_ts_binfo_tree_pointers.
 	(write_ts_constructor_tree_pointers): Rename from
 	lto_output_ts_constructor_tree_pointers.
 	(write_ts_target_option): Rename from
 	lto_output_ts_target_option.
 	(write_ts_translation_unit_decl_tree_pointers): Rename from
 	lto_output_ts_translation_unit_decl_tree_pointers.
 	* tree-streamer.c (streamer_tree_cache_add_to_node_array):
 	Rename from lto_streamer_cache_add_to_node_array.
 	(streamer_tree_cache_insert_1): Rename from lto_streamer_cache_insert_1.
 	(record_common_node): Rename from lto_record_common_node.

	* streamer-hooks.h (bitpack_d, lto_streamer_cache_d): Remove forward
	declarations.
	* data-streamer-in.c (lto_input_widest_uint_uleb128): Remove unused
	function.
	* data-streamer-out.c (lto_output_widest_uint_uleb128_stream): Remove
	unused function.
	* Makefile.in (lto-section-out.o): Add dependency on DATA_STREAMER_H.
	(ipa-reference.o): Likewise.
	* lto-section-out.c: Include data-streamer.h.
	* ipa-reference.c: Include data-streamer.h.

From-SVN: r177704
2011-08-12 12:42:13 -04:00
Diego Novillo b939365672 tree-streamer-out.c (lto_output_ts_decl_with_vis_tree_pointers): Call stream_write_tree instead of output_record_start.
* tree-streamer-out.c (lto_output_ts_decl_with_vis_tree_pointers):
	Call stream_write_tree instead of output_record_start.
	(lto_output_ts_binfo_tree_pointers): Likewise.

	* streamer-hooks.h (stream_write_tree): Move from tree-streamer.h.
	Convert it to a macro.
	(stream_read_tree): Likewise.

	* lto-streamer.h (lto_stream_as_builtin_p): Move ...
	* tree-streamer.h (lto_stream_as_builtin_p): ... here.

	* lto-streamer-in.c (lto_read_tree): Call lto_streamer_cache_append
	and tree_read_bitfields.
	* lto-streamer-out.c (lto_is_streamable): Move from lto-streamer.c
	(lto_write_tree): Call it.
	* lto-streamer.c (lto_is_streamable): Move to lto-streamer-out.c
	* streamer-hooks.h (struct streamer_hooks): Remove fields
	name, is_streamable and alloc_tree. Update all users.
	* tree-streamer-in.c (tree_read_bitfields): Factor out of ...
	(lto_materialize_tree): ... here.
	Handle CALL_EXPR codes.
	Remove call to lto_streamer_cache_append.
	* tree-streamer-out.c (lto_output_tree_header): Handle
	CALL_EXPR nodes.
	* tree-streamer.h (tree_read_bitfields): Declare.

	* Makefile.in (TREE_STREAMER_H): Add STREAMER_HOOKS_H.
	(gimple-streamer-in.o): Add dependency on TREE_STREAMER_H.
	* tree-streamer.h (stream_read_tree): New.  Replace all calls
	to lto_input_tree with it.
	(stream_write_tree): New.  Replace all calls to lto_output_tree,
	lto_output_tree_ref and lto_output_tree_or_ref with it.
	* lto-streamer-in.c (lto_read_tree): Inline code from
	lto_streamer_read_tree.
	(lto_input_tree): Move from tree-streamer-in.c.
	* lto-streamer-out.c (lto_output_tree_ref): Make static.
	Remove handling of NULL values for EXPR.
	Do not handle EXPRs that are not indexable.
	(lto_write_tree): Move from tree-streamer-out.c.
	Inline lto_streamer_write_tree.
	(lto_output_tree): Move from tree-streamer-out.c.
	If REF_P is true and EXPR is indexable, call lto_output_tree_ref.
	* lto-streamer.c (lto_record_common_node): Move to tree-streamer.c.
	(lto_preload_common_nodes): Likewise.
	Remove assertions and adjustments for nodes
	main_identifier_node, ptrdiff_type_node and fileptr_type_node.
	(lto_streamer_hooks_init): Set streamer_hooks.write_tree to
	lto_output_tree and streamer_hooks.read_tree to
	lto_input_tree.
	* lto-streamer.h (lto_input_tree): Declare.
	(lto_output_tree_ref): Remove.
	* streamer-hooks.h (struct streamer_hooks): Remove fields
	preload_common_nodes, indexable_with_decls_p,
	pack_value_fields, unpack_value_fields, output_tree_header and
	has_unique_integer_csts_p.
	Update all users.
	* tree-streamer-in.c (lto_materialize_tree): Make extern.
	(lto_input_tree_pointers): Likewise.
	(lto_read_tree): Move to lto-streamer-in.c.
	(lto_input_integer_cst): Make extern.
	(lto_get_pickled_tree): Likewise.
	(lto_get_builtin_tree): Likewise.
	(lto_input_tree): Move to lto-streamer-in.c.
	* tree-streamer-out.c (pack_value_fields): Make extern.
	(lto_output_tree_or_ref): Remove.  Replace all callers with
	calls to stream_write_tree.
	(lto_output_builtin_tree): Make extern.
	(lto_streamer_write_tree): Inline into lto_write_tree.
	(lto_output_tree_pointers): Make extern.
	(lto_output_tree_header): Likewise.
	(lto_output_integer_cst): Likewise.
	(lto_write_tree): Move to lto-streamer-out.c.
	(lto_output_tree): Likewise.
	* tree-streamer.c (lto_record_common_node): Move from
	lto-streamer.c
	(preload_common_nodes): Likewise.
	(lto_streamer_cache_create): Call it.
	* tree-streamer.h: Include streamer-hooks.h.
	(stream_write_tree): New.
	(stream_read_tree): New.
	(lto_input_tree): Remove.
	(lto_materialize_tree): Declare.
	(lto_input_tree_pointers): Declare.
	(lto_get_pickled_tree): Declare.
	(lto_get_builtin_tree): Declare.
	(lto_input_integer_cst): Declare.
	(lto_output_tree_header): Declare.
	(pack_value_fields): Declare.
	(lto_output_tree_pointers): Declare.
	(lto_output_integer_cst): Declare.
	(lto_output_builtin_tree): Declare.

From-SVN: r177661
2011-08-11 08:02:34 -04:00
Diego Novillo f0efc7aa77 rebase
From-SVN: r177571
2011-08-08 12:49:34 -04:00
Mikael Pettersson daae4650a9 re PR tree-optimization/50005 (ipa-inline-analysis.c:1876:41: error: comparison between signed an d unsigned integer expressions)
2011-08-08  Mikael Pettersson  <mikpe@it.uu.se>

        PR tree-optimization/50005
        * ipa-inline-analysis (remap_predicate): Add cast to
        silence signed/unsigned comparison warning.

From-SVN: r177557
2011-08-08 09:59:02 +00:00
Jan Hubicka 9911e25a27 + PR middle-end/49494 + * ipa-inline-analysis.c (remap_predicate): Add bounds check.
+ 	PR middle-end/49494
+ 	* ipa-inline-analysis.c (remap_predicate): Add bounds check.
+ 	* gfortran.dg/pr49494.f90: New testcase.

From-SVN: r177484
2011-08-05 20:56:05 +00:00
Jan Hubicka 317a064665 ipa-inline.c (reset_edge_caches): Walk aliases.
* ipa-inline.c (reset_edge_caches): Walk aliases.
	(update_caller_keys): Do not test inlinability of aliases.
	* ipa-inline-analysis.c (do_estimate_edge_time): Look through alias.
	(do_estimate_growth): Fix typo.

From-SVN: r174992
2011-06-13 15:34:59 +00:00
Jan Hubicka 9aa3f5c58c cgraph.c (cgraph_for_node_thunks_and_aliases, [...]): Fix thinko in 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-13 09:19:09 +00:00
Jan Hubicka a5b1779f81 ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
	(clone_inlined_nodes): ... here.
	(inline_call): Use cgraph_function_or_thunk_node; redirect edge
	to real destination prior inlining.
	* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
	can_early_inline_edge_p, want_early_inline_function_p,
	want_early_inline_function_p, want_inline_small_function_p,
	want_inline_self_recursive_call_p, want_inline_function_called_once_p,
	edge_badness, update_all_callee_keys, lookup_recursive_calls,
	add_new_edges_to_heap, inline_small_functions, flatten_function,
	inline_always_inline_functions, early_inline_small_functions): Use
	cgraph_function_or_thunk_node.
	* ipa-inline-analysis.c (evaluate_conditions_for_edge,
	dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
	(do_estimate_edge_growth_1): Break out from ...
	(do_estimate_growth) ... here; walk aliases.
	(inline_generate_summary): Skip aliases.

From-SVN: r174901
2011-06-10 11:43:01 +00:00
Alexandre Oliva f75e1f1ee3 re PR bootstrap/49270 (make BOOT_CFLAGS="-g -O3" CFLAGS_FOR_TARGET="-g -O3" CXXFLAGS_FOR_TARGET="-g -O3" failure)
PR bootstrap/49270
* ipa-inline-analysis.c (read_predicate): Initialize all clauses.

From-SVN: r174697
2011-06-06 13:24:39 +00:00
Jan Hubicka a45c055721 re PR middle-end/48893 (ICE in evaulate_conditions_for_edge at ipa-inline-analysis.c:477)
PR tree-optimization/48893
	PR tree-optimization/49091
	PR tree-optimization/49179
	* ipa-inline-analysis.c (evaluate_conditions_for_known_args):
	Bounds check.

	* gfortran.dg/pr49179.f90: New testcase

From-SVN: r174648
2011-06-04 18:00:47 +00:00
Jan Hubicka e3195c52b9 re PR tree-optimization/48929 (ICE: in estimate_size_after_inlining, at ipa-inline-analysis.c:1961 with -findirect-inlining)
PR tree-optimize/48929
	* gcc.c-torture/compile/pr48929.c: New testcase.
	* ipa-inline-analysis.c (remap_edge_predicates): Fix handling
	of empty predicate.

From-SVN: r174638
2011-06-04 14:24:20 +00:00
Uros Bizjak 267ffce3cb ipa-inline-analysis.c (inline_node_duplication_hook): Initialize info->entry with 0
* ipa-inline-analysis.c (inline_node_duplication_hook): Initialize
	info->entry with 0
	* tree-inline.c (maybe_inline_call_in_expr):  Initialize
	id.transform_lang_insert_block with NULL.

From-SVN: r173834
2011-05-17 20:31:08 +02:00
Martin Jambor 411a20d66c ipa-prop.c (ipa_cst_from_jfunc): New function.
2011-05-13  Martin Jambor  <mjambor@suse.cz>

	* ipa-prop.c (ipa_cst_from_jfunc): New function.
	* ipa-prop.h (ipa_cst_from_jfunc): Declare.
	* ipa-inline-analysis.c (evaluate_conditions_for_edge): Use it.
	(evaluate_conditions_for_ipcp_clone): Removed.
	(estimate_ipcp_clone_size_and_time): Accept vector of known constants.
	* ipa-cp.c (ipcp_estimate_growth): Build vector of known constants.
	* ipa-inline.h (estimate_ipcp_clone_size_and_time): Update.

From-SVN: r173739
2011-05-14 00:01:59 +02:00
Jan Hubicka 74605a11f3 cgraph.c (cgraph_clone_node): Add call_duplication_hook parameter.
* 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-08 19:14:24 +00:00
Jan Hubicka c47d00347d cgraph.c (cgraph_add_thunk): Create real function node instead of alias node...
* 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-06 23:00:49 +00:00
Jan Hubicka 09dfe187f0 ipa-inline.c (caller_growth_limits): Fix thinko when
* ipa-inline.c (caller_growth_limits): Fix thinko when
	* ipa-inline.c (caller_growth_limits): Fix thinko when
	looking for largest stack frame.
	* ipa-inline.h (dump_inline_summary): Declare.
	* ipa-inline-analysis.c (dump_inline_edge_summary): Dump info
	on stack usage.
	(dump_inline_summary): Export.
	(debug_inline_summary): Declare as DEBUG_FUNCTION.

From-SVN: r173234
2011-05-01 19:11:07 +00:00
Jan Hubicka b15c64ee1a inline-10.c: New testcase.
* gcc.dg/tree-ssa/inline-10.c: New testcase.
	* gcc.dg/tree-ssa/inline-9.c: Disable partial inlining.
	* ipa-inline.h (clause_t): Turn into unsigned int.
	* ipa-inline-analysis.c (add_clause): Do more simplification.
	(and_predicates): Shortcut more cases.
	(predicates_equal_p): Move forward; check that clauses are properly
	ordered.
	(or_predicates): Shortcut more cases.
	(edge_execution_predicate): Rewrite as...
	(set_cond_stmt_execution_predicate): ... this function; handle
	__builtin_constant_p.
	(set_switch_stmt_execution_predicate): New .
	(compute_bb_predicates): New.
	(will_be_nonconstant_predicate): Update TODO.
	(estimate_function_body_sizes): Use compute_bb_predicates
	and free them later, always try to estimate if stmt is constant.
	(estimate_time_after_inlining, estimate_size_after_inlining):
	Gracefully handle optimized out edges.
	(read_predicate): Fix off by one error.

From-SVN: r173190
2011-04-29 21:21:46 +00:00
Jan Hubicka 970dabbd1e ipa-inline-analysis.c (will_be_nonconstant_predicate): Take nonconstant_names array.
* ipa-inline-analysis.c (will_be_nonconstant_predicate): Take nonconstant_names
	array.
	(estimate_function_body_sizes): Build nonconstant_names array; handle
	BUILT_IN_CONSTANT_P.

From-SVN: r173070
2011-04-28 13:29:54 +00:00
Jan Hubicka 991278ab90 inline-9.c: New testcase.
* testsuite/gcc.dg/tree-ssa/inline-9.c: New testcase.
	* ipa-inline.h (struct inline_edge_summary): Add predicate pointer.
	* ipa-inline-analysis.c: Include alloc-pool.h.
	(edge_predicate_pool): New.
	(trye_predicate_p): New function
	(false_predicate_p): New function.
	(add_clause): Sanity check that false clauses are "optimized";
	never add clauses to predicate that is already known to be false.
	(and_predicate): Use flase_predicate_p.
	(evaulate_predicate): Rename to ...
	(evaluate_predicate): ... this one; update all callers; assert
	that false is not listed among possible truths.
	(dump_predicate): Use true_predicate_p.
	(account_size_time): Use false_predicate_p.
	(evaulate_conditions_for_edge): Rename to ...
	(evaluate_conditions_for_edge) ... this one.
	(edge_set_predicate): New function.
	(inline_edge_duplication_hook): Duplicate edge predicates.
	(inline_edge_removal_hook): Free edge predicates.
	(dump_inline_edge_summary): Add INFO parameter; dump
	edge predicates.
	(dump_inline_summary): Update.
	(estimate_function_body_sizes): Set edge predicates.
	(estimate_calls_size_and_time): Handle predicates.
	(estimate_callee_size_and_time): Update.
	(remap_predicate): Add toplev_predicate; update comment.
	(remap_edge_predicates): New function.
	(inline_merge_summary): Compute toplev predicate; update.
	(read_predicate): New function.
	(read_inline_edge_summary): Use it.
	(inline_read_section): Likewise.
	(write_predicate): New function.
	(write_inline_edge_summary): Use it.
	(inline_write_summary): Likewise.
	(inline_free_summary): Free alloc pool and edge summary vec.

From-SVN: r173042
2011-04-27 17:28:51 +00:00
Jan Hubicka 898b892746 cgraphbuild.c (build_cgraph_edges): Update call of cgraph_create_edge and 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-26 22:05:50 +00:00
Jan Hubicka f3181aa202 ipa-prop.c (ipa_propagate_indirect_call_infos): Remove obsolette WPA hack.
* ipa-prop.c (ipa_propagate_indirect_call_infos): Remove obsolette
	WPA hack.
	* ipa-prop.h (ipa_get_param, ipa_is_param_used, ipa_param_cannot_devirtualize_p,
	ipa_param_types_vec_empty, ipa_get_ith_jump_func, ipa_get_lattice):
	Fortify array bounds.
	* ipa-inline-analysis.c (add_clause): Fix clause ordering.
	(and_predicates, or_predicates, predicates_equal_p, evaulate_predicate):
	Sanity check predicate length.
	(remap_predicate): Likewise; sanity check jump functions.
	(inline_read_section, inline_write_summary): Sanity check
	predicate length.

From-SVN: r172914
2011-04-24 10:43:00 +00:00
Jan Hubicka 7ee28a7471 * ipa-inline-analysis.c (inline_write_summary): Fix thinko.
From-SVN: r172898
2011-04-23 11:37:26 +00:00