diff mbox

[02/13] Skip distribution if there is no loop

Message ID VI1PR0802MB217699FFE8FC4E5BAC54C784E7CD0@VI1PR0802MB2176.eurprd08.prod.outlook.com
State New
Headers show

Commit Message

Bin Cheng June 12, 2017, 5:02 p.m. UTC
Hi,
this is a simple patch skipping distribution if there is no loop at all.

Bootstrap and test on x86_64 and AArch64.  Is it OK?

Thanks,
bin

2017-06-07  Bin Cheng  <bin.cheng@arm.com>

	* cfgloop.h (pass_loop_distribution::execute): Skip if no loops.
From eb6a795331efde92fd6df1c6e612fb1ffa9f482f Mon Sep 17 00:00:00 2001
From: Bin Cheng <binche01@e108451-lin.cambridge.arm.com>
Date: Fri, 9 Jun 2017 09:30:40 +0100
Subject: [PATCH 02/14] fast-return-20170607.txt

---
 gcc/tree-loop-distribution.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Richard Biener June 13, 2017, 10:45 a.m. UTC | #1
On Mon, Jun 12, 2017 at 7:02 PM, Bin Cheng <Bin.Cheng@arm.com> wrote:
> Hi,
> this is a simple patch skipping distribution if there is no loop at all.
>
> Bootstrap and test on x86_64 and AArch64.  Is it OK?
> Thanks,
> bin
>
> 2017-06-07  Bin Cheng  <bin.cheng@arm.com>
>
>         * cfgloop.h (pass_loop_distribution::execute): Skip if no loops.

tree-loop-distribution.c

Ok.

Richard.
Jeff Law June 27, 2017, 5:07 p.m. UTC | #2
On 06/12/2017 11:02 AM, Bin Cheng wrote:
> Hi,
> this is a simple patch skipping distribution if there is no loop at all.
> 
> Bootstrap and test on x86_64 and AArch64.  Is it OK?
> 
> Thanks,
> bin
> 
> 2017-06-07  Bin Cheng  <bin.cheng@arm.com>
> 
> 	* cfgloop.h (pass_loop_distribution::execute): Skip if no loops.
> 
OK.
jeff
diff mbox

Patch

diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index a60454b..9f0c801 100644
--- a/gcc/tree-loop-distribution.c
+++ b/gcc/tree-loop-distribution.c
@@ -1758,6 +1758,9 @@  pass_loop_distribution::execute (function *fun)
   control_dependences *cd = NULL;
   auto_vec<loop_p> loops_to_be_destroyed;
 
+  if (number_of_loops (fun) <= 1)
+    return 0;
+
   FOR_ALL_BB_FN (bb, fun)
     {
       gimple_stmt_iterator gsi;