[PATCH] D143159: [SanitizerBinaryMetadata] Treat constant globals and non-escaping addresses specially

Marco Elver via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 2 03:20:22 PST 2023


melver added inline comments.


================
Comment at: llvm/lib/Transforms/Instrumentation/SanitizerBinaryMetadata.cpp:383
+      !PointerMayBeCaptured(Addr, true, true)) {
+    // The addressable object is on the stack and does not escape.
+    return false;
----------------
dvyukov wrote:
> What if we pretend these are atomic as well?
Marking things as atomic increases binary size. It's better to just not emit any metadata (less space used).

There are plenty function-local objects and if we mark all accesses to them as atomic, we'll end up with larger binaries.

Of course this will only help if all accesses in a function are non-escaping. If there's at least e.g. 1 global access, the function will end up being "covered" with atomics metadata again.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143159/new/

https://reviews.llvm.org/D143159



More information about the llvm-commits mailing list