https://gcc.gnu.org/g:a56ac87c5e53a1054490806e5d08957b97972f69

commit r17-5822-ga56ac87c5e53a1054490806e5d08957b97972f69
Author: Andrew MacLeod <[email protected]>
Date:   Tue Oct 27 18:48:12 2026 -0400

    Inline ssa_name_pt_solution
    
    There are enough calls to ssa_name_pt_solution to warrant inlining it.
    This requires value-range-storage.h to be included in a couple of
    other places, and streamline the function itself.
    
            * gimple.h: Include value-range-storage.h.
            * tree-ssanames.cc (ssa_name_pt_solution): Move to...
            * tree-ssanames.h (ssa_name_pt_solution): Here and adjust.
            * tree-vrp.h: Include value-range-storage.h.

Diff:
---
 gcc/gimple.h         |  1 +
 gcc/tree-ssanames.cc |  9 ---------
 gcc/tree-ssanames.h  | 10 +++++++++-
 gcc/tree-vrp.h       |  1 +
 4 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/gcc/gimple.h b/gcc/gimple.h
index 0245e5e0934b..f8f5b01ba85b 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimple-expr.h"
 #include "bitmap.h"
 #include "value-range.h"
+#include "value-range-storage.h"
 #include "value-query.h"
 
 typedef gimple *gimple_seq_node;
diff --git a/gcc/tree-ssanames.cc b/gcc/tree-ssanames.cc
index 565ebda14cd6..426d43c48ea2 100644
--- a/gcc/tree-ssanames.cc
+++ b/gcc/tree-ssanames.cc
@@ -140,15 +140,6 @@ get_pt_solution (tree name)
   return pt;
 }
 
-/* Return NAME's points-to solution, or NULL if none exists.  */
-
-const pt_solution *
-ssa_name_pt_solution (const_tree name)
-{
-  prange_storage *s = ssa_name_prange_storage (name);
-  return s ? s->pt : NULL;
-}
-
 /* Make PT the points-to solution for NAME.  */
 
 void
diff --git a/gcc/tree-ssanames.h b/gcc/tree-ssanames.h
index bbd5890c4ff1..98e21eeeb444 100644
--- a/gcc/tree-ssanames.h
+++ b/gcc/tree-ssanames.h
@@ -22,7 +22,15 @@ along with GCC; see the file COPYING3.  If not see
 
 /* Return NAME's points-to solution, or NULL if it has none.  Returns NULL
    for a non pointer type.  */
-extern const pt_solution *ssa_name_pt_solution (const_tree name);
+inline const pt_solution *
+ssa_name_pt_solution (const_tree name)
+{
+  vrange_storage *mem = SSA_NAME_RANGE_INFO (name);
+  if (!mem || mem->m_discriminator != VR_PRANGE)
+    return NULL;
+  prange_storage *s = static_cast <prange_storage *> (mem);
+  return s->pt;
+}
 
 /* Make PT the points-to solution for NAME, which must have pointer type.  */
 extern void set_ssa_name_pt_solution (tree name, const pt_solution &pt);
diff --git a/gcc/tree-vrp.h b/gcc/tree-vrp.h
index 2b88ba5230d5..ce82c06eca4b 100644
--- a/gcc/tree-vrp.h
+++ b/gcc/tree-vrp.h
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3.  If not see
 #define GCC_TREE_VRP_H
 
 #include "value-range.h"
+#include "value-range-storage.h"
 
 extern int compare_values (tree, tree);

Reply via email to