[llvm] r173974 - ...in light of recent activity related to llvm.memcpy flags. I want to

Andrew Trick atrick at apple.com
Wed Jan 30 13:19:35 PST 2013


Author: atrick
Date: Wed Jan 30 15:19:35 2013
New Revision: 173974

URL: http://llvm.org/viewvc/llvm-project?rev=173974&view=rev
Log:
...in light of recent activity related to llvm.memcpy flags. I want to
prevent an llvm developer from mistakenly thinking that just because the
intrinsic has volatile flags that volatile operations can be converted
to or folded into them.

Platforms may rely on volatile loads and stores of natively supported
data width to be executed as single instruction. When compiling
C, this expectation likely holds for l-values of volatile primitive
types with native hardware support, but not necessarily for aggregate
types. The frontend upholds these expectations, which are not
specified in the IR.

Modified:
    llvm/trunk/docs/LangRef.rst

Modified: llvm/trunk/docs/LangRef.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.rst?rev=173974&r1=173973&r2=173974&view=diff
==============================================================================
--- llvm/trunk/docs/LangRef.rst (original)
+++ llvm/trunk/docs/LangRef.rst Wed Jan 30 15:19:35 2013
@@ -1080,6 +1080,11 @@ volatile operations. The optimizers *may
 operations relative to non-volatile operations. This is not Java's
 "volatile" and has no cross-thread synchronization behavior.
 
+IR-level volatile loads and stores cannot safely be optimized into
+llvm.memcpy or llvm.memmove intrinsics even when those intrinsics are
+flagged volatile. Likewise, the backend should never split or merge
+target-legal volatile load/store instructions.
+
 .. _memmodel:
 
 Memory Model for Concurrent Operations





More information about the llvm-commits mailing list