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/devel/loop-unswitch-support-switches] Update scanned pattern and huge switches handling.
Date: Fri,  7 Jan 2022 08:57:00 +0000 (GMT)	[thread overview]
Message-ID: <20220107085700.B97283857C44@sourceware.org> (raw)

https://gcc.gnu.org/g:694b57cbf44833252240954dff8f52858ee57e4c

commit 694b57cbf44833252240954dff8f52858ee57e4c
Author: Martin Liska <mliska@suse.cz>
Date:   Fri Jan 7 09:56:34 2022 +0100

    Update scanned pattern and huge switches handling.

Diff:
---
 gcc/testsuite/gcc.dg/loop-unswitch-11.c | 2 +-
 gcc/tree-ssa-loop-unswitch.c            | 7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/loop-unswitch-11.c b/gcc/testsuite/gcc.dg/loop-unswitch-11.c
index 310e4f40423..2fdc3632ee9 100644
--- a/gcc/testsuite/gcc.dg/loop-unswitch-11.c
+++ b/gcc/testsuite/gcc.dg/loop-unswitch-11.c
@@ -39,7 +39,7 @@ foo(double *a, double *b, double *c, double *d, double *r, int size, int order)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "Unswitching loop on condition: order_.* >= 5 & order_.* <= 6 \\| order_.* == 9" 1 "unswitch" } } */
+/* { dg-final { scan-tree-dump-times "Unswitching loop on condition: order.* \\+ 4294967291.*order.* == 9" 1 "unswitch" } } */
 /* { dg-final { scan-tree-dump-times "Unswitching loop on condition: order.* == 1" 1 "unswitch" } } */
 /* { dg-final { scan-tree-dump-times "Unswitching loop on condition: order.* == 2" 1 "unswitch" } } */
 /* { dg-final { scan-tree-dump-times "Unswitching loop on condition: order.* == 3" 1 "unswitch" } } */
diff --git a/gcc/tree-ssa-loop-unswitch.c b/gcc/tree-ssa-loop-unswitch.c
index c164fe2faa0..4614664348b 100644
--- a/gcc/tree-ssa-loop-unswitch.c
+++ b/gcc/tree-ssa-loop-unswitch.c
@@ -477,11 +477,10 @@ find_unswitching_predicates_for_bb (basic_block bb, class loop *loop,
 		{
 		  unswitch_predicate *predicate
 		    = new unswitch_predicate (expr, idx, edge_index);
-		  ranger->gori ().outgoing_edge_range_p (predicate->true_range, e,
-							 idx, *get_global_range_query ());
-		  /* Huge switches are not supported by Ranger.  */
-		  if (predicate->true_range.undefined_p ())
+		  if (!ranger->gori ().outgoing_edge_range_p (predicate->true_range, e,
+							      idx, *get_global_range_query ()))
 		    {
+		      /* Huge switches are not supported by Ranger.  */
 		      delete predicate;
 		      return;
 		    }


                 reply	other threads:[~2022-01-07  8:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220107085700.B97283857C44@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).