Patchwork [GOOGLE] Disable aggressive loop peeling to prevent code bloat.

login
register
mail settings
Submitter Dehao Chen
Date Sept. 25, 2013, 9:48 p.m.
Message ID <CAO2gOZXX1LDA-E-3hVAHoyw8G6373EaO4kHMRruMUeO06+0d3g@mail.gmail.com>
Download mbox | patch
Permalink /patch/278030/
State New
Headers show

Comments

Dehao Chen - Sept. 25, 2013, 9:48 p.m.
This patch disables aggressive loop peeling when profile is available.
This prevents extensive code bloat which leads to increased i-cache
misses.

Bootstrapped and passed regression tests.

OK for google-4_8?

Thanks,
Dehao
Xinliang David Li - Sept. 25, 2013, 10:17 p.m.
I wish there is better heuristic in the future. For now it is ok.

David

On Wed, Sep 25, 2013 at 2:48 PM, Dehao Chen <dehao@google.com> wrote:
> This patch disables aggressive loop peeling when profile is available.
> This prevents extensive code bloat which leads to increased i-cache
> misses.
>
> Bootstrapped and passed regression tests.
>
> OK for google-4_8?
>
> Thanks,
> Dehao
>
> Index: gcc/loop-unroll.c
> ===================================================================
> --- gcc/loop-unroll.c (revision 202926)
> +++ gcc/loop-unroll.c (working copy)
> @@ -1574,8 +1574,7 @@ decide_peel_simple (struct loop *loop, int flags)
>       peeling it is not the case.  Also a function call inside loop is
>       also branch from branch prediction POV (and probably better reason
>       to not unroll/peel).  */
> -  if (desc->num_branches > 1
> -      && profile_status != PROFILE_READ)
> +  if (desc->num_branches > 1)
>      {
>        if (dump_file)
>   fprintf (dump_file, ";; Not peeling, contains branches\n");

Patch

Index: gcc/loop-unroll.c
===================================================================
--- gcc/loop-unroll.c (revision 202926)
+++ gcc/loop-unroll.c (working copy)
@@ -1574,8 +1574,7 @@  decide_peel_simple (struct loop *loop, int flags)
      peeling it is not the case.  Also a function call inside loop is
      also branch from branch prediction POV (and probably better reason
      to not unroll/peel).  */
-  if (desc->num_branches > 1
-      && profile_status != PROFILE_READ)
+  if (desc->num_branches > 1)
     {
       if (dump_file)
  fprintf (dump_file, ";; Not peeling, contains branches\n");