diff mbox

[GOOGLE] Remove size check when loop is very hot

Message ID CAO2gOZV1DYRb3p7ZNr=gkabWDm_dBxYHsfJ-VnwQm_SLxrgT9g@mail.gmail.com
State New
Headers show

Commit Message

Dehao Chen Feb. 28, 2014, 10:17 p.m. UTC
This patch removes the size limit for loop unroll/peel when the loop
is truly hot. This makes the implementation easily maintanable between
FDO and AutoFDO.

Bootstrapped and loadtest perf show neutral impact.

OK for google-4_8?

Thanks,
Dehao

       /* When the profile count sum to loop entry header ratio is smaller than

Comments

Teresa Johnson Feb. 28, 2014, 10:20 p.m. UTC | #1
Looks good to me.
Thanks, Teresa

On Fri, Feb 28, 2014 at 2:17 PM, Dehao Chen <dehao@google.com> wrote:
> This patch removes the size limit for loop unroll/peel when the loop
> is truly hot. This makes the implementation easily maintanable between
> FDO and AutoFDO.
>
> Bootstrapped and loadtest perf show neutral impact.
>
> OK for google-4_8?
>
> Thanks,
> Dehao
>
> Index: gcc/loop-unroll.c
> ===================================================================
> --- gcc/loop-unroll.c (revision 208233)
> +++ gcc/loop-unroll.c (working copy)
> @@ -347,11 +347,9 @@ code_size_limit_factor(struct loop *loop)
>    /* Next, set the value of the codesize-based unroll factor divisor which in
>       most loops will need to be set to a value that will reduce or eliminate
>       unrolling/peeling.  */
> -  if (num_hot_counters < size_threshold * 2
> -      && loop->header->count > 0)
> +  if (loop->header->count > 0)
>      {
> -      /* For applications that are less than twice the codesize limit, allow
> -         limited unrolling for very hot loops.  */
> +      /* Allow limited unrolling for very hot loops.  */
>        sum_to_header_ratio = profile_info->sum_all / loop->header->count;
>        hotness_ratio_threshold = PARAM_VALUE
> (PARAM_UNROLLPEEL_HOTNESS_THRESHOLD);
>        /* When the profile count sum to loop entry header ratio is smaller than
diff mbox

Patch

Index: gcc/loop-unroll.c
===================================================================
--- gcc/loop-unroll.c (revision 208233)
+++ gcc/loop-unroll.c (working copy)
@@ -347,11 +347,9 @@  code_size_limit_factor(struct loop *loop)
   /* Next, set the value of the codesize-based unroll factor divisor which in
      most loops will need to be set to a value that will reduce or eliminate
      unrolling/peeling.  */
-  if (num_hot_counters < size_threshold * 2
-      && loop->header->count > 0)
+  if (loop->header->count > 0)
     {
-      /* For applications that are less than twice the codesize limit, allow
-         limited unrolling for very hot loops.  */
+      /* Allow limited unrolling for very hot loops.  */
       sum_to_header_ratio = profile_info->sum_all / loop->header->count;
       hotness_ratio_threshold = PARAM_VALUE
(PARAM_UNROLLPEEL_HOTNESS_THRESHOLD);