Patchwork Suppress -fopt-info message for non-unrolled loops

login
register
mail settings
Submitter Teresa Johnson
Date May 15, 2013, 2:50 p.m.
Message ID <20130515145033.16AC5811D6@tjsboxrox.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/244102/
State New
Headers show

Comments

Teresa Johnson - May 15, 2013, 2:50 p.m.
This patch suppresses -fopt-info messages for loops that were not
unrolled/peeled, to avoid emitting "Unroll loop 0 times" messages.

Bootstrapped and tested on x86-64-unknown-linux-gnu. Ok for trunk?

2013-05-15  Teresa Johnson  <tejohnson@google.com>

	* loop-unroll.c (report_unroll_peel): Check decision before
        emitting unroll/peel message.
Richard Guenther - May 15, 2013, 2:53 p.m.
On Wed, May 15, 2013 at 4:50 PM, Teresa Johnson <tejohnson@google.com> wrote:
> This patch suppresses -fopt-info messages for loops that were not
> unrolled/peeled, to avoid emitting "Unroll loop 0 times" messages.
>
> Bootstrapped and tested on x86-64-unknown-linux-gnu. Ok for trunk?

Ok.

Thanks,
Richard.

> 2013-05-15  Teresa Johnson  <tejohnson@google.com>
>
>         * loop-unroll.c (report_unroll_peel): Check decision before
>         emitting unroll/peel message.
>
> Index: loop-unroll.c
> ===================================================================
> --- loop-unroll.c       (revision 198891)
> +++ loop-unroll.c       (working copy)
> @@ -212,6 +212,9 @@ report_unroll_peel (struct loop *loop, location_t
>    int niters = 0;
>    int report_flags = MSG_OPTIMIZED_LOCATIONS | TDF_RTL | TDF_DETAILS;
>
> +  if (loop->lpt_decision.decision == LPT_NONE)
> +    return;
> +
>    if (!dump_enabled_p ())
>      return;
>

Patch

Index: loop-unroll.c
===================================================================
--- loop-unroll.c	(revision 198891)
+++ loop-unroll.c	(working copy)
@@ -212,6 +212,9 @@  report_unroll_peel (struct loop *loop, location_t
   int niters = 0;
   int report_flags = MSG_OPTIMIZED_LOCATIONS | TDF_RTL | TDF_DETAILS;
 
+  if (loop->lpt_decision.decision == LPT_NONE)
+    return;
+
   if (!dump_enabled_p ())
     return;