Joerg Sonnenberger
2014-Dec-06 21:48 UTC
[LLVMdev] Memset/memcpy: user control of loop-idiom recognizer
On Sat, Dec 06, 2014 at 07:06:31AM -0600, Hal Finkel wrote:> - Direction (should the memory be traversed forward or backward)I don't think that this makes sense for memset and memcpy. It does matter for memmove. Joerg
Bruce Hoult
2014-Dec-06 22:13 UTC
[LLVMdev] Memset/memcpy: user control of loop-idiom recognizer
On Sun, Dec 7, 2014 at 10:48 AM, Joerg Sonnenberger <joerg at britannica.bec.de> wrote:> On Sat, Dec 06, 2014 at 07:06:31AM -0600, Hal Finkel wrote: > > - Direction (should the memory be traversed forward or backward) > > I don't think that this makes sense for memset and memcpy. It does > matter for memmove. >This "memcpy" is being generated by pattern-matching an explicit loop in the code. Direction is certainly something that needs to be kept the same as the original loop, if there is overlap. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141207/d257022e/attachment.html>
Joerg Sonnenberger
2014-Dec-07 18:45 UTC
[LLVMdev] Memset/memcpy: user control of loop-idiom recognizer
On Sun, Dec 07, 2014 at 11:13:51AM +1300, Bruce Hoult wrote:> On Sun, Dec 7, 2014 at 10:48 AM, Joerg Sonnenberger <joerg at britannica.bec.de > > wrote: > > > On Sat, Dec 06, 2014 at 07:06:31AM -0600, Hal Finkel wrote: > > > - Direction (should the memory be traversed forward or backward) > > > > I don't think that this makes sense for memset and memcpy. It does > > matter for memmove. > > > > This "memcpy" is being generated by pattern-matching an explicit loop in > the code. Direction is certainly something that needs to be kept the same > as the original loop, if there is overlap.The memcpy intrinsic must not be generated in case of overlap. Joerg
Hal Finkel
2014-Dec-08 08:40 UTC
[LLVMdev] Memset/memcpy: user control of loop-idiom recognizer
----- Original Message -----> From: "Joerg Sonnenberger" <joerg at britannica.bec.de> > To: llvmdev at cs.uiuc.edu > Sent: Saturday, December 6, 2014 3:48:32 PM > Subject: Re: [LLVMdev] Memset/memcpy: user control of loop-idiom recognizer > > On Sat, Dec 06, 2014 at 07:06:31AM -0600, Hal Finkel wrote: > > - Direction (should the memory be traversed forward or backward) > > I don't think that this makes sense for memset and memcpy. It does > matter for memmove.I was trying to list things that might affect performance. Even for memcpy, the direction can matter for performance, depending on how the hardware prefetcher and other parts of the memory subsystem work. -Hal> > Joerg > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-- Hal Finkel Assistant Computational Scientist Leadership Computing Facility Argonne National Laboratory