[PATCH] D127911: Delete 'llvm.asan.globals' for global metadata.

Mitch Phillips via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 15 15:51:15 PDT 2022


hctim created this revision.
hctim added a reviewer: vitalybuka.
Herald added subscribers: Enna1, ormris, hiraditya.
Herald added a project: All.
hctim requested review of this revision.
Herald added projects: clang, Sanitizers, LLVM.
Herald added subscribers: llvm-commits, Sanitizers, cfe-commits.

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 ~0.275% of the optimised clang binary.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D127911

Files:
  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.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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127911.437382.patch
Type: text/x-patch
Size: 47726 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220615/981aa01f/attachment-0001.bin>


More information about the cfe-commits mailing list