[LLVMdev] A question w.r.t fence instruction vs. noalias pointer

Guo, Xiaoyi Xiaoyi.Guo at amd.com
Thu Jun 13 11:39:57 PDT 2013


In a multi-threaded environment, in order to ensure the memory ordering expressed by the memory fence, certain memory operations should not be moved across the fence, right?


From: Eli Friedman [mailto:eli.friedman at gmail.com]
Sent: Thursday, June 13, 2013 11:18 AM
To: Guo, Xiaoyi
Cc: LLVM Dev
Subject: Re: [LLVMdev] A question w.r.t fence instruction vs. noalias pointer

On Thu, Jun 13, 2013 at 10:52 AM, Guo, Xiaoyi <Xiaoyi.Guo at amd.com<mailto:Xiaoyi.Guo at amd.com>> wrote:
I mean something like a target-specific fence machine instruction which forces ordering of all loads/stores. I want to clarify the meaning of "noalias" in this case. Is the fence machine instruction considered "touching" all memory and thus breaks the "noalias" contract?
A fence doesn't modify memory in the sense LLVM cares about.  It's a no-op in a single-threaded environment, and in a multi-threaded environment it's just a way to express ordering on memory modifications made by other threads.

-Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130613/b23dbc7f/attachment.html>


More information about the llvm-dev mailing list