public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/loop-unswitch-improvement)] Small while(1) loop refactoring.
@ 2021-11-19 13:53 Martin Liska
  0 siblings, 0 replies; 6+ messages in thread
From: Martin Liska @ 2021-11-19 13:53 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:cb8fe628c409af126e5eae6fe4c15349eed7f9aa

commit cb8fe628c409af126e5eae6fe4c15349eed7f9aa
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Nov 15 13:17:24 2021 +0100

    Small while(1) loop refactoring.

Diff:
---
 gcc/tree-ssa-loop-unswitch.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/gcc/tree-ssa-loop-unswitch.c b/gcc/tree-ssa-loop-unswitch.c
index fe4dacc0833..d77914e2ba5 100644
--- a/gcc/tree-ssa-loop-unswitch.c
+++ b/gcc/tree-ssa-loop-unswitch.c
@@ -307,11 +307,10 @@ tree_unswitch_single_loop (class loop *loop, int num)
 	}
     }
 
-  i = 0;
   bbs = get_loop_body (loop);
   found = loop->num_nodes;
 
-  while (1)
+  for (unsigned i = 0; true; i++)
     {
       /* Find a bb to unswitch on.  */
       for (; i < loop->num_nodes; i++)
@@ -351,10 +350,7 @@ tree_unswitch_single_loop (class loop *loop, int num)
 	}
       /* Do not unswitch too much.  */
       else if (num > param_max_unswitch_level)
-	{
-	  i++;
-	  continue;
-	}
+	continue;
       /* In nested tree_unswitch_single_loop first optimize all conditions
 	 using entry checks, then discover still reachable blocks in the
 	 loop and find the condition only among those still reachable bbs.  */
@@ -362,7 +358,6 @@ tree_unswitch_single_loop (class loop *loop, int num)
 	{
 	  if (found == loop->num_nodes)
 	    found = i;
-	  i++;
 	  continue;
 	}
       else
@@ -372,7 +367,6 @@ tree_unswitch_single_loop (class loop *loop, int num)
 	}
 
       update_stmt (stmt);
-      i++;
     }
 
   if (num != 0)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gcc(refs/users/marxin/heads/loop-unswitch-improvement)] Small while(1) loop refactoring.
@ 2021-11-22 12:44 Martin Liska
  0 siblings, 0 replies; 6+ messages in thread
From: Martin Liska @ 2021-11-22 12:44 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:ff4679f823a0ed992d872f8b21be6471bb76feef

commit ff4679f823a0ed992d872f8b21be6471bb76feef
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Nov 15 13:17:24 2021 +0100

    Small while(1) loop refactoring.

Diff:
---
 gcc/tree-ssa-loop-unswitch.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/gcc/tree-ssa-loop-unswitch.c b/gcc/tree-ssa-loop-unswitch.c
index fe4dacc0833..d77914e2ba5 100644
--- a/gcc/tree-ssa-loop-unswitch.c
+++ b/gcc/tree-ssa-loop-unswitch.c
@@ -307,11 +307,10 @@ tree_unswitch_single_loop (class loop *loop, int num)
 	}
     }
 
-  i = 0;
   bbs = get_loop_body (loop);
   found = loop->num_nodes;
 
-  while (1)
+  for (unsigned i = 0; true; i++)
     {
       /* Find a bb to unswitch on.  */
       for (; i < loop->num_nodes; i++)
@@ -351,10 +350,7 @@ tree_unswitch_single_loop (class loop *loop, int num)
 	}
       /* Do not unswitch too much.  */
       else if (num > param_max_unswitch_level)
-	{
-	  i++;
-	  continue;
-	}
+	continue;
       /* In nested tree_unswitch_single_loop first optimize all conditions
 	 using entry checks, then discover still reachable blocks in the
 	 loop and find the condition only among those still reachable bbs.  */
@@ -362,7 +358,6 @@ tree_unswitch_single_loop (class loop *loop, int num)
 	{
 	  if (found == loop->num_nodes)
 	    found = i;
-	  i++;
 	  continue;
 	}
       else
@@ -372,7 +367,6 @@ tree_unswitch_single_loop (class loop *loop, int num)
 	}
 
       update_stmt (stmt);
-      i++;
     }
 
   if (num != 0)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gcc(refs/users/marxin/heads/loop-unswitch-improvement)] Small while(1) loop refactoring.
@ 2021-11-19 14:34 Martin Liska
  0 siblings, 0 replies; 6+ messages in thread
From: Martin Liska @ 2021-11-19 14:34 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:c102dee76451b1ca8f2e976ca922b4ead958024b

commit c102dee76451b1ca8f2e976ca922b4ead958024b
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Nov 15 13:17:24 2021 +0100

    Small while(1) loop refactoring.

Diff:
---
 gcc/tree-ssa-loop-unswitch.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/gcc/tree-ssa-loop-unswitch.c b/gcc/tree-ssa-loop-unswitch.c
index fe4dacc0833..d77914e2ba5 100644
--- a/gcc/tree-ssa-loop-unswitch.c
+++ b/gcc/tree-ssa-loop-unswitch.c
@@ -307,11 +307,10 @@ tree_unswitch_single_loop (class loop *loop, int num)
 	}
     }
 
-  i = 0;
   bbs = get_loop_body (loop);
   found = loop->num_nodes;
 
-  while (1)
+  for (unsigned i = 0; true; i++)
     {
       /* Find a bb to unswitch on.  */
       for (; i < loop->num_nodes; i++)
@@ -351,10 +350,7 @@ tree_unswitch_single_loop (class loop *loop, int num)
 	}
       /* Do not unswitch too much.  */
       else if (num > param_max_unswitch_level)
-	{
-	  i++;
-	  continue;
-	}
+	continue;
       /* In nested tree_unswitch_single_loop first optimize all conditions
 	 using entry checks, then discover still reachable blocks in the
 	 loop and find the condition only among those still reachable bbs.  */
@@ -362,7 +358,6 @@ tree_unswitch_single_loop (class loop *loop, int num)
 	{
 	  if (found == loop->num_nodes)
 	    found = i;
-	  i++;
 	  continue;
 	}
       else
@@ -372,7 +367,6 @@ tree_unswitch_single_loop (class loop *loop, int num)
 	}
 
       update_stmt (stmt);
-      i++;
     }
 
   if (num != 0)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gcc(refs/users/marxin/heads/loop-unswitch-improvement)] Small while(1) loop refactoring.
@ 2021-11-16  9:46 Martin Liska
  0 siblings, 0 replies; 6+ messages in thread
From: Martin Liska @ 2021-11-16  9:46 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:fe56bafaff5363a026cb3a54f714cd0cd6f1d3c4

commit fe56bafaff5363a026cb3a54f714cd0cd6f1d3c4
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Nov 15 13:17:24 2021 +0100

    Small while(1) loop refactoring.

Diff:
---
 gcc/tree-ssa-loop-unswitch.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/gcc/tree-ssa-loop-unswitch.c b/gcc/tree-ssa-loop-unswitch.c
index fe4dacc0833..d77914e2ba5 100644
--- a/gcc/tree-ssa-loop-unswitch.c
+++ b/gcc/tree-ssa-loop-unswitch.c
@@ -307,11 +307,10 @@ tree_unswitch_single_loop (class loop *loop, int num)
 	}
     }
 
-  i = 0;
   bbs = get_loop_body (loop);
   found = loop->num_nodes;
 
-  while (1)
+  for (unsigned i = 0; true; i++)
     {
       /* Find a bb to unswitch on.  */
       for (; i < loop->num_nodes; i++)
@@ -351,10 +350,7 @@ tree_unswitch_single_loop (class loop *loop, int num)
 	}
       /* Do not unswitch too much.  */
       else if (num > param_max_unswitch_level)
-	{
-	  i++;
-	  continue;
-	}
+	continue;
       /* In nested tree_unswitch_single_loop first optimize all conditions
 	 using entry checks, then discover still reachable blocks in the
 	 loop and find the condition only among those still reachable bbs.  */
@@ -362,7 +358,6 @@ tree_unswitch_single_loop (class loop *loop, int num)
 	{
 	  if (found == loop->num_nodes)
 	    found = i;
-	  i++;
 	  continue;
 	}
       else
@@ -372,7 +367,6 @@ tree_unswitch_single_loop (class loop *loop, int num)
 	}
 
       update_stmt (stmt);
-      i++;
     }
 
   if (num != 0)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gcc(refs/users/marxin/heads/loop-unswitch-improvement)] Small while(1) loop refactoring.
@ 2021-11-15 15:48 Martin Liska
  0 siblings, 0 replies; 6+ messages in thread
From: Martin Liska @ 2021-11-15 15:48 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:6a57bc376b44ff38d9dfad54fe1667b2608a8853

commit 6a57bc376b44ff38d9dfad54fe1667b2608a8853
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Nov 15 13:17:24 2021 +0100

    Small while(1) loop refactoring.

Diff:
---
 gcc/tree-ssa-loop-unswitch.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/gcc/tree-ssa-loop-unswitch.c b/gcc/tree-ssa-loop-unswitch.c
index fe4dacc0833..d77914e2ba5 100644
--- a/gcc/tree-ssa-loop-unswitch.c
+++ b/gcc/tree-ssa-loop-unswitch.c
@@ -307,11 +307,10 @@ tree_unswitch_single_loop (class loop *loop, int num)
 	}
     }
 
-  i = 0;
   bbs = get_loop_body (loop);
   found = loop->num_nodes;
 
-  while (1)
+  for (unsigned i = 0; true; i++)
     {
       /* Find a bb to unswitch on.  */
       for (; i < loop->num_nodes; i++)
@@ -351,10 +350,7 @@ tree_unswitch_single_loop (class loop *loop, int num)
 	}
       /* Do not unswitch too much.  */
       else if (num > param_max_unswitch_level)
-	{
-	  i++;
-	  continue;
-	}
+	continue;
       /* In nested tree_unswitch_single_loop first optimize all conditions
 	 using entry checks, then discover still reachable blocks in the
 	 loop and find the condition only among those still reachable bbs.  */
@@ -362,7 +358,6 @@ tree_unswitch_single_loop (class loop *loop, int num)
 	{
 	  if (found == loop->num_nodes)
 	    found = i;
-	  i++;
 	  continue;
 	}
       else
@@ -372,7 +367,6 @@ tree_unswitch_single_loop (class loop *loop, int num)
 	}
 
       update_stmt (stmt);
-      i++;
     }
 
   if (num != 0)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gcc(refs/users/marxin/heads/loop-unswitch-improvement)] Small while(1) loop refactoring.
@ 2021-11-15 14:23 Martin Liska
  0 siblings, 0 replies; 6+ messages in thread
From: Martin Liska @ 2021-11-15 14:23 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:abcac73a921e2c8422c85c20b02149d92511ec50

commit abcac73a921e2c8422c85c20b02149d92511ec50
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Nov 15 13:17:24 2021 +0100

    Small while(1) loop refactoring.

Diff:
---
 gcc/tree-ssa-loop-unswitch.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/gcc/tree-ssa-loop-unswitch.c b/gcc/tree-ssa-loop-unswitch.c
index fe4dacc0833..d77914e2ba5 100644
--- a/gcc/tree-ssa-loop-unswitch.c
+++ b/gcc/tree-ssa-loop-unswitch.c
@@ -307,11 +307,10 @@ tree_unswitch_single_loop (class loop *loop, int num)
 	}
     }
 
-  i = 0;
   bbs = get_loop_body (loop);
   found = loop->num_nodes;
 
-  while (1)
+  for (unsigned i = 0; true; i++)
     {
       /* Find a bb to unswitch on.  */
       for (; i < loop->num_nodes; i++)
@@ -351,10 +350,7 @@ tree_unswitch_single_loop (class loop *loop, int num)
 	}
       /* Do not unswitch too much.  */
       else if (num > param_max_unswitch_level)
-	{
-	  i++;
-	  continue;
-	}
+	continue;
       /* In nested tree_unswitch_single_loop first optimize all conditions
 	 using entry checks, then discover still reachable blocks in the
 	 loop and find the condition only among those still reachable bbs.  */
@@ -362,7 +358,6 @@ tree_unswitch_single_loop (class loop *loop, int num)
 	{
 	  if (found == loop->num_nodes)
 	    found = i;
-	  i++;
 	  continue;
 	}
       else
@@ -372,7 +367,6 @@ tree_unswitch_single_loop (class loop *loop, int num)
 	}
 
       update_stmt (stmt);
-      i++;
     }
 
   if (num != 0)


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-11-22 12:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-19 13:53 [gcc(refs/users/marxin/heads/loop-unswitch-improvement)] Small while(1) loop refactoring Martin Liska
  -- strict thread matches above, loose matches on Subject: below --
2021-11-22 12:44 Martin Liska
2021-11-19 14:34 Martin Liska
2021-11-16  9:46 Martin Liska
2021-11-15 15:48 Martin Liska
2021-11-15 14:23 Martin Liska

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).