This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Branch prediction infrastructure
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Diego Novillo <dnovillo at redhat dot com>
- Cc: Jan Hubicka <jh at suse dot cz>,"gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>,Richard Henderson <rth at redhat dot com>
- Date: Mon, 12 Jan 2004 17:53:06 +0100
- Subject: Re: [tree-ssa] Branch prediction infrastructure
- References: <20031223120311.GO17542@kam.mff.cuni.cz> <1073925967.13988.163.camel@frodo.toronto.redhat.com>
> On Tue, 2003-12-23 at 07:03, Jan Hubicka wrote:
>
> > * basic-block.h: Include predict.h
> > (tree_predicted_by_p, rtl_predicted_by_p, rtl_predict_edge,
> > predict_edge_def): Declare.
> > * cfghooks.h (cfg_hooks): add predict_edge and predicted_by_p
> > (predict_edge, predicted_by_p): New macros.
> > * cfgrtl (rtl_cfg_hooks, cfg_layout_rtl_cfg_hook): Add new hooks.
> > * cse.c (struct cse_basic_block_data): Rename enum values to not
> > conflict with profile.h; update all uses.
> > * predict.c: Include tree-flow.h, ggc.h, tree-dump.h
> > (predicted_by_p): Rename to ...
> > (rtl_predicted_by_p): .. this one; make global
> > (tree_predicted_by_p): New.
> > (dump_prediction): Add FILE argument.
> > (predict_edge): Rename to ...
> > (rtl_predict_edge): .. this one.
> > (tree_predict_edge): New.
> > (combine_predictions_for_insn): Update calls of predict_edge.
> > (predict_loops): Break out from ...
> > (estimate_probability): ... here; update comments; move updating
> > of unknown probabilities from ...
> > (estimate_bb_frequencies): ... here.
> > (combine_predictions_for_bb): New.
> > (tree_predict_by_opcode): New.
> > (tree_estimate_probability): New.
> > * predict.def (PRED_TREE_POINTER, PRED_TREE_OPCODE_POSITIVE,
> > PRED_TREE_OPCODE_NONEQUAL, PRED_TREE_FPOPCODE): New predictors.
> > * predict.h: Add include guard.
> > (predict_edge, predict_edge_def): Move prototypes to basic_block.h
> > * tree-cfg.c (tree_cfg_hooks): Add prediction hooks.
> > * tree-dump.c (dump_files): Add profile.
> > * tree-flow.h (struct edge_prediction): New structure.
> > (struct bb_ann_d): Add field predictions.
> > (tree_estimate_probability): Declare.
> > * tree-optimize.c (optimize_function_tree): Call tree_estimate_probability.
> > * tree.h (tree_dump_index): Add TDI_profile.
> >
> Looks OK, I guess (minor changes below).
>
> Now, what's the plan wrt exporting the predictors to RTL? Have we
> settled on that already?
You mean the profile? (the predictions don't neccesairly need to be
preserved as they can be re-done at RTL without problems)
I promised to wait for Andrew's vacation ideas and he didn't returned
yet, so I am holding the patch. I still hope that the CFG trnasparent
expansion will be accepted. From last thread starting at:
http://gcc.gnu.org/ml/gcc-patches/2003-12/msg01657.html
it seems that we seem to be able to use the CFG during expansion for
other goals too.
Thanks!
Honza