[PATCH] D152899: Introduce RThreadAccess pass

Yevgeny Rouban via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 14 04:54:24 PDT 2023


yrouban created this revision.
yrouban added reviewers: skatkov, danilaml, hfinkel, trong, arsenm.
Herald added subscribers: pengfei, hiraditya, kristof.beyls.
Herald added a project: All.
yrouban requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

If the option -rthread-register=<register-name> is specified then:

- Protect rthread register from register allocation.
- Add rhread register as a base pointer to pointer operand of load and store instructions if the pointer operand has addrspace(X), where X is specified with -rthread-addrspace option (256 by default).

This pass might be useful for Thread Local Access operations with a dedicated TLS register.

RThreadAccess is added to X86 and AArch64 pipeline in addPreISel() and can be added to other targets as needed.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152899

Files:
  llvm/include/llvm/Transforms/Scalar/RThreadAccess.h
  llvm/lib/Passes/PassBuilder.cpp
  llvm/lib/Passes/PassRegistry.def
  llvm/lib/Target/AArch64/AArch64Subtarget.cpp
  llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/lib/Target/X86/X86RegisterInfo.cpp
  llvm/lib/Target/X86/X86TargetMachine.cpp
  llvm/lib/Transforms/Scalar/CMakeLists.txt
  llvm/lib/Transforms/Scalar/RThreadAccess.cpp
  llvm/test/CodeGen/AArch64/rthread.ll
  llvm/test/CodeGen/X86/named-reg-alloc.ll
  llvm/test/CodeGen/X86/rthread.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152899.531262.patch
Type: text/x-patch
Size: 39867 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230614/f0b89475/attachment.bin>


More information about the llvm-commits mailing list