Remove 'no_sanitize_memtag'. Add 'sanitize_memtag'.

For MTE globals, we should have clang emit the attribute for all GV's
that it creates, and then use that in the upcoming AArch64 global
tagging IR pass. We need a positive attribute for this sanitizer (rather
than implicit sanitization of all globals) because it needs to interact
with other parts of LLVM, including:

  1. Suppressing certain global optimisations (like merging),
  2. Emitting extra directives by the ASM writer, and
  3. Putting extra information in the symbol table entries.

While this does technically make the LLVM IR / bitcode format
non-backwards-compatible, nobody should have used this attribute yet,
because it's a no-op.

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D128950
This commit is contained in:
Mitch Phillips
2022-07-13 08:39:26 -07:00
parent 4f281fa2a8
commit 90e5a8ac47
12 changed files with 94 additions and 75 deletions

View File

@@ -3678,7 +3678,7 @@ GlobalValue::SanitizerMetadata deserializeSanitizerMetadata(unsigned V) {
if (V & (1 << 1))
Meta.NoHWAddress = true;
if (V & (1 << 2))
Meta.NoMemtag = true;
Meta.Memtag = true;
if (V & (1 << 3))
Meta.IsDynInit = true;
return Meta;