This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]