public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Martin Liska <marxin@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/users/marxin/heads/loop-unswitching-switch-v5)] Revert "Use global ranger."
Date: Mon,  8 Nov 2021 15:36:39 +0000 (GMT)	[thread overview]
Message-ID: <20211108153639.0CB263858029@sourceware.org> (raw)

https://gcc.gnu.org/g:7f763ce3358aa3e9782515d67ca8b8ef05969422

commit 7f763ce3358aa3e9782515d67ca8b8ef05969422
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Nov 8 16:18:22 2021 +0100

    Revert "Use global ranger."
    
    This reverts commit 5df2804ff8197cfd7d45a9e28ee9d22ad1e6a3a5.

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

diff --git a/gcc/tree-ssa-loop-unswitch.c b/gcc/tree-ssa-loop-unswitch.c
index 41261efe404..4b4bd471acd 100644
--- a/gcc/tree-ssa-loop-unswitch.c
+++ b/gcc/tree-ssa-loop-unswitch.c
@@ -79,7 +79,7 @@ along with GCC; see the file COPYING3.  If not see
    shape.  */
 
 static class loop *tree_unswitch_loop (class loop *, basic_block, tree, edge);
-static bool tree_unswitch_single_loop (class loop *, gimple_ranger *ranger, int);
+static bool tree_unswitch_single_loop (class loop *, int);
 static tree tree_may_unswitch_on (basic_block, class loop *, edge *);
 static bool tree_unswitch_outer_loop (class loop *);
 static edge find_loop_guard (class loop *);
@@ -96,18 +96,16 @@ unsigned int
 tree_ssa_unswitch_loops (void)
 {
   bool changed = false;
-  gimple_ranger *ranger = enable_ranger (cfun);
 
   /* Go through all loops starting from innermost.  */
   for (auto loop : loops_list (cfun, LI_FROM_INNERMOST))
     {
       if (!loop->inner)
 	/* Unswitch innermost loop.  */
-	changed |= tree_unswitch_single_loop (loop, ranger, 0);
+	changed |= tree_unswitch_single_loop (loop, 0);
       else
 	changed |= tree_unswitch_outer_loop (loop);
     }
-  disable_ranger (cfun);
 
   if (changed)
     {
@@ -307,7 +305,7 @@ tree_may_unswitch_on (basic_block bb, class loop *loop, edge *cond_edge)
    grow exponentially.  */
 
 static bool
-tree_unswitch_single_loop (class loop *loop, gimple_ranger *ranger, int num)
+tree_unswitch_single_loop (class loop *loop, int num)
 {
   basic_block *bbs;
   class loop *nloop;
@@ -356,6 +354,7 @@ tree_unswitch_single_loop (class loop *loop, gimple_ranger *ranger, int num)
   bbs = get_loop_body (loop);
   found = loop->num_nodes;
 
+  gimple_ranger ranger;
   while (1)
     {
       /* Find a bb to unswitch on.  */
@@ -387,7 +386,7 @@ tree_unswitch_single_loop (class loop *loop, gimple_ranger *ranger, int num)
 	  tree result;
 	  int_range_max r;
 
-	  if (ranger->range_of_stmt (r, stmt) && r.singleton_p (&result))
+	  if (ranger.range_of_stmt (r, stmt) && r.singleton_p (&result))
 	    {
 	      gimple_cond_set_condition_from_tree (condition,
 						   result);
@@ -408,7 +407,7 @@ tree_unswitch_single_loop (class loop *loop, gimple_ranger *ranger, int num)
 	      edge e = find_edge (gimple_bb (stmt), dest);
 
 	      int_range_max r;
-	      if (ranger->range_on_edge (r, e, gimple_switch_index (swtch))
+	      if (ranger.range_on_edge (r, e, gimple_switch_index (swtch))
 		  && r.undefined_p ())
 		{
 		  e->flags |= EDGE_IGNORE;
@@ -543,8 +542,8 @@ tree_unswitch_single_loop (class loop *loop, gimple_ranger *ranger, int num)
   free_original_copy_tables ();
 
   /* Invoke itself on modified loops.  */
-  tree_unswitch_single_loop (nloop, ranger, num + 1);
-  tree_unswitch_single_loop (loop, ranger, num + 1);
+  tree_unswitch_single_loop (nloop, num + 1);
+  tree_unswitch_single_loop (loop, num + 1);
   free (bbs);
   return true;
 }


             reply	other threads:[~2021-11-08 15:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-08 15:36 Martin Liska [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-11-08 15:30 Martin Liska

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211108153639.0CB263858029@sourceware.org \
    --to=marxin@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).