From 675d86b2a33c6783fd1c21ae44d47b4fee9e95ea Mon Sep 17 00:00:00 2001 From: spop Date: Wed, 12 Aug 2009 14:19:33 +0000 Subject: Recompute profile after Graphite. 2009-08-05 Sebastian Pop * Makefile.in (graphite.o): Depends on PREDICT_H. * graphite.c: Include predict.h. (graphite_finalize): Call tree_estimate_probability. * predict.c (predict_loops): Do not call scev_initialize and scev_finalize. (tree_estimate_probability_bb): New. (tree_estimate_probability): Do not initialize loops: move that code to the driver. Call tree_estimate_probability_bb. (tree_estimate_probability_driver): New. (pass_profile): Use tree_estimate_probability_driver. * predict.h (tree_estimate_probability): Declared. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150684 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/predict.c | 202 +++++++++++++++++++++++++++++++++------------------------- 1 file changed, 114 insertions(+), 88 deletions(-) (limited to 'gcc/predict.c') diff --git a/gcc/predict.c b/gcc/predict.c index e3b4b83b863..6353fb96a56 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -916,8 +916,6 @@ predict_loops (void) loop_iterator li; struct loop *loop; - scev_initialize (); - /* Try to predict out blocks in a loop that are not part of a natural loop. */ FOR_EACH_LOOP (li, loop, 0) @@ -1040,8 +1038,6 @@ predict_loops (void) /* Free basic blocks from get_loop_body. */ free (bbs); } - - scev_finalize (); } /* Attempt to predict probabilities of BB outgoing edges using local @@ -1608,16 +1604,96 @@ assert_is_empty (const void *key ATTRIBUTE_UNUSED, void **value, } #endif -/* Predict branch probabilities and estimate profile of the tree CFG. */ -static unsigned int +/* Predict branch probabilities and estimate profile for basic block BB. */ + +static void +tree_estimate_probability_bb (basic_block bb) +{ + edge e; + edge_iterator ei; + gimple last; + + FOR_EACH_EDGE (e, ei, bb->succs) + { + /* Predict early returns to be probable, as we've already taken + care for error returns and other cases are often used for + fast paths through function. + + Since we've already removed the return statements, we are + looking for CFG like: + + if (conditional) + { + .. + goto return_block + } + some other blocks + return_block: + return_stmt. */ + if (e->dest != bb->next_bb + && e->dest != EXIT_BLOCK_PTR + && single_succ_p (e->dest) + && single_succ_edge (e->dest)->dest == EXIT_BLOCK_PTR + && (last = last_stmt (e->dest)) != NULL + && gimple_code (last) == GIMPLE_RETURN) + { + edge e1; + edge_iterator ei1; + + if (single_succ_p (bb)) + { + FOR_EACH_EDGE (e1, ei1, bb->preds) + if (!predicted_by_p (e1->src, PRED_NULL_RETURN) + && !predicted_by_p (e1->src, PRED_CONST_RETURN) + && !predicted_by_p (e1->src, PRED_NEGATIVE_RETURN)) + predict_edge_def (e1, PRED_TREE_EARLY_RETURN, NOT_TAKEN); + } + else + if (!predicted_by_p (e->src, PRED_NULL_RETURN) + && !predicted_by_p (e->src, PRED_CONST_RETURN) + && !predicted_by_p (e->src, PRED_NEGATIVE_RETURN)) + predict_edge_def (e, PRED_TREE_EARLY_RETURN, NOT_TAKEN); + } + + /* Look for block we are guarding (ie we dominate it, + but it doesn't postdominate us). */ + if (e->dest != EXIT_BLOCK_PTR && e->dest != bb + && dominated_by_p (CDI_DOMINATORS, e->dest, e->src) + && !dominated_by_p (CDI_POST_DOMINATORS, e->src, e->dest)) + { + gimple_stmt_iterator bi; + + /* The call heuristic claims that a guarded function call + is improbable. This is because such calls are often used + to signal exceptional situations such as printing error + messages. */ + for (bi = gsi_start_bb (e->dest); !gsi_end_p (bi); + gsi_next (&bi)) + { + gimple stmt = gsi_stmt (bi); + if (is_gimple_call (stmt) + /* Constant and pure calls are hardly used to signalize + something exceptional. */ + && gimple_has_side_effects (stmt)) + { + predict_edge_def (e, PRED_CALL, NOT_TAKEN); + break; + } + } + } + } + tree_predict_by_opcode (bb); +} + +/* Predict branch probabilities and estimate profile of the tree CFG. + This function can be called from the loop optimizers to recompute + the profile information. */ + +void tree_estimate_probability (void) { basic_block bb; - loop_optimizer_init (0); - if (dump_file && (dump_flags & TDF_DETAILS)) - flow_loops_dump (dump_file, NULL, 0); - add_noreturn_fake_exit_edges (); connect_infinite_loops_to_exit (); /* We use loop_niter_by_eval, which requires that the loops have @@ -1627,89 +1703,14 @@ tree_estimate_probability (void) bb_predictions = pointer_map_create (); tree_bb_level_predictions (); - - mark_irreducible_loops (); record_loop_exits (); + if (number_of_loops () > 1) predict_loops (); FOR_EACH_BB (bb) - { - edge e; - edge_iterator ei; - gimple last; - - FOR_EACH_EDGE (e, ei, bb->succs) - { - /* Predict early returns to be probable, as we've already taken - care for error returns and other cases are often used for - fast paths through function. - - Since we've already removed the return statements, we are - looking for CFG like: - - if (conditional) - { - .. - goto return_block - } - some other blocks - return_block: - return_stmt. */ - if (e->dest != bb->next_bb - && e->dest != EXIT_BLOCK_PTR - && single_succ_p (e->dest) - && single_succ_edge (e->dest)->dest == EXIT_BLOCK_PTR - && (last = last_stmt (e->dest)) != NULL - && gimple_code (last) == GIMPLE_RETURN) - { - edge e1; - edge_iterator ei1; - - if (single_succ_p (bb)) - { - FOR_EACH_EDGE (e1, ei1, bb->preds) - if (!predicted_by_p (e1->src, PRED_NULL_RETURN) - && !predicted_by_p (e1->src, PRED_CONST_RETURN) - && !predicted_by_p (e1->src, PRED_NEGATIVE_RETURN)) - predict_edge_def (e1, PRED_TREE_EARLY_RETURN, NOT_TAKEN); - } - else - if (!predicted_by_p (e->src, PRED_NULL_RETURN) - && !predicted_by_p (e->src, PRED_CONST_RETURN) - && !predicted_by_p (e->src, PRED_NEGATIVE_RETURN)) - predict_edge_def (e, PRED_TREE_EARLY_RETURN, NOT_TAKEN); - } + tree_estimate_probability_bb (bb); - /* Look for block we are guarding (ie we dominate it, - but it doesn't postdominate us). */ - if (e->dest != EXIT_BLOCK_PTR && e->dest != bb - && dominated_by_p (CDI_DOMINATORS, e->dest, e->src) - && !dominated_by_p (CDI_POST_DOMINATORS, e->src, e->dest)) - { - gimple_stmt_iterator bi; - - /* The call heuristic claims that a guarded function call - is improbable. This is because such calls are often used - to signal exceptional situations such as printing error - messages. */ - for (bi = gsi_start_bb (e->dest); !gsi_end_p (bi); - gsi_next (&bi)) - { - gimple stmt = gsi_stmt (bi); - if (is_gimple_call (stmt) - /* Constant and pure calls are hardly used to signalize - something exceptional. */ - && gimple_has_side_effects (stmt)) - { - predict_edge_def (e, PRED_CALL, NOT_TAKEN); - break; - } - } - } - } - tree_predict_by_opcode (bb); - } FOR_EACH_BB (bb) combine_predictions_for_bb (bb); @@ -1722,6 +1723,31 @@ tree_estimate_probability (void) estimate_bb_frequencies (); free_dominance_info (CDI_POST_DOMINATORS); remove_fake_exit_edges (); +} + +/* Predict branch probabilities and estimate profile of the tree CFG. + This is the driver function for PASS_PROFILE. */ + +static unsigned int +tree_estimate_probability_driver (void) +{ + unsigned nb_loops; + + loop_optimizer_init (0); + if (dump_file && (dump_flags & TDF_DETAILS)) + flow_loops_dump (dump_file, NULL, 0); + + mark_irreducible_loops (); + + nb_loops = number_of_loops (); + if (nb_loops > 1) + scev_initialize (); + + tree_estimate_probability (); + + if (nb_loops > 1) + scev_finalize (); + loop_optimizer_finalize (); if (dump_file && (dump_flags & TDF_DETAILS)) gimple_dump_cfg (dump_file, dump_flags); @@ -2203,7 +2229,7 @@ struct gimple_opt_pass pass_profile = GIMPLE_PASS, "profile", /* name */ gate_estimate_probability, /* gate */ - tree_estimate_probability, /* execute */ + tree_estimate_probability_driver, /* execute */ NULL, /* sub */ NULL, /* next */ 0, /* static_pass_number */ -- cgit v1.2.1 From 0c297edc21c4ab6f2129cc25ed52772ad2f79a7b Mon Sep 17 00:00:00 2001 From: amylaar Date: Sun, 8 Nov 2009 21:10:08 +0000 Subject: * cfgrtl.c (pass_free_cfg): Add pass name. * cgraphbuild.c (pass_build_cgraph_edges): Likewise. (pass_rebuild_cgraph_edges, pass_remove_cgraph_callee_edges): Likewise. * dce.c (pass_ud_rtl_dce, pass_fast_rtl_dce): Change pass name. * df-core.c (pass_df_initialize_no_opt): Likewise. * except.c (pass_rtl_eh): Likewise. * function.c (pass_init_function, pass_leaf_regs): Likewise. * gcse.c (pass_rtl_pre): Change pass name. * passes.c (pass_postreload): Add pass name. (make_pass_instance): Don't use duplicate-tracking logic for names starting with '*'. (next_pass_1): Assert that pass has a name. (register_one_dump_file): If there is an space in the name, skip past it. * predict.c (pass_strip_predict_hints): Add pass name. * reg-stack.c (pass_stack_regs): Likewise. * stack-ptr-mod.c (pass_stack_ptr_mod): Likewise. * tree-cfg.c (pass_warn_function_return, pass_warn_function_noreturn): Add pass name. * tree-dfa.c (pass_referenced_vars): Likewise. * tree-optimize.c (pass_cleanup_cfg_post_optimizing): Fix whitespace before comment. (pass_fixup_cfg): Add pass name, fix whitespace before comment. (pass_init_datastructures): Add pass name. * tree-ssa-loop.c (pass_record_bounds): Likewise. * tree-ssa.c (pass_early_warn_uninitialized, pass_late_warn_uninitialized): Likewise. * tree.c (pass_ipa_free_lang_data): Likewise. * doc/passes.texi (pass manager): Document how to disambiguate pass names. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154013 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/predict.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/predict.c') diff --git a/gcc/predict.c b/gcc/predict.c index 6353fb96a56..becff10615b 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -2246,7 +2246,7 @@ struct gimple_opt_pass pass_strip_predict_hints = { { GIMPLE_PASS, - NULL, /* name */ + "*strip_predict_hints", /* name */ NULL, /* gate */ strip_predict_hints, /* execute */ NULL, /* sub */ -- cgit v1.2.1 From 63aab97df901f60f2e854e6ad3e7e47fd72e74ae Mon Sep 17 00:00:00 2001 From: hubicka Date: Wed, 18 Nov 2009 13:09:15 +0000 Subject: * predict.c (compute_function_frequency): Export. * predict.h (compute_function_frequency): Declare. * tree-optimize.c (execute_fixup_cfg): Rescale frequencies. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154291 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/predict.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gcc/predict.c') diff --git a/gcc/predict.c b/gcc/predict.c index becff10615b..df859066b96 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -77,7 +77,6 @@ static sreal real_zero, real_one, real_almost_one, real_br_prob_base, static void combine_predictions_for_insn (rtx, basic_block); static void dump_prediction (FILE *, enum br_predictor, int, basic_block, int); static void predict_paths_leading_to (basic_block, enum br_predictor, enum prediction); -static void compute_function_frequency (void); static void choose_function_section (void); static bool can_predict_insn_p (const_rtx); @@ -2145,7 +2144,7 @@ estimate_bb_frequencies (void) } /* Decide whether function is hot, cold or unlikely executed. */ -static void +void compute_function_frequency (void) { basic_block bb; -- cgit v1.2.1 From 5fce5299af4810e08744160f9387d11ef1623a94 Mon Sep 17 00:00:00 2001 From: hubicka Date: Mon, 23 Nov 2009 20:01:29 +0000 Subject: * ipa-cp.c (ipcp_compute_node_scale): Work around completely wrong profile updates. * predict.c (counts_to_freqs): Be expected for ENTRY/EXIT block having largest frequency. * ira-live.c (ira_implicitly_set_insn_hard_regs): Silecne used uninitalized warning. * tree-optimize.c (execute_fixup_cfg): Rescale entry and exit block frequencies. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154462 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/predict.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/predict.c') diff --git a/gcc/predict.c b/gcc/predict.c index df859066b96..058901e5903 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -2020,7 +2020,7 @@ counts_to_freqs (void) gcov_type count_max, true_count_max = 0; basic_block bb; - FOR_EACH_BB (bb) + FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb) true_count_max = MAX (bb->count, true_count_max); count_max = MAX (true_count_max, 1); -- cgit v1.2.1 From 48e1416a24d50cacbb2a5e06a9ee61dd8cbee313 Mon Sep 17 00:00:00 2001 From: hjl Date: Wed, 25 Nov 2009 10:55:54 +0000 Subject: Remove trailing white spaces. 2009-11-25 H.J. Lu * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154645 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/predict.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'gcc/predict.c') diff --git a/gcc/predict.c b/gcc/predict.c index 058901e5903..eb5ddef2e38 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -66,7 +66,7 @@ along with GCC; see the file COPYING3. If not see static sreal real_zero, real_one, real_almost_one, real_br_prob_base, real_inv_br_prob_base, real_one_half, real_bb_freq_max; -/* Random guesstimation given names. +/* Random guesstimation given names. PROV_VERY_UNLIKELY should be small enough so basic block predicted by it gets bellow HOT_BB_FREQUENCY_FRANCTION. */ #define PROB_VERY_UNLIKELY (REG_BR_PROB_BASE / 2000 - 1) @@ -386,7 +386,7 @@ gimple_predicted_by_p (const_basic_block bb, enum br_predictor predictor) if (!preds) return false; - + for (i = (struct edge_prediction *) *preds; i; i = i->ep_next) if (i->ep_predictor == predictor) return true; @@ -394,7 +394,7 @@ gimple_predicted_by_p (const_basic_block bb, enum br_predictor predictor) } /* Return true when the probability of edge is reliable. - + The profile guessing code is good at predicting branch outcome (ie. taken/not taken), that is predicted right slightly over 75% of time. It is however notoriously poor on predicting the probability itself. @@ -504,7 +504,7 @@ void remove_predictions_associated_with_edge (edge e) { void **preds; - + if (!bb_predictions) return; @@ -787,7 +787,7 @@ combine_predictions_for_bb (basic_block bb) first = e; } - /* When there is no successor or only one choice, prediction is easy. + /* When there is no successor or only one choice, prediction is easy. We are lazy for now and predict only basic blocks with two outgoing edges. It is possible to predict generic case too, but we have to @@ -836,7 +836,7 @@ combine_predictions_for_bb (basic_block bb) if (pred2->ep_edge != first) probability2 = REG_BR_PROB_BASE - probability2; - if ((probability < REG_BR_PROB_BASE / 2) != + if ((probability < REG_BR_PROB_BASE / 2) != (probability2 < REG_BR_PROB_BASE / 2)) break; @@ -1021,7 +1021,7 @@ predict_loops (void) EDGE_PROBABILITY_RELIABLE from trusting the branch prediction as this was causing regression in perl benchmark containing such a wide loop. */ - + int probability = ((REG_BR_PROB_BASE - predictor_info [(int) PRED_LOOP_EXIT].hitrate) / n_exits); @@ -1033,7 +1033,7 @@ predict_loops (void) predict_edge (e, PRED_LOOP_EXIT, probability); } } - + /* Free basic blocks from get_loop_body. */ free (bbs); } @@ -1262,10 +1262,10 @@ expr_expected_value_1 (tree type, tree op0, enum tree_code code, tree op1, bitma return NULL; } -/* Return constant EXPR will likely have at execution time, NULL if unknown. +/* Return constant EXPR will likely have at execution time, NULL if unknown. The function is used by builtin_expect branch predictor so the evidence must come from this construct and additional possible constant folding. - + We may want to implement more involved value guess (such as value range propagation based prediction), but such tricks shall go to new implementation. */ @@ -1931,11 +1931,11 @@ propagate_freq (basic_block head, bitmap tovisit) if (e) { sreal tmp; - + /* EDGE_INFO (e)->back_edge_prob = ((e->probability * BLOCK_INFO (bb)->frequency) / REG_BR_PROB_BASE); */ - + sreal_init (&tmp, e->probability, 0); sreal_mul (&tmp, &tmp, &BLOCK_INFO (bb)->frequency); sreal_mul (&EDGE_INFO (e)->back_edge_prob, @@ -1954,7 +1954,7 @@ propagate_freq (basic_block head, bitmap tovisit) nextbb = e->dest; else BLOCK_INFO (last)->next = e->dest; - + last = e->dest; } } @@ -2222,7 +2222,7 @@ predictor_name (enum br_predictor predictor) return predictor_info[predictor].name; } -struct gimple_opt_pass pass_profile = +struct gimple_opt_pass pass_profile = { { GIMPLE_PASS, @@ -2241,7 +2241,7 @@ struct gimple_opt_pass pass_profile = } }; -struct gimple_opt_pass pass_strip_predict_hints = +struct gimple_opt_pass pass_strip_predict_hints = { { GIMPLE_PASS, -- cgit v1.2.1 From 125b6d78d39ec6f18cab9f54a07d474e496920c8 Mon Sep 17 00:00:00 2001 From: hubicka Date: Mon, 26 Apr 2010 13:33:24 +0000 Subject: * cgraph.c (cgraph_create_node): Set node frequency to normal. (cgraph_clone_node): Copy function frequency. * cgraph.h (node_frequency): New enum (struct cgraph_node): Add. * final.c (rest_of_clean_state): Update. * lto-cgraph.c (lto_output_node): Output node frequency. (input_overwrite_node): Input node frequency. * tre-ssa-loop-ivopts (computation_cost): Update. * lto-streamer-out.c (output_function): Do not output function frequency. * predict.c (maybe_hot_frequency_p): Update and handle functions executed once. (cgraph_maybe_hot_edge_p): Likewise; use cgraph frequency instead of attribute lookup. (probably_never_executed_bb_p, optimize_function_for_size_p): Update. (compute_function_frequency): Set noreturn functions to be executed once. (choose_function_section): Update. * lto-streamer-in.c (input_function): Do not input function frequency. * function.c (allocate_struct_function): Do not initialize function frequency. * function.h (function_frequency): Remove. (struct function): Remove function frequency. * ipa-profile.c (CGRAPH_NODE_FREQUENCY): Remove. (try_update): Update. * tree-inline.c (initialize_cfun): Do not update function frequency. * passes.c (pass_init_dump_file): Update. * i386.c (ix86_compute_frame_layout): Update. (ix86_pad_returns): Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158732 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/predict.c | 50 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 15 deletions(-) (limited to 'gcc/predict.c') diff --git a/gcc/predict.c b/gcc/predict.c index eb5ddef2e38..29e0e2fcd99 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -113,15 +113,19 @@ static const struct predictor_info predictor_info[]= { static inline bool maybe_hot_frequency_p (int freq) { + struct cgraph_node *node = cgraph_node (current_function_decl); if (!profile_info || !flag_branch_probabilities) { - if (cfun->function_frequency == FUNCTION_FREQUENCY_UNLIKELY_EXECUTED) + if (node->frequency == NODE_FREQUENCY_UNLIKELY_EXECUTED) return false; - if (cfun->function_frequency == FUNCTION_FREQUENCY_HOT) + if (node->frequency == NODE_FREQUENCY_HOT) return true; } if (profile_status == PROFILE_ABSENT) return true; + if (node->frequency == NODE_FREQUENCY_EXECUTED_ONCE + && freq <= (ENTRY_BLOCK_PTR->frequency * 2 / 3)) + return false; if (freq < BB_FREQ_MAX / PARAM_VALUE (HOT_BB_FREQUENCY_FRACTION)) return false; return true; @@ -161,11 +165,16 @@ cgraph_maybe_hot_edge_p (struct cgraph_edge *edge) && (edge->count <= profile_info->sum_max / PARAM_VALUE (HOT_BB_COUNT_FRACTION))) return false; - if (lookup_attribute ("cold", DECL_ATTRIBUTES (edge->callee->decl)) - || lookup_attribute ("cold", DECL_ATTRIBUTES (edge->caller->decl))) + if (edge->caller->frequency == NODE_FREQUENCY_UNLIKELY_EXECUTED + || edge->callee->frequency == NODE_FREQUENCY_UNLIKELY_EXECUTED) + return false; + if (optimize_size) return false; - if (lookup_attribute ("hot", DECL_ATTRIBUTES (edge->caller->decl))) + if (edge->caller->frequency == NODE_FREQUENCY_HOT) return true; + if (edge->caller->frequency == NODE_FREQUENCY_EXECUTED_ONCE + && edge->frequency < CGRAPH_FREQ_BASE * 3 / 2) + return false; if (flag_guess_branch_prob && edge->frequency <= (CGRAPH_FREQ_BASE / PARAM_VALUE (HOT_BB_FREQUENCY_FRACTION))) @@ -191,7 +200,7 @@ probably_never_executed_bb_p (const_basic_block bb) if (profile_info && flag_branch_probabilities) return ((bb->count + profile_info->runs / 2) / profile_info->runs) == 0; if ((!profile_info || !flag_branch_probabilities) - && cfun->function_frequency == FUNCTION_FREQUENCY_UNLIKELY_EXECUTED) + && cgraph_node (current_function_decl)->frequency == NODE_FREQUENCY_UNLIKELY_EXECUTED) return true; return false; } @@ -202,8 +211,9 @@ bool optimize_function_for_size_p (struct function *fun) { return (optimize_size - || (fun && (fun->function_frequency - == FUNCTION_FREQUENCY_UNLIKELY_EXECUTED))); + || (fun && fun->decl + && (cgraph_node (fun->decl)->frequency + == NODE_FREQUENCY_UNLIKELY_EXECUTED))); } /* Return true when current function should always be optimized for speed. */ @@ -2148,27 +2158,36 @@ void compute_function_frequency (void) { basic_block bb; + struct cgraph_node *node = cgraph_node (current_function_decl); if (!profile_info || !flag_branch_probabilities) { + int flags = flags_from_decl_or_type (current_function_decl); if (lookup_attribute ("cold", DECL_ATTRIBUTES (current_function_decl)) != NULL) - cfun->function_frequency = FUNCTION_FREQUENCY_UNLIKELY_EXECUTED; + node->frequency = NODE_FREQUENCY_UNLIKELY_EXECUTED; else if (lookup_attribute ("hot", DECL_ATTRIBUTES (current_function_decl)) != NULL) - cfun->function_frequency = FUNCTION_FREQUENCY_HOT; + node->frequency = NODE_FREQUENCY_HOT; + else if (flags & ECF_NORETURN) + node->frequency = NODE_FREQUENCY_EXECUTED_ONCE; + else if (MAIN_NAME_P (DECL_NAME (current_function_decl))) + node->frequency = NODE_FREQUENCY_EXECUTED_ONCE; + else if (DECL_STATIC_CONSTRUCTOR (current_function_decl) + || DECL_STATIC_DESTRUCTOR (current_function_decl)) + node->frequency = NODE_FREQUENCY_EXECUTED_ONCE; return; } - cfun->function_frequency = FUNCTION_FREQUENCY_UNLIKELY_EXECUTED; + node->frequency = NODE_FREQUENCY_UNLIKELY_EXECUTED; FOR_EACH_BB (bb) { if (maybe_hot_bb_p (bb)) { - cfun->function_frequency = FUNCTION_FREQUENCY_HOT; + node->frequency = NODE_FREQUENCY_HOT; return; } if (!probably_never_executed_bb_p (bb)) - cfun->function_frequency = FUNCTION_FREQUENCY_NORMAL; + node->frequency = NODE_FREQUENCY_NORMAL; } } @@ -2176,6 +2195,7 @@ compute_function_frequency (void) static void choose_function_section (void) { + struct cgraph_node *node = cgraph_node (current_function_decl); if (DECL_SECTION_NAME (current_function_decl) || !targetm.have_named_sections /* Theoretically we can split the gnu.linkonce text section too, @@ -2191,10 +2211,10 @@ choose_function_section (void) if (flag_reorder_blocks_and_partition) return; - if (cfun->function_frequency == FUNCTION_FREQUENCY_HOT) + if (node->frequency == NODE_FREQUENCY_HOT) DECL_SECTION_NAME (current_function_decl) = build_string (strlen (HOT_TEXT_SECTION_NAME), HOT_TEXT_SECTION_NAME); - if (cfun->function_frequency == FUNCTION_FREQUENCY_UNLIKELY_EXECUTED) + if (node->frequency == NODE_FREQUENCY_UNLIKELY_EXECUTED) DECL_SECTION_NAME (current_function_decl) = build_string (strlen (UNLIKELY_EXECUTED_TEXT_SECTION_NAME), UNLIKELY_EXECUTED_TEXT_SECTION_NAME); -- cgit v1.2.1 From 7a936ef23d480f5883f4024e5d5ecf5a464528f3 Mon Sep 17 00:00:00 2001 From: hubicka Date: Sun, 30 May 2010 23:36:18 +0000 Subject: * predict.c (maybe_hot_edge_p): Calls to functions called once is cold. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160061 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/predict.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc/predict.c') diff --git a/gcc/predict.c b/gcc/predict.c index 29e0e2fcd99..1bccd4d2c26 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -168,6 +168,9 @@ cgraph_maybe_hot_edge_p (struct cgraph_edge *edge) if (edge->caller->frequency == NODE_FREQUENCY_UNLIKELY_EXECUTED || edge->callee->frequency == NODE_FREQUENCY_UNLIKELY_EXECUTED) return false; + if (edge->caller->frequency > NODE_FREQUENCY_UNLIKELY_EXECUTED + && edge->callee->frequency <= NODE_FREQUENCY_EXECUTED_ONCE) + return false; if (optimize_size) return false; if (edge->caller->frequency == NODE_FREQUENCY_HOT) -- cgit v1.2.1 From 555e8b05fce3ebfad73e482925e3fc55e8d2ae74 Mon Sep 17 00:00:00 2001 From: hubicka Date: Tue, 29 Jun 2010 14:14:15 +0000 Subject: * predict.c (propagate_freq): Clear EXIT_BLOCK_PTR frequency if it is unreachable. (rebuild_frequencies): New function. * predict.h (rebuild_frequencies): Declare. * tree-inline.c (copy_cfg_body): Compute properly count & frequency of entry block and edge reaching new_entry. (tree_function_versioning): When doing partial cloning, rebuild frequencies when done. * passes.c (execute_function_todo): Use rebild_frequencies. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161536 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/predict.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'gcc/predict.c') diff --git a/gcc/predict.c b/gcc/predict.c index 1bccd4d2c26..5d61140e4e6 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -1855,9 +1855,6 @@ propagate_freq (basic_block head, bitmap tovisit) edge_iterator ei; int count = 0; - /* The outermost "loop" includes the exit block, which we can not - look up via BASIC_BLOCK. Detect this and use EXIT_BLOCK_PTR - directly. Do the same for the entry block. */ bb = BASIC_BLOCK (i); FOR_EACH_EDGE (e, ei, bb->preds) @@ -1872,6 +1869,9 @@ propagate_freq (basic_block head, bitmap tovisit) e->src->index, bb->index); } BLOCK_INFO (bb)->npredecessors = count; + /* When function never returns, we will never process exit block. */ + if (!count && bb == EXIT_BLOCK_PTR) + bb->count = bb->frequency = 0; } memcpy (&BLOCK_INFO (head)->frequency, &real_one, sizeof (real_one)); @@ -2282,3 +2282,27 @@ struct gimple_opt_pass pass_strip_predict_hints = TODO_ggc_collect | TODO_verify_ssa /* todo_flags_finish */ } }; + +/* Rebuild function frequencies. Passes are in general expected to + maintain profile by hand, however in some cases this is not possible: + for example when inlining several functions with loops freuqencies might run + out of scale and thus needs to be recomputed. */ + +void +rebuild_frequencies (void) +{ + if (profile_status == PROFILE_GUESSED) + { + loop_optimizer_init (0); + add_noreturn_fake_exit_edges (); + mark_irreducible_loops (); + connect_infinite_loops_to_exit (); + estimate_bb_frequencies (); + remove_fake_exit_edges (); + loop_optimizer_finalize (); + } + else if (profile_status == PROFILE_READ) + counts_to_freqs (); + else + gcc_unreachable (); +} -- cgit v1.2.1 From f1d5a92b03feb7cd1d83397a7e2bab6d1ea8dde6 Mon Sep 17 00:00:00 2001 From: hubicka Date: Fri, 2 Jul 2010 09:39:54 +0000 Subject: PR middle-end/44706 * predict.c (predict_paths_for_bb): Handle case when control dependence BB has only abnormal edges. * g++.dg/tree-ssa/pr44706.C: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161691 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/predict.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'gcc/predict.c') diff --git a/gcc/predict.c b/gcc/predict.c index 5d61140e4e6..15d573b50a2 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -1786,8 +1786,33 @@ predict_paths_for_bb (basic_block cur, basic_block bb, if (e->src->index >= NUM_FIXED_BLOCKS && !dominated_by_p (CDI_POST_DOMINATORS, e->src, bb)) { + edge e2; + edge_iterator ei2; + bool found = false; + + /* Ignore abnormals, we predict them as not taken anyway. */ + if (e->flags & (EDGE_EH | EDGE_FAKE | EDGE_ABNORMAL)) + continue; gcc_assert (bb == cur || dominated_by_p (CDI_POST_DOMINATORS, cur, bb)); - predict_edge_def (e, pred, taken); + + /* See if there is how many edge from e->src that is not abnormal + and does not lead to BB. */ + FOR_EACH_EDGE (e2, ei2, e->src->succs) + if (e2 != e + && !(e2->flags & (EDGE_EH | EDGE_FAKE | EDGE_ABNORMAL)) + && !dominated_by_p (CDI_POST_DOMINATORS, e2->dest, bb)) + { + found = true; + break; + } + + /* If there is non-abnormal path leaving e->src, predict edge + using predictor. Otherwise we need to look for paths + leading to e->src. */ + if (found) + predict_edge_def (e, pred, taken); + else + predict_paths_for_bb (e->src, e->src, pred, taken); } for (son = first_dom_son (CDI_POST_DOMINATORS, cur); son; -- cgit v1.2.1 From 0b205f4ca112a643f4f1b9c9886648b569e0b380 Mon Sep 17 00:00:00 2001 From: manu Date: Thu, 8 Jul 2010 04:22:54 +0000 Subject: =?UTF-8?q?2010-07-08=20=20Manuel=20L=C3=B3pez-Ib=C3=A1=C3=B1ez=20?= =?UTF-8?q?=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * toplev.h: Do not include diagnostic-core.h. Include diagnostic-core.h in every file that includes toplev.h. * c-tree.h: Do not include toplev.h. * pretty-print.h: Update comment. * Makefile.in: Update dependencies. * alias.c: Include diagnostic-core.h in every file that includes toplev.h. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgbuild.c: Likewise. * cfgcleanup.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * combine.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arc/arc.c: Likewise. * config/arm/arm.c: Likewise. * config/arm/pe.c: Likewise. * config/avr/avr.c: Likewise. * config/bfin/bfin.c: Likewise. * config/cris/cris.c: Likewise. * config/crx/crx.c: Likewise. * config/darwin-c.c: Likewise. * config/darwin.c: Likewise. * config/fr30/fr30.c: Likewise. * config/frv/frv.c: Likewise. * config/h8300/h8300.c: Likewise. * config/host-darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/netware.c: Likewise. * config/i386/nwld.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/i386/winnt-stubs.c: Likewise. * config/i386/winnt.c: Likewise. * config/ia64/ia64-c.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/lm32/lm32.c: Likewise. * config/m32c/m32c-pragma.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32r/m32r.c: Likewise. * config/m68hc11/m68hc11.c: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.c: Likewise. * config/mep/mep-pragma.c: Likewise. * config/mep/mep.c: Likewise. * config/mmix/mmix.c: Likewise. * config/mn10300/mn10300.c: Likewise. * config/moxie/moxie.c: Likewise. * config/pa/pa.c: Likewise. * config/pdp11/pdp11.c: Likewise. * config/picochip/picochip.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/s390/s390.c: Likewise. * config/score/score.c: Likewise. * config/score/score3.c: Likewise. * config/score/score7.c: Likewise. * config/sh/sh.c: Likewise. * config/sh/symbian-base.c: Likewise. * config/sh/symbian-c.c: Likewise. * config/sh/symbian-cxx.c: Likewise. * config/sol2-c.c: Likewise. * config/sol2.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/v850/v850-c.c: Likewise. * config/v850/v850.c: Likewise. * config/vax/vax.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. * convert.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbxout.c: Likewise. * ddg.c: Likewise. * dominance.c: Likewise. * emit-rtl.c: Likewise. * explow.c: Likewise. * expmed.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * fwprop.c: Likewise. * gcse.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * gimple-low.c: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * implicit-zee.c: Likewise. * integrate.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-iv.c: Likewise. * lto-opts.c: Likewise. * lto-symtab.c: Likewise. * main.c: Likewise. * modulo-sched.c: Likewise. * optabs.c: Likewise. * params.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * profile.c: Likewise. * real.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtlanal.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-rgn.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * simplify-rtx.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * targhooks.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-inline.c: Likewise. * tree-nomudflap.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-phinodes.c: Likewise. * tree-profile.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vrp.c: Likewise. * varasm.c: Likewise. * vec.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. c-family/ * c-common.h: Include diagnostic-core.h. Error if already included. * c-semantics.c: Do not define GCC_DIAG_STYLE here. cp/ * cp-tree.h: Do not include toplev.h. java/ * boehm.c: Include diagnostic-core.h in every file that includes toplev.h. * class.c: Likewise. * constants.c: Likewise. * decl.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * jcf-parse.c: Likewise. * mangle.c: Likewise. * mangle_name.c: Likewise. * resource.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. ada/ * gcc-interface/utils.c: Include diagnostic-core.h in every file that includes toplev.h. lto/ * lto-coff.c: Include diagnostic-core.h in every file that includes toplev.h. * lto-elf.c: Likewise. * lto-lang.c: Likewise. * lto-macho.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161943 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/predict.c | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/predict.c') diff --git a/gcc/predict.c b/gcc/predict.c index 15d573b50a2..b881a64401e 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -43,6 +43,7 @@ along with GCC; see the file COPYING3. If not see #include "output.h" #include "function.h" #include "except.h" +#include "diagnostic-core.h" #include "toplev.h" #include "recog.h" #include "expr.h" -- cgit v1.2.1