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] Remove size check when loop is very hot


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


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