[PATCH] D111343: [x86] Implement a tagged-globals backend feature.

Matt Morehouse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 7 12:32:49 PDT 2021


morehouse created this revision.
morehouse added reviewers: pcc, eugenis, hctim, vitalybuka.
Herald added subscribers: pengfei, hiraditya.
morehouse requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The feature tells the backend to allow tags in the upper bits of global
variable addresses.  These tags will be ignored by upcoming CPUs with
the Intel LAM feature but may be used in instrumentation passes (e.g.,
HWASan).

This patch implements the feature by using @GOTPCREL relocations instead
of direct references to the locally defined global.  Thus the full
tagged address can be loaded by a single instruction:

  movq global at GOTPCREL(%rip), %rax


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D111343

Files:
  llvm/lib/Target/X86/X86.td
  llvm/lib/Target/X86/X86Subtarget.cpp
  llvm/lib/Target/X86/X86Subtarget.h
  llvm/test/CodeGen/X86/tagged-globals-pic.ll
  llvm/test/CodeGen/X86/tagged-globals-static.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111343.377964.patch
Type: text/x-patch
Size: 5057 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211007/c3b2bdc7/attachment.bin>


More information about the llvm-commits mailing list