[sanitizers] Invalidate GlobalsAA
authorVitaly Buka <vitalybuka@google.com>
Wed, 7 Sep 2022 02:20:59 +0000 (19:20 -0700)
committerVitaly Buka <vitalybuka@google.com>
Thu, 8 Sep 2022 21:00:43 +0000 (14:00 -0700)
commit0f2f1c2be164810da96f2bc7229ef56f54c7d137
tree2be7a2ecf519e09388c06426ed5e878a698b6d63
parent2f23dc9127e6c0ef392f163cbaa58afcb7b61a09
[sanitizers] Invalidate GlobalsAA

GlobalsAA is considered stateless as usually transformations do not introduce
new global accesses, and removed global access is not a problem for GlobalsAA
users.
Sanitizers introduce new global accesses:
 - Msan and Dfsan tracks origins and parameters with TLS, and to store stack origins.
  - Sancov uses global counters. HWAsan store tag state in TLS.
  - Asan modifies globals, but I am not sure if invalidation is required.

I see no evidence that TSan needs invalidation.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D133394
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
llvm/test/Instrumentation/MemorySanitizer/invalidate_global_aa.ll [new file with mode: 0644]
llvm/test/Instrumentation/MemorySanitizer/msan_invalidate.ll [new file with mode: 0644]