public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Aldy Hernandez <aldyh@redhat.com>
To: GCC patches <gcc-patches@gcc.gnu.org>
Subject: [COMMITTED] Allow registering same SSA name relations in oracle.
Date: Sun, 24 Jul 2022 17:04:29 +0200	[thread overview]
Message-ID: <20220724150431.2010479-2-aldyh@redhat.com> (raw)
In-Reply-To: <20220724150431.2010479-1-aldyh@redhat.com>

Similarly to what we did for the relation oracle, but for the path
oracle.  This was found while working on frange, where we can test for
x == x while checking for NANness.

Tested on x86-64 Linux.

gcc/ChangeLog:

	* value-relation.cc (value_relation::set_relation): Remove assert.
	(path_oracle::register_relation): Exit when trying to register
	same SSA name relations.
---
 gcc/value-relation.cc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gcc/value-relation.cc b/gcc/value-relation.cc
index bd344253af3..a447021214f 100644
--- a/gcc/value-relation.cc
+++ b/gcc/value-relation.cc
@@ -667,8 +667,6 @@ private:
 inline void
 value_relation::set_relation (relation_kind r, tree n1, tree n2)
 {
-  gcc_checking_assert (SSA_NAME_VERSION (n1) != SSA_NAME_VERSION (n2)
-		       || r == VREL_EQ);
   related = r;
   name1 = n1;
   name2 = n2;
@@ -1449,6 +1447,11 @@ void
 path_oracle::register_relation (basic_block bb, relation_kind k, tree ssa1,
 				tree ssa2)
 {
+  // If the 2 ssa_names are the same, do nothing.  An equivalence is implied,
+  // and no other relation makes sense.
+  if (ssa1 == ssa2)
+    return;
+
   if (dump_file && (dump_flags & TDF_DETAILS))
     {
       value_relation vr (k, ssa1, ssa2);
-- 
2.36.1


  reply	other threads:[~2022-07-24 15:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-24 15:04 [COMMITTED] Convert some uses in ranger_cache and DOM to vrange Aldy Hernandez
2022-07-24 15:04 ` Aldy Hernandez [this message]
2022-07-24 15:04 ` [COMMITTED] Tweaks to global ranges Aldy Hernandez
2022-07-24 15:04 ` [COMMITTED] Minor fixes to vr_values to not die on non integral types Aldy Hernandez

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=20220724150431.2010479-2-aldyh@redhat.com \
    --to=aldyh@redhat.com \
    --cc=gcc-patches@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).