<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I think setting MaxStoresPerMemcpy to zero (eg. <span style="font-family:Arial,Helvetica,sans-serif">lib/Target/X86/X86ISelLowering.cpp</span>) may do the trick. As it does not seem to be a flag, it would require a source edit.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 27, 2020 at 9:26 AM Matt Fysh via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Similar to how `operator new(size)` can be overridden during linking, to capture and customize all memory allocation operations, I'd like to be able to capture all scenarios where memory is copied or moved. I've tried to use `--wrap memcpy` with some success, however I've noticed that in some instances (e.g. copying a small struct) the memcpy instruction in the IR is replaced with a sequence of movq instructions, and the wrap function is not able to hook into that piece of the code.<div><br></div><div>Is there a way to ensure all llvm.memcpy intrinsics in the IR are always lowered to call the memcpy symbol?</div><div><br></div><div>Failing that approach, can you suggest other ways to plug into the desired memory options? I'd like to hook into every memory operation that has a source and a destination address (copy, move, etc) so I can trace the passage of symbols through an executing program.</div><div><br></div><div>Thankyou</div></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>