Commit 59ced947 by Rafael Ávila de Espíndola Committed by Gabriel Dos Reis

tree-flow.h: Allow compilation with a C++ compiler.

2005-12-11 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>

        * tree-flow.h: Allow compilation with a C++ compiler.
        (struct edge_prediction): Prefix all field names  with "ep_".
        * predict.c (tree_predicted_by_p): Likewise for struct
        edge_prediction.
        (tree_predict_edge, combine_predictions_for_bb): Likewise.
        (remove_predictions_associated_with_edge): Likewise.

From-SVN: r108430
parent d33df7e1
2005-12-11 Rafael vila de Espndola <rafael.espindola@gmail.com>
* tree-flow.h: Allow compilation with a C++ compiler.
(struct edge_prediction): Prefix all field names with "ep_".
* predict.c (tree_predicted_by_p): Likewise for struct edge_prediction.
(tree_predict_edge, combine_predictions_for_bb): Likewise.
(remove_predictions_associated_with_edge): Likewise.
2005-12-12 Jeff Law <law@redhat.com> 2005-12-12 Jeff Law <law@redhat.com>
* tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Remove * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Remove
......
...@@ -172,8 +172,8 @@ bool ...@@ -172,8 +172,8 @@ bool
tree_predicted_by_p (basic_block bb, enum br_predictor predictor) tree_predicted_by_p (basic_block bb, enum br_predictor predictor)
{ {
struct edge_prediction *i; struct edge_prediction *i;
for (i = bb->predictions; i; i = i->next) for (i = bb->predictions; i; i = i->ep_next)
if (i->predictor == predictor) if (i->ep_predictor == predictor)
return true; return true;
return false; return false;
} }
...@@ -237,11 +237,11 @@ tree_predict_edge (edge e, enum br_predictor predictor, int probability) ...@@ -237,11 +237,11 @@ tree_predict_edge (edge e, enum br_predictor predictor, int probability)
{ {
struct edge_prediction *i = ggc_alloc (sizeof (struct edge_prediction)); struct edge_prediction *i = ggc_alloc (sizeof (struct edge_prediction));
i->next = e->src->predictions; i->ep_next = e->src->predictions;
e->src->predictions = i; e->src->predictions = i;
i->probability = probability; i->ep_probability = probability;
i->predictor = predictor; i->ep_predictor = predictor;
i->edge = e; i->ep_edge = e;
} }
} }
...@@ -255,10 +255,10 @@ remove_predictions_associated_with_edge (edge e) ...@@ -255,10 +255,10 @@ remove_predictions_associated_with_edge (edge e)
struct edge_prediction **prediction = &e->src->predictions; struct edge_prediction **prediction = &e->src->predictions;
while (*prediction) while (*prediction)
{ {
if ((*prediction)->edge == e) if ((*prediction)->ep_edge == e)
*prediction = (*prediction)->next; *prediction = (*prediction)->ep_next;
else else
prediction = &((*prediction)->next); prediction = &((*prediction)->ep_next);
} }
} }
} }
...@@ -523,12 +523,12 @@ combine_predictions_for_bb (FILE *file, basic_block bb) ...@@ -523,12 +523,12 @@ combine_predictions_for_bb (FILE *file, basic_block bb)
/* We implement "first match" heuristics and use probability guessed /* We implement "first match" heuristics and use probability guessed
by predictor with smallest index. */ by predictor with smallest index. */
for (pred = bb->predictions; pred; pred = pred->next) for (pred = bb->predictions; pred; pred = pred->ep_next)
{ {
int predictor = pred->predictor; int predictor = pred->ep_predictor;
int probability = pred->probability; int probability = pred->ep_probability;
if (pred->edge != first) if (pred->ep_edge != first)
probability = REG_BR_PROB_BASE - probability; probability = REG_BR_PROB_BASE - probability;
found = true; found = true;
...@@ -569,12 +569,12 @@ combine_predictions_for_bb (FILE *file, basic_block bb) ...@@ -569,12 +569,12 @@ combine_predictions_for_bb (FILE *file, basic_block bb)
combined_probability = best_probability; combined_probability = best_probability;
dump_prediction (file, PRED_COMBINED, combined_probability, bb, true); dump_prediction (file, PRED_COMBINED, combined_probability, bb, true);
for (pred = bb->predictions; pred; pred = pred->next) for (pred = bb->predictions; pred; pred = pred->ep_next)
{ {
int predictor = pred->predictor; int predictor = pred->ep_predictor;
int probability = pred->probability; int probability = pred->ep_probability;
if (pred->edge != EDGE_SUCC (bb, 0)) if (pred->ep_edge != EDGE_SUCC (bb, 0))
probability = REG_BR_PROB_BASE - probability; probability = REG_BR_PROB_BASE - probability;
dump_prediction (file, predictor, probability, bb, dump_prediction (file, predictor, probability, bb,
!first_match || best_predictor == predictor); !first_match || best_predictor == predictor);
......
...@@ -333,12 +333,12 @@ static inline tree default_def (tree); ...@@ -333,12 +333,12 @@ static inline tree default_def (tree);
/*--------------------------------------------------------------------------- /*---------------------------------------------------------------------------
Structure representing predictions in tree level. Structure representing predictions in tree level.
---------------------------------------------------------------------------*/ ---------------------------------------------------------------------------*/
struct edge_prediction GTY((chain_next ("%h.next"))) struct edge_prediction GTY((chain_next ("%h.ep_next")))
{ {
struct edge_prediction *next; struct edge_prediction *ep_next;
edge edge; edge ep_edge;
enum br_predictor predictor; enum br_predictor ep_predictor;
int probability; int ep_probability;
}; };
/* Accessors for basic block annotations. */ /* Accessors for basic block annotations. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment