Patchwork [GOOGLE] don't overwrite precomputed loop bound in AutoFDO

login
register
mail settings
Submitter Dehao Chen
Date Jan. 17, 2014, 5:08 p.m.
Message ID <CAO2gOZVBb=9+SuhKW1rU9pwjejcEg1J4AHRO1EHAPPcx2KQEGw@mail.gmail.com>
Download mbox | patch
Permalink /patch/312154/
State New
Headers show

Comments

Dehao Chen - Jan. 17, 2014, 5:08 p.m.
If a loop is cunrolled/vectorized, the AutoFDO computed trip count
will be very small. This patch disallows overwritting of precomputed
loop bound in AutoFDO mode.

Bootstrapped and passed regression test. Performance test on-going.

OK for Google branches?

Thanks,
Dehao
Xinliang David Li - Jan. 17, 2014, 5:21 p.m.
Ok.

David

On Fri, Jan 17, 2014 at 9:08 AM, Dehao Chen <dehao@google.com> wrote:
> If a loop is cunrolled/vectorized, the AutoFDO computed trip count
> will be very small. This patch disallows overwritting of precomputed
> loop bound in AutoFDO mode.
>
> Bootstrapped and passed regression test. Performance test on-going.
>
> OK for Google branches?
>
> Thanks,
> Dehao
>
> Index: tree-ssa-loop-niter.c
> ===================================================================
> --- tree-ssa-loop-niter.c (revision 206674)
> +++ tree-ssa-loop-niter.c (working copy)
> @@ -2520,7 +2520,8 @@ record_niter_bound (struct loop *loop, double_int
>      }
>    if (realistic
>        && (!loop->any_estimate
> -  || i_bound.ult (loop->nb_iterations_estimate)))
> +  || (!flag_auto_profile &&
> +      i_bound.ult (loop->nb_iterations_estimate))))
>      {
>        loop->any_estimate = true;
>        loop->nb_iterations_estimate = i_bound;

Patch

Index: tree-ssa-loop-niter.c
===================================================================
--- tree-ssa-loop-niter.c (revision 206674)
+++ tree-ssa-loop-niter.c (working copy)
@@ -2520,7 +2520,8 @@  record_niter_bound (struct loop *loop, double_int
     }
   if (realistic
       && (!loop->any_estimate
-  || i_bound.ult (loop->nb_iterations_estimate)))
+  || (!flag_auto_profile &&
+      i_bound.ult (loop->nb_iterations_estimate))))
     {
       loop->any_estimate = true;
       loop->nb_iterations_estimate = i_bound;