diff --git a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp index 3c3252e7179c4..d682de6e3c484 100644 --- a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp +++ b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp @@ -1071,11 +1071,13 @@ struct AAPointerInfoImpl SmallVector, 8> InterferingAccesses; Function &Scope = *I.getFunction(); - const auto *NoSyncAA = A.getAAFor( - QueryingAA, IRPosition::function(Scope), DepClassTy::OPTIONAL); + bool IsKnownNoSync; + bool IsAssumedNoSync = AA::hasAssumedIRAttr( + A, &QueryingAA, IRPosition::function(Scope), DepClassTy::OPTIONAL, + IsKnownNoSync); const auto *ExecDomainAA = A.lookupAAFor( IRPosition::function(Scope), &QueryingAA, DepClassTy::NONE); - bool AllInSameNoSyncFn = NoSyncAA && NoSyncAA->isAssumedNoSync(); + bool AllInSameNoSyncFn = IsAssumedNoSync; bool InstIsExecutedByInitialThreadOnly = ExecDomainAA && ExecDomainAA->isExecutedByInitialThreadOnly(I); bool InstIsExecutedInAlignedRegion =