summaryrefslogtreecommitdiff
path: root/gcc/unroll.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2001-06-18 15:35:47 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2001-06-18 15:35:47 +0000
commitf6664feec514b2e3b3f36fb59c9b1b14dc5a52fc (patch)
tree0803743d2349ea46ce205c05df7cae76a3374b1f /gcc/unroll.c
parent55af5e57a6fa3e4016d3723e03c3a1926ea9e9ee (diff)
downloadgcc-f6664feec514b2e3b3f36fb59c9b1b14dc5a52fc.tar.gz
* unroll.c: Include predict.h.
(unroll_loop): Drop prediction notes on preconditioning. * predict.def (PRED_LOOP_PRECONDITIONG, PRED_LOOP_CONDITION): New; add comments on the others. * Makefile.in: (unroll.o): Add dependancy on predict.h. * loop.c (strength_reduce): Fix branch prediction. * stmt.c (emit_case_nodes): Optimize test whether index is in given interval. * predict.c (estimate_probability): Do not bail out early when note is present. (combine_predictions_for_insn): Fix note removal code. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43441 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/unroll.c')
-rw-r--r--gcc/unroll.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/unroll.c b/gcc/unroll.c
index 94c58cd925c..9a09f5d3d3e 100644
--- a/gcc/unroll.c
+++ b/gcc/unroll.c
@@ -167,6 +167,7 @@ enum unroll_types
#include "toplev.h"
#include "hard-reg-set.h"
#include "basic-block.h"
+#include "predict.h"
/* This controls which loops are unrolled, and by how much we unroll
them. */
@@ -962,6 +963,7 @@ unroll_loop (loop, insn_count, strength_reduce_p)
emit_cmp_and_jump_insns (initial_value, final_value,
neg_inc ? LE : GE,
NULL_RTX, mode, 0, 0, labels[1]);
+ predict_insn_def (get_last_insn (), PRED_LOOP_CONDITION, NOT_TAKEN);
JUMP_LABEL (get_last_insn ()) = labels[1];
LABEL_NUSES (labels[1])++;
}
@@ -1007,6 +1009,8 @@ unroll_loop (loop, insn_count, strength_reduce_p)
labels[i]);
JUMP_LABEL (get_last_insn ()) = labels[i];
LABEL_NUSES (labels[i])++;
+ predict_insn (get_last_insn (), PRED_LOOP_PRECONDITIONING,
+ REG_BR_PROB_BASE / (unroll_number - i));
}
/* If the increment is greater than one, then we need another branch,