diff --git a/include/llvm/IR/Intrinsics.td b/include/llvm/IR/Intrinsics.td index d2b990691b1..62b5c0fc2a5 100644 --- a/include/llvm/IR/Intrinsics.td +++ b/include/llvm/IR/Intrinsics.td @@ -1503,22 +1503,24 @@ def int_xray_typedevent : Intrinsic<[], [llvm_i16_ty, llvm_ptr_ty, llvm_i32_ty], def int_memcpy_element_unordered_atomic : Intrinsic<[], [llvm_anyptr_ty, llvm_anyptr_ty, llvm_anyint_ty, llvm_i32_ty], - [IntrArgMemOnly, IntrWillReturn, NoCapture>, - NoCapture>, WriteOnly>, - ReadOnly>, ImmArg>]>; + [IntrArgMemOnly, IntrWillReturn, IntrNoSync, + NoCapture>, NoCapture>, + WriteOnly>, ReadOnly>, + ImmArg>]>; // @llvm.memmove.element.unordered.atomic.*(dest, src, length, elementsize) def int_memmove_element_unordered_atomic : Intrinsic<[], [llvm_anyptr_ty, llvm_anyptr_ty, llvm_anyint_ty, llvm_i32_ty], - [IntrArgMemOnly, IntrWillReturn, NoCapture>, - NoCapture>, WriteOnly>, - ReadOnly>, ImmArg>]>; + [IntrArgMemOnly, IntrWillReturn, IntrNoSync, + NoCapture>, NoCapture>, + WriteOnly>, ReadOnly>, + ImmArg>]>; // @llvm.memset.element.unordered.atomic.*(dest, value, length, elementsize) def int_memset_element_unordered_atomic : Intrinsic<[], [llvm_anyptr_ty, llvm_i8_ty, llvm_anyint_ty, llvm_i32_ty], - [IntrWriteMem, IntrArgMemOnly, IntrWillReturn, + [IntrWriteMem, IntrArgMemOnly, IntrWillReturn, IntrNoSync, NoCapture>, WriteOnly>, ImmArg>]>; diff --git a/lib/Transforms/IPO/AttributorAttributes.cpp b/lib/Transforms/IPO/AttributorAttributes.cpp index fa32a22059a..71d0146432c 100644 --- a/lib/Transforms/IPO/AttributorAttributes.cpp +++ b/lib/Transforms/IPO/AttributorAttributes.cpp @@ -1347,12 +1347,6 @@ bool AANoSyncImpl::isNonRelaxedAtomic(Instruction *I) { bool AANoSyncImpl::isNoSyncIntrinsic(Instruction *I) { if (auto *II = dyn_cast(I)) { switch (II->getIntrinsicID()) { - /// Element wise atomic memory intrinsics are can only be unordered, - /// therefore nosync. - case Intrinsic::memset_element_unordered_atomic: - case Intrinsic::memmove_element_unordered_atomic: - case Intrinsic::memcpy_element_unordered_atomic: - return true; case Intrinsic::memset: case Intrinsic::memmove: case Intrinsic::memcpy: diff --git a/test/Analysis/BasicAA/cs-cs.ll b/test/Analysis/BasicAA/cs-cs.ll index 4eb348a02bb..83c663933c6 100644 --- a/test/Analysis/BasicAA/cs-cs.ll +++ b/test/Analysis/BasicAA/cs-cs.ll @@ -389,7 +389,7 @@ entry: ; CHECK: attributes #0 = { argmemonly nofree nosync nounwind willreturn writeonly } ; CHECK-NEXT: attributes #1 = { argmemonly nofree nosync nounwind willreturn } -; CHECK-NEXT: attributes #2 = { argmemonly nounwind willreturn } +; CHECK-NEXT: attributes #2 = { argmemonly nosync nounwind willreturn } ; CHECK-NEXT: attributes #3 = { noinline nounwind readonly } ; CHECK-NEXT: attributes #4 = { noinline nounwind writeonly } ; CHECK-NEXT: attributes #5 = { nounwind ssp }