diff mbox

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

Message ID CAO2gOZVBb=9+SuhKW1rU9pwjejcEg1J4AHRO1EHAPPcx2KQEGw@mail.gmail.com
State New
Headers show

Commit Message

Dehao Chen Jan. 17, 2014, 5:08 p.m. UTC
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

Comments

Xinliang David Li Jan. 17, 2014, 5:21 p.m. UTC | #1
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;
diff mbox

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;