[all-commits] [llvm/llvm-project] 486729: Re-land: [MTE] Add AArch64GlobalsTagging Pass

Mitch Phillips via All-commits all-commits at lists.llvm.org
Tue Jan 31 13:04:01 PST 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 486729ce06c1efeb3315be1b810afcddf715dacb
  Author: Mitch Phillips <31459023+hctim at users.noreply.github.com>
  Date:   2023-01-31 (Tue, 31 Jan 2023)

  Changed paths:
    A clang/test/CodeGen/memtag-globals-asm.cpp
    M llvm/lib/CodeGen/GlobalMerge.cpp
    M llvm/lib/Target/AArch64/AArch64.h
    A llvm/lib/Target/AArch64/AArch64GlobalsTagging.cpp
    M llvm/lib/Target/AArch64/AArch64Subtarget.cpp
    M llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
    M llvm/lib/Target/AArch64/CMakeLists.txt
    M llvm/test/CodeGen/AArch64/O0-pipeline.ll
    M llvm/test/CodeGen/AArch64/O3-pipeline.ll

  Log Message:
  Re-land: [MTE] Add AArch64GlobalsTagging Pass

Adds an IR pass for -fsanitize=memtag-globals. This pass goes over the
tag-capable global variables, and replaces them with a tagged global
variable of the same contents. This new global variable will have its
size and alignment adjusted if neccesary so that they're both a multiple
of the tag granule size (16 bytes).

Global merge must also be suppressed for tagged globals, as each global
variable must have a unique tag. This can possibly be relaxed in future;
globals that are identical in size, alignment, and content can possibly
be merged. The major problem comes from tail- or head-merging, which if
left unchecked, could have partially-overlapping global variables with
different memory tags, leading to crashes at runtime.

Reviewed By: fmayer, eugenis

Differential Revision: https://reviews.llvm.org/D133392

More information about the All-commits mailing list