]> granicus.if.org Git - llvm/commitdiff
[Attributor][NFC] Invalid DerefState is at fixpoint
authorJohannes Doerfert <jdoerfert@anl.gov>
Sun, 4 Aug 2019 17:55:15 +0000 (17:55 +0000)
committerJohannes Doerfert <jdoerfert@anl.gov>
Sun, 4 Aug 2019 17:55:15 +0000 (17:55 +0000)
Summary:
If the DerefBytesState (and thereby the DerefState) is invalid, we
reached a fixpoint for the whole DerefState as we will not
manifest/provide information then.

Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367789 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/Attributor.cpp

index 803152ef81244b598172e65313bf978c59b9ab14..fabb50fb38a6d8323993bf9a337fbc2267838d6e 100644 (file)
@@ -1757,9 +1757,10 @@ struct DerefState : AbstractState {
   /// See AbstractState::isValidState()
   bool isValidState() const override { return DerefBytesState.isValidState(); }
 
-  // See AbstractState::isAtFixpoint()
+  /// See AbstractState::isAtFixpoint()
   bool isAtFixpoint() const override {
-    return DerefBytesState.isAtFixpoint() && NonNullGlobalState.isAtFixpoint();
+    return !isValidState() || (DerefBytesState.isAtFixpoint() &&
+                               NonNullGlobalState.isAtFixpoint());
   }
 
   /// See AbstractState::indicateOptimisticFixpoint(...)