[llvm-commits] [llvm] r120974 - in /llvm/trunk: include/llvm/Analysis/AliasAnalysis.h lib/Transforms/Scalar/DeadStoreElimination.cpp test/Transforms/DeadStoreElimination/simple.ll

Duncan Sands baldrick at free.fr
Mon Dec 6 11:56:22 PST 2010


Hi Chris,

>> I've been told that on some platforms zeroing the target memory before doing the
>> copy speeds it up due to cache effects.  It looks like clang's implementation
>> of struct copy will not work on such targets.
>
> GCC also uses memcpy.  If we find one of these theoretical platforms, clang can always generate memmove on it.

I always used to think that GCC used builtin_memcpy, which it lowered to its own
memcpy implementation rather than calling the system memcpy, and so was not
subject to the whims of funky system memcpy implementations.  But I just took a
look and it seems that I was wrong and the system memcpy may be used :)

By the way, presumably when the optimizers see a memcpy of a pointer to itself
it removes the memcpy if it is non-volatile.

Ciao, Duncan.



More information about the llvm-commits mailing list