summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-03 19:03:29 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-03 19:03:29 +0000
commit631fa7dec48a8cd25753636d5990b8a131f01452 (patch)
treedccec4c166610579fbf93533c4da6b37727bb546 /gcc
parent2507e5d0fba65ec9d40cfa20c7d3cbc77fbacf4a (diff)
downloadgcc-631fa7dec48a8cd25753636d5990b8a131f01452.tar.gz
* basic-block.h (remove_predictions_associated_with_edge): Declare.
* cfg.c (remove_edge): Use it. * predict.c (remove_predictions_associated_with_edge): New function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100551 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/basic-block.h1
-rw-r--r--gcc/cfg.c1
-rw-r--r--gcc/predict.c18
4 files changed, 26 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 22136dd307b..77123888e64 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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):
diff --git a/gcc/basic-block.h b/gcc/basic-block.h
index ad89fa5b69e..5c033dfbd4b 100644
--- a/gcc/basic-block.h
+++ b/gcc/basic-block.h
@@ -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);
diff --git a/gcc/cfg.c b/gcc/cfg.c
index c1cf389e69f..e842a508346 100644
--- 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);
diff --git a/gcc/predict.c b/gcc/predict.c
index 25f97f707a6..8ca44f69093 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -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. */