[llvm-dev] RFC: Add atomic versions of the llvm.memcpy, llvm.memmove and llvm.memset intrinsics

Igor Laevsky via llvm-dev llvm-dev at lists.llvm.org
Fri Nov 11 08:38:44 PST 2016

> On Fri, Nov 11, 2016 at 02:13:26PM +0000, Igor Laevsky via llvm-dev wrote:
>> LLVM's memory intrinsics are quite useful for performing various optimizations
>> with frequently used memory operations. Unfortunately this intrinsics are not applicable for
>> languages with guaranteed atomicity for their memory accesses (like Java for example).
> At the very least, it is a extremely bad name. The operation is not
> atomic at all, it is piecewise at most. I don't see how this is any
> better than just using an explicit loop, given that any lowering is
> highly unlikely to be able to do anything different.

Idea is that we want to leverage LoopIdiomRecognize and MemCpyOptimizer passes. However we can’t do
this because all our memory accesses are atomic and regular memcpy doesn't have any atomicity guarantees.

I agree, name isn’t the best one. How about “memcpy_element_atomic” or something in this manner?

> Joerg
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

More information about the llvm-dev mailing list