Delete 'llvm.asan.globals' for global metadata.
authorMitch Phillips <31459023+hctim@users.noreply.github.com>
Mon, 27 Jun 2022 21:40:03 +0000 (14:40 -0700)
committerMitch Phillips <31459023+hctim@users.noreply.github.com>
Mon, 27 Jun 2022 21:40:40 +0000 (14:40 -0700)
commitdacfa24f75c328ae30b710ecadaa18e4ba10cdc6
tree5907c9021a781e57de8be7c58ff0d15b6b70b77a
parentdf18167ac56d05f2ab55f9d874aee7ab6d5bc9a2
Delete 'llvm.asan.globals' for global metadata.

Now that we have the sanitizer metadata that is actually on the global
variable, and now that we use debuginfo in order to do symbolization of
globals, we can delete the 'llvm.asan.globals' IR synthesis.

This patch deletes the 'location' part of the __asan_global that's
embedded in the binary as well, because it's unnecessary. This saves
about ~1.7% of the optimised non-debug with-asserts clang binary.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D127911
20 files changed:
clang/lib/CodeGen/BackendUtil.cpp
clang/lib/CodeGen/SanitizerMetadata.cpp
clang/lib/CodeGen/SanitizerMetadata.h
clang/test/CodeGen/asan-globals.cpp
clang/test/CodeGen/hwasan-globals.cpp
clang/test/CodeGen/memtag-globals.cpp
clang/test/CodeGen/sanitize-init-order.cpp
compiler-rt/test/asan/TestCases/global-location-nodebug.cpp
compiler-rt/test/asan/TestCases/global-location.cpp
llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h
llvm/lib/Passes/PassRegistry.def
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
llvm/test/Instrumentation/AddressSanitizer/global_metadata.ll
llvm/test/Instrumentation/AddressSanitizer/global_metadata_array.ll
llvm/test/Instrumentation/AddressSanitizer/global_with_comdat.ll
llvm/test/Instrumentation/AddressSanitizer/instrument_global.ll
llvm/test/Instrumentation/AddressSanitizer/instrument_initializer_metadata.ll
llvm/test/Instrumentation/AddressSanitizer/win-string-literal.ll
llvm/test/Instrumentation/SanitizerCoverage/tracing-comdat.ll
llvm/tools/opt/NewPMDriver.cpp