Eli Friedman
2013-Jun-13 03:08 UTC
[LLVMdev] A question w.r.t fence instruction vs. noalias pointer
On Wed, Jun 12, 2013 at 7:28 PM, Guo, Xiaoyi <Xiaoyi.Guo at amd.com> wrote:> So fence only forces ordering of atomic instructions.**** > > ** ** > > Let me change my question then.**** > > ** ** > > If I have a target-specific intrinsic which forces ordering of ordinary > load/store instructions. Then should it also force ordering of load/stores > to noalias pointers in caller functions? >So, something like 'asm volatile ("":::"memory")'? LLVM can and will move noalias loads/stores across an asm statement like this; it assumes noalias means "nothing inside this function will touch the memory in question except accesses through this pointer". -Eli -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130612/4c7fa718/attachment.html>
Guo, Xiaoyi
2013-Jun-13 17:52 UTC
[LLVMdev] A question w.r.t fence instruction vs. noalias pointer
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? Xiaoyi From: Eli Friedman [mailto:eli.friedman at gmail.com] Sent: Wednesday, June 12, 2013 8:08 PM To: Guo, Xiaoyi Cc: LLVM Dev Subject: Re: [LLVMdev] A question w.r.t fence instruction vs. noalias pointer On Wed, Jun 12, 2013 at 7:28 PM, Guo, Xiaoyi <Xiaoyi.Guo at amd.com<mailto:Xiaoyi.Guo at amd.com>> wrote: So fence only forces ordering of atomic instructions. Let me change my question then. If I have a target-specific intrinsic which forces ordering of ordinary load/store instructions. Then should it also force ordering of load/stores to noalias pointers in caller functions? So, something like 'asm volatile ("":::"memory")'? LLVM can and will move noalias loads/stores across an asm statement like this; it assumes noalias means "nothing inside this function will touch the memory in question except accesses through this pointer". -Eli -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130613/eb295b8e/attachment.html>
Eli Friedman
2013-Jun-13 18:18 UTC
[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> 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/42b9dd40/attachment.html>
Possibly Parallel Threads
- [LLVMdev] A question w.r.t fence instruction vs. noalias pointer
- [LLVMdev] A question w.r.t fence instruction vs. noalias pointer
- [LLVMdev] A question w.r.t fence instruction vs. noalias pointer
- [LLVMdev] A question w.r.t fence instruction vs. noalias pointer
- [LLVMdev] A question w.r.t fence instruction vs. noalias pointer