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