[PATCH] D85610: [Attributor][NFC][AAPotentialValues] Change interface of PotentialValuesState

Shinji Okumura via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 9 17:27:55 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGff1002aab091: [Attributor][NFC][AAPotentialValues] Change interface of PotentialValuesState (authored by okura).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85610/new/

https://reviews.llvm.org/D85610

Files:
  llvm/include/llvm/Transforms/IPO/Attributor.h


Index: llvm/include/llvm/Transforms/IPO/Attributor.h
===================================================================
--- llvm/include/llvm/Transforms/IPO/Attributor.h
+++ llvm/include/llvm/Transforms/IPO/Attributor.h
@@ -3359,12 +3359,32 @@
 /// force it. As for the conditions under which we force it, see
 /// AAPotentialValues.
 template <typename MemberTy, typename KeyInfo = DenseMapInfo<MemberTy>>
-struct PotentialValuesState : BooleanState {
+struct PotentialValuesState : AbstractState {
   using SetTy = DenseSet<MemberTy, KeyInfo>;
 
-  PotentialValuesState() : BooleanState(true) {}
+  PotentialValuesState() : IsValidState(true) {}
 
-  PotentialValuesState(bool IsValid) : BooleanState(IsValid) {}
+  PotentialValuesState(bool IsValid) : IsValidState(IsValid) {}
+
+  /// See AbstractState::isValidState(...)
+  bool isValidState() const { return IsValidState.isValidState(); }
+
+  /// See AbstractState::isAtFixpoint(...)
+  bool isAtFixpoint() const { return IsValidState.isAtFixpoint(); }
+
+  /// See AbstractState::indicatePessimisticFixpoint(...)
+  ChangeStatus indicatePessimisticFixpoint() {
+    return IsValidState.indicatePessimisticFixpoint();
+  }
+
+  /// See AbstractState::indicateOptimisticFixpoint(...)
+  ChangeStatus indicateOptimisticFixpoint() {
+    return IsValidState.indicateOptimisticFixpoint();
+  }
+
+  /// Return the assumed state
+  PotentialValuesState &getAssumed() { return *this; }
+  const PotentialValuesState &getAssumed() const { return *this; }
 
   /// Return this set. We should check whether this set is valid or not by
   /// isValidState() before calling this function.
@@ -3465,6 +3485,9 @@
     Set = IntersectSet;
   }
 
+  /// A helper state which indicate whether this state is valid or not.
+  BooleanState IsValidState;
+
   /// Container for potential values
   SetTy Set;
 };


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85610.284243.patch
Type: text/x-patch
Size: 1851 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200810/07758d9c/attachment.bin>


More information about the llvm-commits mailing list