basic-block.h (remove_predictions_associated_with_edge): Declare.
authorJan Hubicka <jh@suse.cz>
Fri, 3 Jun 2005 19:03:29 +0000 (21:03 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Fri, 3 Jun 2005 19:03:29 +0000 (19:03 +0000)
* basic-block.h (remove_predictions_associated_with_edge): Declare.
* cfg.c (remove_edge): Use it.
* predict.c (remove_predictions_associated_with_edge): New function.

From-SVN: r100551

gcc/ChangeLog
gcc/basic-block.h
gcc/cfg.c
gcc/predict.c

index 22136dd307b162c4a7a2c2f970105a97ac0581ab..77123888e64d19dc2cc834be3d3088cc9e3ecb0c 100644 (file)
@@ -1,3 +1,9 @@
+2005-06-03  Jan Hubicka  <jh@suse.cz>
+
+       * basic-block.h (remove_predictions_associated_with_edge): Declare.
+       * cfg.c (remove_edge): Use it.
+       * predict.c (remove_predictions_associated_with_edge): New function.
+
 2005-06-03  Pat Haugen  <pthaugen@us.ibm.com>
 
        * config/rs6000/rs6000.c (rs6000_conditional_register_usage):
index ad89fa5b69e43aa50e3c3d9ad31286022db958e9..5c033dfbd4bedb5d732eb28957c496fb099b771d 100644 (file)
@@ -869,6 +869,7 @@ extern void tree_predict_edge (edge, enum br_predictor, int);
 extern void rtl_predict_edge (edge, enum br_predictor, int);
 extern void predict_edge_def (edge, enum br_predictor, enum prediction);
 extern void guess_outgoing_edge_probabilities (basic_block);
+extern void remove_predictions_associated_with_edge (edge);
 
 /* In flow.c */
 extern void init_flow (void);
index c1cf389e69f5e94462d4bb95089a3d197dbb1624..e842a5083467182e43898ddde9675404301b0cff 100644 (file)
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -349,6 +349,7 @@ make_single_succ_edge (basic_block src, basic_block dest, int flags)
 void
 remove_edge (edge e)
 {
+  remove_predictions_associated_with_edge (e);
   execute_on_shrinking_pred (e);
 
   disconnect_src (e);
index 25f97f707a669e55f7e3bc555dd3850cfc4a2ff2..8ca44f69093028d5114f767282fab72c13a5e0ff 100644 (file)
@@ -240,6 +240,24 @@ tree_predict_edge (edge e, enum br_predictor predictor, int probability)
   i->edge = e;
 }
 
+/* Remove all predictions on given basic block that are attached
+   to edge E.  */
+void
+remove_predictions_associated_with_edge (edge e)
+{
+  if (e->src->predictions)
+    {
+      struct edge_prediction **prediction = &e->src->predictions;
+      while (*prediction)
+       {
+         if ((*prediction)->edge == e)
+           *prediction = (*prediction)->next;
+         else
+           prediction = &((*prediction)->next);
+       }
+    }
+}
+
 /* Return true when we can store prediction on insn INSN.
    At the moment we represent predictions only on conditional
    jumps, not at computed jump or other complicated cases.  */