]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
scev query mismatch message
authorAndrew MacLeod <amacleod@redhat.com>
Thu, 30 May 2024 13:40:46 +0000 (09:40 -0400)
committerAndrew MacLeod <amacleod@redhat.com>
Tue, 11 Jun 2024 12:26:08 +0000 (08:26 -0400)
Add a message to the listing if SCEV is not invoked because of a
range_query mismatch

* gimple-range-fold.cc (range_of_ssa_name_with_loop_info): Issue a
message if SCEV is not invoked due to a mismatch.

gcc/gimple-range-fold.cc

index 98a4877ba18f9b17284693bcfaebf379c7d954a4..6037c29ce11e3b9469f91842cca25b3fd0e44347 100644 (file)
@@ -1267,9 +1267,18 @@ fold_using_range::range_of_ssa_name_with_loop_info (vrange &r, tree name,
   // SCEV currently invokes get_range_query () for values.  If the query
   // being passed in is not the same SCEV will use, do not invoke SCEV.
   // This can be remove if/when SCEV uses a passed in range-query.
-  if (src.query () != get_range_query (cfun)
-      || !range_of_var_in_loop (r, name, l, phi, src.query ()))
-    r.set_varying (TREE_TYPE (name));
+  if (src.query () != get_range_query (cfun))
+    {
+      r.set_varying (TREE_TYPE (name));
+      // Report the msmatch if SRC is not the global query.  The cache
+      // uses a global query and would provide numerous false positives.
+      if (dump_file && (dump_flags & TDF_DETAILS)
+         && src.query () != get_global_range_query ())
+       fprintf (dump_file,
+         "fold_using-range:: SCEV not invoked due to mismatched queries\n");
+    }
+  else if (!range_of_var_in_loop (r, name, l, phi, src.query ()))
+      r.set_varying (TREE_TYPE (name));
 }
 
 // -----------------------------------------------------------------------