This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [GOOGLE] Remove size check when loop is very hot
- From: Teresa Johnson <tejohnson at google dot com>
- To: Dehao Chen <dehao at google dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, David Li <davidxl at google dot com>
- Date: Fri, 28 Feb 2014 14:20:19 -0800
- Subject: Re: [GOOGLE] Remove size check when loop is very hot
- Authentication-results: sourceware.org; auth=none
- References: <CAO2gOZV1DYRb3p7ZNr=gkabWDm_dBxYHsfJ-VnwQm_SLxrgT9g at mail dot gmail dot com>
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
--
Teresa Johnson | Software Engineer | tejohnson@google.com | 408-460-2413