[Mlir-commits] [mlir] e42bfec - [mlir][dataflow] Remove the unused AnalysisState::defaultInitialize().

Jeff Niu llvmlistbot at llvm.org
Mon Aug 15 10:24:11 PDT 2022


Author: Zhixun Tan
Date: 2022-08-15T13:24:08-04:00
New Revision: e42bfec9b659851ce2acb04774b08ab20c1a62f0

URL: https://github.com/llvm/llvm-project/commit/e42bfec9b659851ce2acb04774b08ab20c1a62f0
DIFF: https://github.com/llvm/llvm-project/commit/e42bfec9b659851ce2acb04774b08ab20c1a62f0.diff

LOG: [mlir][dataflow] Remove the unused AnalysisState::defaultInitialize().

Depends On D131660

`defaultInitialize()` was introduced for the "nudging" behavior, which has been deleted.

Reviewed By: Mogball, rriddle

Differential Revision: https://reviews.llvm.org/D131746

Added: 
    

Modified: 
    mlir/include/mlir/Analysis/DataFlow/DeadCodeAnalysis.h
    mlir/include/mlir/Analysis/DataFlow/SparseAnalysis.h
    mlir/include/mlir/Analysis/DataFlowFramework.h
    mlir/test/lib/Analysis/DataFlow/TestDenseDataFlowAnalysis.cpp
    mlir/test/lib/Analysis/TestDataFlowFramework.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Analysis/DataFlow/DeadCodeAnalysis.h b/mlir/include/mlir/Analysis/DataFlow/DeadCodeAnalysis.h
index 98b4d019f46d4..99ee208cebcaa 100644
--- a/mlir/include/mlir/Analysis/DataFlow/DeadCodeAnalysis.h
+++ b/mlir/include/mlir/Analysis/DataFlow/DeadCodeAnalysis.h
@@ -41,9 +41,6 @@ class Executable : public AnalysisState {
   /// The state is initialized by default.
   bool isUninitialized() const override { return false; }
 
-  /// The state is always initialized.
-  ChangeResult defaultInitialize() override { return ChangeResult::NoChange; }
-
   /// Set the state of the program point to live.
   ChangeResult setToLive();
 
@@ -101,9 +98,6 @@ class PredecessorState : public AnalysisState {
   /// The state is initialized by default.
   bool isUninitialized() const override { return false; }
 
-  /// The state is always initialized.
-  ChangeResult defaultInitialize() override { return ChangeResult::NoChange; }
-
   /// Print the known predecessors.
   void print(raw_ostream &os) const override;
 

diff  --git a/mlir/include/mlir/Analysis/DataFlow/SparseAnalysis.h b/mlir/include/mlir/Analysis/DataFlow/SparseAnalysis.h
index 17a0f1637e5c6..480af8b4320f5 100644
--- a/mlir/include/mlir/Analysis/DataFlow/SparseAnalysis.h
+++ b/mlir/include/mlir/Analysis/DataFlow/SparseAnalysis.h
@@ -93,11 +93,6 @@ class Lattice : public AbstractSparseLattice {
 
   /// Returns true if the value of this lattice hasn't yet been initialized.
   bool isUninitialized() const override { return !optimisticValue.has_value(); }
-  /// Force the initialization of the element by setting it to its pessimistic
-  /// fixpoint.
-  ChangeResult defaultInitialize() override {
-    return markPessimisticFixpoint();
-  }
 
   /// Join the information contained in the 'rhs' lattice into this
   /// lattice. Returns if the state of the current lattice changed.

diff  --git a/mlir/include/mlir/Analysis/DataFlowFramework.h b/mlir/include/mlir/Analysis/DataFlowFramework.h
index 2992e05f14ddf..37603e5eacef8 100644
--- a/mlir/include/mlir/Analysis/DataFlowFramework.h
+++ b/mlir/include/mlir/Analysis/DataFlowFramework.h
@@ -291,10 +291,6 @@ class AnalysisState {
   /// Returns true if the analysis state is uninitialized.
   virtual bool isUninitialized() const = 0;
 
-  /// Force an uninitialized analysis state to initialize itself with a default
-  /// value.
-  virtual ChangeResult defaultInitialize() = 0;
-
   /// Print the contents of the analysis state.
   virtual void print(raw_ostream &os) const = 0;
 

diff  --git a/mlir/test/lib/Analysis/DataFlow/TestDenseDataFlowAnalysis.cpp b/mlir/test/lib/Analysis/DataFlow/TestDenseDataFlowAnalysis.cpp
index 070bbb9fff3fc..0fc80a6f70a37 100644
--- a/mlir/test/lib/Analysis/DataFlow/TestDenseDataFlowAnalysis.cpp
+++ b/mlir/test/lib/Analysis/DataFlow/TestDenseDataFlowAnalysis.cpp
@@ -61,9 +61,6 @@ class LastModification : public AbstractDenseLattice {
   /// The lattice is always initialized.
   bool isUninitialized() const override { return false; }
 
-  /// Initialize the lattice. Does nothing.
-  ChangeResult defaultInitialize() override { return ChangeResult::NoChange; }
-
   /// Mark the lattice as having reached its pessimistic fixpoint. That is, the
   /// last modifications of all memory resources are unknown.
   ChangeResult reset() override {

diff  --git a/mlir/test/lib/Analysis/TestDataFlowFramework.cpp b/mlir/test/lib/Analysis/TestDataFlowFramework.cpp
index 329be3c5446f9..8241e382e2843 100644
--- a/mlir/test/lib/Analysis/TestDataFlowFramework.cpp
+++ b/mlir/test/lib/Analysis/TestDataFlowFramework.cpp
@@ -20,9 +20,6 @@ class FooState : public AnalysisState {
 
   using AnalysisState::AnalysisState;
 
-  /// Default-initialize the state to zero.
-  ChangeResult defaultInitialize() override { return join(0); }
-
   /// Returns true if the state is uninitialized.
   bool isUninitialized() const override { return !state; }
 


        


More information about the Mlir-commits mailing list