[all-commits] [llvm/llvm-project] 9a05fa: [HWASan] [GlobalISel] Add +tagged-globals backend ...

Mitch Phillips via All-commits all-commits at lists.llvm.org
Mon Aug 3 14:29:18 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 9a05fa10bd05525adedb6117351333699a3d4ae2
      https://github.com/llvm/llvm-project/commit/9a05fa10bd05525adedb6117351333699a3d4ae2
  Author: Mitch Phillips <31459023+hctim at users.noreply.github.com>
  Date:   2020-08-03 (Mon, 03 Aug 2020)

  Changed paths:
    A compiler-rt/test/hwasan/TestCases/exported-tagged-global.c
    M llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
    M llvm/test/CodeGen/AArch64/tagged-globals.ll

  Log Message:
  -----------
  [HWASan] [GlobalISel] Add +tagged-globals backend feature for GlobalISel

GlobalISel is the default ISel for aarch64 at -O0. Prior to D78465, GlobalISel
didn't have support for dealing with address-of-global lowerings, so it fell
back to SelectionDAGISel.

HWASan Globals require special handling, as they contain the pointer tag in the
top 16-bits, and are thus outside the code model. We need to generate a `movk`
in the instruction sequence with a G3 relocation to ensure the bits are
relocated properly. This is implemented in SelectionDAGISel, this patch does
the same for GlobalISel.

GlobalISel and SelectionDAGISel differ in their lowering sequence, so there are
differences in the final instruction sequence, explained in
`tagged-globals.ll`. Both of these implementations are correct, but GlobalISel
is slightly larger code size / slightly slower (by a couple of arithmetic
instructions). I don't see this as a problem for now as GlobalISel is only on
by default at `-O0`.

Reviewed By: aemerson, arsenm

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




More information about the All-commits mailing list