diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2017-12-16 17:01:26 +0100 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2017-12-16 09:01:26 -0700 |
commit | a9007865750a9c7698d7bcfd015c4006dae611c5 (patch) | |
tree | a6bec15d431dc80952b2f43a40969c3df0f3fe6a /gcc | |
parent | b4d43553e9353de4fefb3a1fde1277eeb1bad7be (diff) | |
download | gcc-a9007865750a9c7698d7bcfd015c4006dae611c5.zip gcc-a9007865750a9c7698d7bcfd015c4006dae611c5.tar.gz gcc-a9007865750a9c7698d7bcfd015c4006dae611c5.tar.bz2 |
re PR rtl-optimization/82849 (ICE on valid code since r254379)
2017-12-16 Jan Hubicka <hubicka@ucw.cz>
PR rtl-optimization/82849
* modulo-sched.c (sms_schedule): Use get_estimated_loop_iterations_int
and get_max_loop_iterations_int.
From-SVN: r255748
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/modulo-sched.c | 22 |
2 files changed, 17 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8124e61..b15d84d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-12-16 Jan Hubicka <hubicka@ucw.cz> + + PR rtl-optimization/82849 + * modulo-sched.c (sms_schedule): Use get_estimated_loop_iterations_int + and get_max_loop_iterations_int. + 2017-12-16 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> diff --git a/gcc/modulo-sched.c b/gcc/modulo-sched.c index 71b2a61..d02f23f 100644 --- a/gcc/modulo-sched.c +++ b/gcc/modulo-sched.c @@ -1346,7 +1346,7 @@ sms_schedule (void) struct loop *loop; basic_block condition_bb = NULL; edge latch_edge; - gcov_type trip_count = 0; + HOST_WIDE_INT trip_count, max_trip_count; loop_optimizer_init (LOOPS_HAVE_PREHEADERS | LOOPS_HAVE_RECORDED_EXITS); @@ -1422,9 +1422,8 @@ sms_schedule (void) get_ebb_head_tail (bb, bb, &head, &tail); latch_edge = loop_latch_edge (loop); gcc_assert (single_exit (loop)); - if (single_exit (loop)->count () > profile_count::zero ()) - trip_count = latch_edge->count ().to_gcov_type () - / single_exit (loop)->count ().to_gcov_type (); + trip_count = get_estimated_loop_iterations_int (loop); + max_trip_count = get_max_loop_iterations_int (loop); /* Perform SMS only on loops that their average count is above threshold. */ @@ -1444,8 +1443,8 @@ sms_schedule (void) (int64_t) bb->count.to_gcov_type ()); fprintf (dump_file, "\n"); fprintf (dump_file, "SMS trip-count "); - fprintf (dump_file, "%" PRId64, - (int64_t) trip_count); + fprintf (dump_file, "%" PRId64 "max %" PRId64, + (int64_t) trip_count, (int64_t) max_trip_count); fprintf (dump_file, "\n"); fprintf (dump_file, "SMS profile-sum-max "); fprintf (dump_file, "%" PRId64, @@ -1552,9 +1551,8 @@ sms_schedule (void) latch_edge = loop_latch_edge (loop); gcc_assert (single_exit (loop)); - if (single_exit (loop)->count ()> profile_count::zero ()) - trip_count = latch_edge->count ().to_gcov_type () - / single_exit (loop)->count ().to_gcov_type (); + trip_count = get_estimated_loop_iterations_int (loop); + max_trip_count = get_max_loop_iterations_int (loop); if (dump_file) { @@ -1648,7 +1646,8 @@ sms_schedule (void) we let the scheduling passes do the job in this case. */ if (stage_count < PARAM_VALUE (PARAM_SMS_MIN_SC) || (count_init && (loop_count <= stage_count)) - || (flag_branch_probabilities && (trip_count <= stage_count))) + || (max_trip_count >= 0 && max_trip_count <= stage_count) + || (trip_count >= 0 && trip_count <= stage_count)) { if (dump_file) { @@ -1657,7 +1656,8 @@ sms_schedule (void) " loop-count=", stage_count); fprintf (dump_file, "%" PRId64, loop_count); fprintf (dump_file, ", trip-count="); - fprintf (dump_file, "%" PRId64, trip_count); + fprintf (dump_file, "%" PRId64 "max %" PRId64, + (int64_t) trip_count, (int64_t) max_trip_count); fprintf (dump_file, ")\n"); } break; |