From b6acee5c7b190de451f4f4e13a82238cb3e68f6e Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Sun, 4 Aug 2019 17:55:15 +0000 Subject: [PATCH] [Attributor][NFC] Invalid DerefState is at fixpoint 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 llvm-svn: 367789 --- llvm/lib/Transforms/IPO/Attributor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp index 803152e..fabb50f 100644 --- a/llvm/lib/Transforms/IPO/Attributor.cpp +++ b/llvm/lib/Transforms/IPO/Attributor.cpp @@ -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(...) -- 2.7.4