[COMMITTED] Kill known equivalences before a new assignment in the path solver.

Message ID 20211027181323.395724-3-aldyh@redhat.com
State Committed
Commit aeb10f8d2a6e1267c981a62dc8163af3b7607797
Headers
Series [COMMITTED] Kill known equivalences before a new assignment in the path solver. |

Commit Message

Aldy Hernandez Oct. 27, 2021, 6:13 p.m. UTC
  Every time we have a killing statement, we must also kill the relations
seen so far.  This is similar to what we did for the equivs inherent in
PHIs along a path.

Tested on x86-64 and ppc64le Linux.

gcc/ChangeLog:

	* gimple-range-path.cc
          (path_range_query::range_defined_in_block): Call
          killing_def.
---
 gcc/gimple-range-path.cc | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
  

Patch

diff --git a/gcc/gimple-range-path.cc b/gcc/gimple-range-path.cc
index 2f570a13e05..d8c2a9b6a86 100644
--- a/gcc/gimple-range-path.cc
+++ b/gcc/gimple-range-path.cc
@@ -288,8 +288,14 @@  path_range_query::range_defined_in_block (irange &r, tree name, basic_block bb)
 
   if (gimple_code (def_stmt) == GIMPLE_PHI)
     ssa_range_in_phi (r, as_a<gphi *> (def_stmt));
-  else if (!range_of_stmt (r, def_stmt, name))
-    r.set_varying (TREE_TYPE (name));
+  else
+    {
+      if (name)
+	get_path_oracle ()->killing_def (name);
+
+      if (!range_of_stmt (r, def_stmt, name))
+	r.set_varying (TREE_TYPE (name));
+    }
 
   if (bb)
     m_non_null.adjust_range (r, name, bb);