diff --git a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp --- a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp +++ b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp @@ -1281,9 +1281,6 @@ /// atomic. In other words, if an atomic instruction does not have unordered /// or monotonic ordering static bool isNonRelaxedAtomic(Instruction *I); - - /// Helper function specific for intrinsics which are potentially volatile - static bool isNoSyncIntrinsic(Instruction *I); }; bool AANoSyncImpl::isNonRelaxedAtomic(Instruction *I) { @@ -1319,15 +1316,6 @@ Ordering != AtomicOrdering::Monotonic); } -/// Return true if this intrinsic is nosync. This is only used for intrinsics -/// which would be nosync except that they have a volatile flag. All other -/// intrinsics are simply annotated with the nosync attribute in Intrinsics.td. -bool AANoSyncImpl::isNoSyncIntrinsic(Instruction *I) { - if (auto *MI = dyn_cast(I)) - return !MI->isVolatile(); - return false; -} - ChangeStatus AANoSyncImpl::updateImpl(Attributor &A) { auto CheckRWInstForNoSync = [&](Instruction &I) { @@ -1337,9 +1325,6 @@ if (CB->hasFnAttr(Attribute::NoSync)) return true; - if (isNoSyncIntrinsic(&I)) - return true; - const auto &NoSyncAA = A.getAAFor( *this, IRPosition::callsite_function(*CB), DepClassTy::REQUIRED); return NoSyncAA.isAssumedNoSync(); diff --git a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp --- a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp +++ b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp @@ -1516,13 +1516,6 @@ if (CB->hasFnAttr(Attribute::NoSync)) return false; - // Non volatile memset/memcpy/memmoves are nosync - // NOTE: Only intrinsics with volatile flags should be handled here. All - // others should be marked in Intrinsics.td. - if (auto *MI = dyn_cast(&I)) - if (!MI->isVolatile()) - return false; - // Speculatively assume in SCC. if (Function *Callee = CB->getCalledFunction()) if (SCCNodes.contains(Callee))