[PATCH] D131577: [MemorySanitizer] Support memcpy.inline and memset.inline

Marco Elver via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 08:29:32 PDT 2022


melver created this revision.
melver added reviewers: vitalybuka, dvyukov.
Herald added subscribers: Enna1, hiraditya.
Herald added a project: All.
melver requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Other sanitizers (ASan, TSan, see added tests) already handle
memcpy.inline and memset.inline by not relying on InstVisitor to turn
the intrinsics into calls.

Only MSan instrumentation currently does not support them due to missing
InstVisitor callbacks. Fix it.

While the mem*.inline intrinsics promise no calls to external functions
as an optimization, for the sanitizers we need to break this guarantee
since access into the runtime is required either way, and performance
can no longer be guaranteed. All other cases, where generating a call is
incorrect, should instead use no_sanitize.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131577

Files:
  llvm/include/llvm/IR/InstVisitor.h
  llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
  llvm/test/Instrumentation/AddressSanitizer/mem-intrinsics.ll
  llvm/test/Instrumentation/MemorySanitizer/msan_basic.ll
  llvm/test/Instrumentation/ThreadSanitizer/tsan_basic.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131577.451484.patch
Type: text/x-patch
Size: 7088 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220810/5ff735a8/attachment.bin>


More information about the llvm-commits mailing list