diff --git a/lib/Transforms/IPO/AttributorAttributes.cpp b/lib/Transforms/IPO/AttributorAttributes.cpp index 309c692d454..170377fdc48 100644 --- a/lib/Transforms/IPO/AttributorAttributes.cpp +++ b/lib/Transforms/IPO/AttributorAttributes.cpp @@ -7097,6 +7097,9 @@ ChangeStatus AAMemoryBehaviorFloating::updateImpl(Attributor &A) { return ChangeStatus::UNCHANGED; } + // The current assumed state used to determine a change. + auto AssumedState = S.getAssumed(); + // Make sure the value is not captured (except through "return"), if // it is, any information derived would be irrelevant anyway as we cannot // check the potential aliases introduced by the capture. However, no need @@ -7105,12 +7108,10 @@ ChangeStatus AAMemoryBehaviorFloating::updateImpl(Attributor &A) { A.getAAFor(*this, IRP, DepClassTy::OPTIONAL); if (!ArgNoCaptureAA.isAssumedNoCaptureMaybeReturned()) { S.intersectAssumedBits(FnMemAssumedState); - return ChangeStatus::CHANGED; + return (AssumedState != getAssumed()) ? ChangeStatus::CHANGED + : ChangeStatus::UNCHANGED; } - // The current assumed state used to determine a change. - auto AssumedState = S.getAssumed(); - // Visit and expand uses until all are analyzed or a fixpoint is reached. auto UsePred = [&](const Use &U, bool &Follow) -> bool { Instruction *UserI = cast(U.getUser());