summaryrefslogtreecommitdiff
path: root/gcc/modulo-sched.c
diff options
context:
space:
mode:
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-03 02:29:00 +0000
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-03 02:29:00 +0000
commit7cef6c97cbe9575d82af3934ba9db98706d40dbd (patch)
tree65c401413cfba6d2049e2a002755074729d4e079 /gcc/modulo-sched.c
parentf517b36eec084c177098f54c4755ab7222fb7e2f (diff)
downloadgcc-7cef6c97cbe9575d82af3934ba9db98706d40dbd.tar.gz
* loop-unswitch.c (unswitch_loop): Pass probabilities to loopify.
* tree-ssa-loop-unswitch.c (tree_unswitch_loop): Pass probabilities to loop_version. * cfgloopmanip.c (scale_loop_frequencies): Export. (loopify): Scale the frequencies by prescribed coefficients. (set_zero_probability): New function. (duplicate_loop_to_header_edge): Improve updating of frequencies. (lv_adjust_loop_entry_edge, loop_version): Set probabilities and frequencies according to arguments. * tree-ssa-loop-manip.c (tree_unroll_loop): Set probabilities correctly. * cfg.c (scale_bbs_frequencies_int): Allow scaling the frequencies up. * modulo-sched.c (sms_schedule): Set probabilities for entering versioned loop correctly. * tree-vect-transform.c (vect_transform_loop): Ditto. * cfgloop.h (loopify, loop_version): Declaration changed. (scale_loop_frequencies): Declared. * gcc.dg/tree-ssa/update-unroll-1.c: New test. * gcc.dg/tree-ssa/update-unswitch-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120378 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/modulo-sched.c')
-rw-r--r--gcc/modulo-sched.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/modulo-sched.c b/gcc/modulo-sched.c
index 3352e20adcd..93f5b9a120b 100644
--- a/gcc/modulo-sched.c
+++ b/gcc/modulo-sched.c
@@ -868,6 +868,10 @@ canon_loop (struct loop *loop)
}
}
+/* Probability in % that the sms-ed loop rolls enough so that optimized
+ version may be entered. Just a guess. */
+#define PROB_SMS_ENOUGH_ITERATIONS 80
+
/* Main entry point, perform SMS scheduling on the loops of the function
that consist of single basic blocks. */
static void
@@ -882,7 +886,7 @@ sms_schedule (void)
partial_schedule_ptr ps;
struct df *df;
basic_block bb = NULL;
- struct loop *loop, *nloop;
+ struct loop *loop;
basic_block condition_bb = NULL;
edge latch_edge;
gcov_type trip_count = 0;
@@ -1181,8 +1185,12 @@ sms_schedule (void)
{
rtx comp_rtx = gen_rtx_fmt_ee (GT, VOIDmode, count_reg,
GEN_INT(stage_count));
+ unsigned prob = (PROB_SMS_ENOUGH_ITERATIONS
+ * REG_BR_PROB_BASE) / 100;
- nloop = loop_version (loop, comp_rtx, &condition_bb, true);
+ loop_version (loop, comp_rtx, &condition_bb,
+ prob, prob, REG_BR_PROB_BASE - prob,
+ true);
}
/* Set new iteration count of loop kernel. */