Commit Graph

16 Commits

Author SHA1 Message Date
Jan Hubicka 45a80bb9e8 Makefile.in (passes.o, [...]): Add dependencies.
* Makefile.in (passes.o, ipa-inline.o): Add dependencies.
	* cgraphbuild.c (build_cgraph_edges): Compute frequencies.
	(rebuild_cgraph_edges): Likewise.
	* cgraph.c (cgraph_set_call_stmt): Add new argument frequency.
	(dump_cgraph_node): Dump frequencies.
	(cgraph_clone_edge): Add frequency scales.
	(cgraph_clone_node): Add freuqnecy.
	* cgraph.h (cgraph_edge): Add freuqnecy argument.
	(CGRAPH_FREQ_BASE, CGRAPH_FREQ_MAX): New constants.
	(cgraph_create_edge, cgraph_clone_edge, cgraph_clone_node): Update.
	* tree-pass.h (TODO_rebuild_frequencies): New constant.
	* cgraphunit.c (verify_cgraph_node): Verify frequencies.
	(cgraph_copy_node_for_versioning): Update call of cgraph_clone_edge.
	(save_inline_function_body): Likewise.
	* ipa-inline.c: inluce rtl.h
	(cgraph_clone_inlined_nods): Update call of cgraph_clone_node.
	(cgraph_edge_badness): Use frequencies.
	(cgraph_decide_recursive_inlining): Update clonning.
	(cgraph_decide_inlining_of_small_function): Dump frequency.
	* predict.c (estimate_bb_frequencies): Export.
	* predict.h (estimate_bb_frequencies): Declare.
	* tree-inline.c (copy_bb): Watch overflows.
	(expand_call_inline): Update call of cgraph_create_edge.
	(optimize_inline_calls): Use TODO flags to update frequnecies.
	* passes.h: Include predict.h
	(init_optimization_passes): Move profile ahead.
	(execute_function_todo): Handle TODO_rebuild_frequencies.

From-SVN: r121780
2007-02-09 22:49:30 +00:00
Kelley Cook 366ccddb2b Update FSF address.
From-SVN: r101317
2005-06-25 02:02:01 +00:00
Kazu Hirata 00c00def6f predict.h (IS_TAKEN): Remove.
* predict.h (IS_TAKEN): Remove.
	* rtl.h (NOTE_PREDICTION): Likewise.

From-SVN: r98258
2005-04-17 06:34:02 +00:00
Ben Elliston 7d6d381abb predict.h (predict_insn): Remove extern declaration.
* predict.h (predict_insn): Remove extern declaration.
	* predict.c (predict_insn): Make static.

From-SVN: r90884
2004-11-19 11:03:14 +11:00
Kazu Hirata f30278e8b4 bitmap.c, [...]: Update copyright.
* bitmap.c, bitmap.h, builtin-attrs.def, cfglayout.h,
	collect2.h, conflict.c, coretypes.h, coverage.h, errors.h,
	gcc.h, gcov-dump.c, gen-protos.c, gencheck.c, gencodes.c,
	genconstants.c, gengenrtl.c, genmodes.c, genpeep.c,
	gensupport.h, graph.h, gthr-gnat.c, gthr-gnat.h, gthr-posix.c,
	gthr-posix.h, hard-reg-set.h, hwint.h, integrate.h, libgcc2.c,
	lists.c, machmode.def, mips-tdump.c, opts.h, params.c,
	predict.def, predict.h, protoize.c, reload.h, resource.h,
	rtl-error.c, sbitmap.c, sbitmap.h, sreal.c, tlink.c,
	tree-dump.h, tree-inline.h, unwind-dw2-fde.c, unwind-dw2.c,
	unwind-sjlj.c, value-prof.h: Update copyright.

From-SVN: r89097
2004-10-15 14:47:12 +00:00
Jan Hubicka bbd236a198 predict.c (counts_to_freqs): Make glolbal.
* predict.c (counts_to_freqs): Make glolbal.
	* predict.h (counts_to_freqa): Declare.
	* profile.c (compute_branch_probabilities): Compute frequencies
	* tree-profile.c (do_tree_profiling): Refine conditional on when
	tree profiling pass is needed.

From-SVN: r88093
2004-09-25 10:06:18 +00:00
Diego Novillo 6de9cd9a88 Merge tree-ssa-20020619-branch into mainline.
From-SVN: r81764
2004-05-13 02:41:07 -04:00
Kazu Hirata 6614fd40d2 alias.c: Fix comment formatting.
* alias.c: Fix comment formatting.
	* alloc-pool.c: Likewise.
	* bitmap.c: Likewise.
	* bitmap.h: Likewise.
	* bt-load.c: Likewise.
	* c-common.c: Likewise.
	* c-common.h: Likewise.
	* c-decl.c: Likewise.
	* c-opts.c: Likewise.
	* c-pretty-print.c: Likewise.
	* caller-save.c: Likewise.
	* cfghooks.h: Likewise.
	* cgraph.c: Likewise.
	* collect2.c: Likewise.
	* cppfiles.c: Likewise.
	* cpplib.h: Likewise.
	* dwarf2out.c: Likewise.
	* dwarfout.c: Likewise.
	* emit-rtl.c: Likewise.
	* final.c: Likewise.
	* function.c: Likewise.
	* gcov.c: Likewise.
	* gcse.c: Likewise.
	* genemit.c: Likewise.
	* ggc.h: Likewise.
	* haifa-sched.c: Likewise.
	* ifcvt.c: Likewise.
	* libgcc2.h: Likewise.
	* loop.c: Likewise.
	* predict.h: Likewise.
	* unwind-libunwind.c: Likewise.
	* varasm.c: Likewise.

From-SVN: r74907
2003-12-21 14:08:35 +00:00
Ben Elliston 21f1c57746 Correct the description of these files in the comment header.
From-SVN: r74018
2003-11-28 22:23:36 +11:00
Andreas Jaeger 79a490a95b predict.h: Convert to ISO C90 prototypes.
* predict.h: Convert to ISO C90 prototypes.
	* predict.c: Likewise.
	* tree-dump.h: Likewise.
	* tree-dump.c: Likewise.
	* diagnostic.h: Likewise.
	* diagnostic.c: Likewise.
	* combine.c: Likewise.

	* rtl.h: Convert prototypes of combine.c to ISO C90.

From-SVN: r67626
2003-06-08 16:21:54 +02:00
Jan Hubicka 969d70ca57 cfglayout.c (function_tail_eff_head): Rename to ...
* cfglayout.c (function_tail_eff_head): Rename to ...
	(function_footer): ... this one.
	(unlink_insn_chain): New functions.
	(label_for_bb): Only call block_label and emit debug message.
	(record_effective_endpoints): Actually unlink the headers and footers.
	(fixup_reorder_cahin): Re-insert the unlinked sequences.
	(cfg_layout_duplicate_bb): Use duplicate_insn_chain.
	* cfglayout.h (struct reorder_block_def): New fields footer/header;
	remove eff_head/eff_end.
	* rtl.h (set_first_insn): Declare.
	* emit-rtl.c (set_first_insn): New function.

	* cfglayout.c (fixup_reorder_chain): Dump duplicated
	(cfg_layout_can_duplicate_bb_p, cfg_layout_rerirect_edge,
	cfg_layout_duplicate_bb): New global function.
	(duplicate_insn_chain): New static function.
	* cfglayout.h (cfg_layout_can_duplicate_bb_p, cfg_layout_rerirect_edge,
	cfg_layout_duplicate_bb): Declare.
	(struct reorder_block_def): Add "original" field.
	* emit-rtl.c (emit_copy_of_insn_after): New function.
	* rtl.h (emit_copy_of_insn_after): Declare.

	* cfglayout.c (fixup_fallthru_exit_predecessor): Kill.
	(fixup_reorder_chain): properly handle edges to exit block.

Wed May  8 11:10:31 CEST 2002  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
			       Jan Hubicka  <jh@suse.cz>

	* basic-block.h (note_prediction_to_br_prob): declare.
	* c-semantics.c: Inlucde predit.h
	(expand_stmt): predict GOTO_STMT as not taken.
	* cfgcleanup.c: (delete_unreachable_blocks): Make global.
	(cleanup_cfg): Do not free tail_recursion_list.
	* cfgrtl.c (can_delete_note_p): Delete NOTE_INSN_PREDICTION.
	(flow_delete_block): Kill predictions past end of basic block.
	* output.h (delete_unreachable_blocks): Declare.
	* predict.c (predicted_by_p, process_note_predictions,
	process_note_prediction, last_block_p): New function.
	(estimate_probability): Bypass loop on PRED_CONTINUE;
	do not handle noreturn heuristics; kill PRED_RETURN; add
	PRED_EARLY_RETURN.
	* predict.def (PRED_CONTINUE, PRED_EARLY_RETURN, PRED_GOTO,
	PRED_CONST_RETURN, PRED_NEGATIVE_RETURN, PRED_NULL_RETURN): New.
	* predict.h (IS_TAKEN): New constant.
	* print-rtl.c (print_rtx): Pretty print NOTE_INSN_PREDICTION.
	* rtl.c (NOTE_INSN_PREDICTION): New.
	* rtl.h (NOTE_PREDICTION, NOTE_PREDICTION_ALG, NOTE_PREDICTION_FLAGS):
	New macro.
	(insn_note): add NOTE_INSN_PREDICTION.
	* sibcall.c (optimize_sibling_and_tail_recursive_call): Do not build
	CFG; free tail_recursion_label_list.
	* stmt.c: Include predict.h;
	(return_prediction): New.
	(expand_value_return): Use it.
	* toplev.c: Lower NOTE_INSN_PREDICTION before sibcall.

From-SVN: r53285
2002-05-08 09:17:27 +00:00
Joseph Myers ff7cc30768 ChangeLog.0, [...]: Fix spelling errors.
* ChangeLog.0, ChangeLog.1, ChangeLog.2, ChangeLog.3, ChangeLog.4,
	ChangeLog.5, ChangeLog, FSFChangeLog.10, FSFChangeLog.11,
	c-common.c, c-common.h, c-parse.in, c-typeck.c, cfg.c, config.gcc,
	configure, configure.in, except.c, except.h, flow.c, function.c,
	gcc.c, gcse.c, genrecog.c, libgcc2.c, loop.c, loop.h, params.def,
	predict.def, predict.h, reg-stack.c, regmove.c, sched-deps.c,
	sched-int.h, sibcall.c, ssa.c, stringpool.c, toplev.c, tree.c,
	unroll.c: Fix spelling errors.

From-SVN: r46595
2001-10-28 20:09:17 +00:00
Kazu Hirata 2ba84f36ea c-common.h: Fix comment formatting.
* c-common.h: Fix comment formatting.
	* c-dump.c: Likewise.
	* cfg.c: Likewise.
	* diagnostic.h: Likewise.
	* except.c: Likewise.
	* gcc.h: Likewise.
	* gcov-io.h: Likewise.
	* genattrtab.c: Likewise.
	* output.h: Likewise.
	* predict.h: Likewise.
	* reload1.c: Likewise.
	* reload.h: Likewise.
	* resource.h: Likewise.
	* scan.h: Likewise.
	* system.h: Likewise.
	* tree.h: Likewise.
	* tree-inline.c: Likewise.
	* tsystem.h: Likewise.
	* varasm.c: Likewise.
	* xcoffout.h: Likewise.

From-SVN: r46122
2001-10-09 14:03:13 +00:00
Lars Brinkhoff 1322177dbd Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
	bitmap.h, builtin-types.def, builtins.c, builtins.def,
	c-aux-info.c, c-common.c, c-common.def, c-common.h,
	c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
	c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
	c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
	caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
	conditions.h, config.gcc, configure.frag, configure.in,
	conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
	cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
	dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
	doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
	dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
	emit-rtl.c, errors.c, errors.h, except.c, except.h,
	exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
	fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
	function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
	gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
	gencheck.c, gencodes.c, genconfig.c, genemit.c,
	genextract.c, genflags.c, gengenrtl.c, genmultilib,
	genopinit.c, genoutput.c, genpeep.c, genrecog.c,
	gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
	ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
	graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
	gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
	gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
	hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
	integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
	libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
	machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
	mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
	mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
	params.h, predict.c, predict.def, predict.h, prefix.c,
	prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
	read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
	regclass.c, regmove.c, regrename.c, regs.h, reload.c,
	reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
	rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
	sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
	sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
	ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
	stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
	tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
	tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
	unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
	unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
	xcoffout.h: replace "GNU CC" with "GCC".

From-SVN: r45105
2001-08-22 14:35:51 +00:00
Jan Hubicka 134d3a2eaa basic-block.h (EDGE_FREQUENCY): New macro.
* basic-block.h (EDGE_FREQUENCY): New macro.
	* bb-reorder (fixup_reorder_chain): Set counts and frequencies
	for new BB/edges.
	* flow.c (find_sub_basic_blocks): Likewise.
	(try_crossjump_to_edge): Likewise; use EDGE_FREQUENCY
	(redirect_edge_and_branch): Use EDGE_FREQUENCY.

	* predict.c (DEF_PREDICTOR): New argument FLAGS.
	(HITRATE): New macro.
	(PRED_FLAG_FIRST_MATCH): New constant.
	(predictor_info): New field flgags.
	(combine_predictions_for_insn): Use DS theory to combine
	probabilities; set the edge probabilities when finished.
	(estimate_probability): Avoid duplicated matches
	of LOOP_BRANCH heuristics for nested loops; update comment.
	* predict.def: Add flags for each prediction, set probabilities
	according to B&L paper.
	* predict.h (DEF_PREDICTOR): New argument FLAGS.

	* profile.c (compute_branch_probabilities):  Cleanup way the edge
	probabilities are computed and REG_BR_PROB notes are dropped; if
	values does not match, emit error.
	(init_branch_prob): Do error instead of warning when profile driven
	feedback is missing or corrupt.

From-SVN: r44439
2001-07-28 21:37:35 +00:00
Jan Hubicka 4db384c950 predict.def: New file.
* predict.def: New file.
	* predict.h: New file.
	* predict.c: Include predict.h.
	(predictor_info): New structure and array.
	(predict_edge, predict_insn): Rewrite; make global.
	(predict_edge_def, predict_insn_def): New global functions.
	(dump_prediction, combine_predictions_for_insns): New
	static functions.
	(estimate_probability): Change calls to predict_edge
	to predict_edge_def and calls to predict_insn to predict_insn_def;
	combine probabilities.
	(expected_value_to_br_prob): Behave as predictor.
	* rtl.h (REG_BR_PRED): Update coment.
	(invert_br_probabilities): New.
	* jump.c: Include predict.h
	(duplicate_loop_exit_test): Drop branch prediction notes.
	(invert_jump): Use invert_br_probabilities.
	* Makefile.in: Add dependancy on predict.h for jump and predict pass.
	* ifcvt.c (dead_or_predicable): Use invert_br_probabilities.
	* combine.c (distribute_notes): Handle BR_PRED.

From-SVN: r43115
2001-06-09 22:39:25 +00:00