[PATCH] D15894: Implement load to store => memcpy in MemCpyOpt for aggregates

Amaury SECHET via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 5 11:20:08 PST 2016


deadalnix added inline comments.

================
Comment at: lib/Transforms/Scalar/MemCpyOptimizer.cpp:533
@@ +532,3 @@
+          // source and dest might overlap.  We still want to eliminate the intermediate
+          // value, but we have to generate a memmove instead of memcpy.
+          bool UseMemMove = false;
----------------
joker.eph wrote:
> not sure what you mean by " If the dest of the second might alias the source of the first", this sentence seems confusing to me. Is there more than `// If the load and the store alias, we have to use a memmove instead of a memcpy.` ?
If the memory location we load from and store to can somehow alias, we need to use memmove to preserve semantic. If they do not, we can use memcpy.


http://reviews.llvm.org/D15894





More information about the llvm-commits mailing list