diff mbox series

[COMMITTED,GCC14] Implement new assume pass.

Message ID 92a4fa0a-70d8-4ece-91ee-94972872176f@redhat.com
State New
Headers show
Series [COMMITTED,GCC14] Implement new assume pass. | expand

Commit Message

Andrew MacLeod Nov. 4, 2024, 2:42 p.m. UTC
I've back ported and committed the 3 patch set for assume p;rocessing to 
GCC14.  The new file is almost the same, just a couple of minor 
differences related to

  1) value_range in gcc15 was Value_Range in gcc14, and
   2) there was no gori() component to a range_query, so I had to pass a 
ranger instance into the assume pass to access gori.

Other than that, they are pretty much in sync.

Bootstrapped on x86_64-pc-linux-gnu with no regressions. Pushed.

Andrew
diff mbox series

Patch

From 4e8c8eed82e190f5f819e75088d8e05a851b41e7 Mon Sep 17 00:00:00 2001
From: Andrew MacLeod <amacleod@redhat.com>
Date: Fri, 1 Nov 2024 10:56:54 -0400
Subject: [PATCH 1/3] Make fur_edge accessible.

Move the decl of fur_edge out of the source file into the header file.

	* gimple-range-fold.cc (class fur_edge): Relocate from here.
	(fur_edge::fur_edge): Also move to:
	* gimple-range-fold.h (class fur_edge): Relocate to here.
	(fur_edge::fur_edge): Likewise.
---
 gcc/gimple-range-fold.cc | 20 --------------------
 gcc/gimple-range-fold.h  | 14 ++++++++++++++
 2 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/gcc/gimple-range-fold.cc b/gcc/gimple-range-fold.cc
index 9c4ad1ee7b9..8020a1a3c63 100644
--- a/gcc/gimple-range-fold.cc
+++ b/gcc/gimple-range-fold.cc
@@ -108,26 +108,6 @@  fur_source::register_relation (edge e ATTRIBUTE_UNUSED,
 {
 }
 
-// This version of fur_source will pick a range up off an edge.
-
-class fur_edge : public fur_source
-{
-public:
-  fur_edge (edge e, range_query *q = NULL);
-  virtual bool get_operand (vrange &r, tree expr) override;
-  virtual bool get_phi_operand (vrange &r, tree expr, edge e) override;
-private:
-  edge m_edge;
-};
-
-// Instantiate an edge based fur_source.
-
-inline
-fur_edge::fur_edge (edge e, range_query *q) : fur_source (q)
-{
-  m_edge = e;
-}
-
 // Get the value of EXPR on edge m_edge.
 
 bool
diff --git a/gcc/gimple-range-fold.h b/gcc/gimple-range-fold.h
index 7cbe15d05e5..a619a530769 100644
--- a/gcc/gimple-range-fold.h
+++ b/gcc/gimple-range-fold.h
@@ -142,6 +142,20 @@  protected:
   relation_oracle *m_oracle;
 };
 
+
+// This version of fur_source will pick a range up off an edge.
+
+class fur_edge : public fur_source
+{
+public:
+  fur_edge (edge e, range_query *q = NULL) : fur_source (q)
+    { m_edge = e; }
+  virtual bool get_operand (vrange &r, tree expr) override;
+  virtual bool get_phi_operand (vrange &r, tree expr, edge e) override;
+private:
+  edge m_edge;
+};
+
 // This class uses ranges to fold a gimple statement producing a range for
 // the LHS.  The source of all operands is supplied via the fur_source class
 // which provides a range_query as well as a source location and any other
-- 
2.45.0