[PATCH] D151458: [RISCV] Support TLSDESC in the RISC-V backend
Paul Kirth via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 25 08:41:22 PDT 2023
paulkirth created this revision.
paulkirth added reviewers: asb, jrtc27, craig.topper.
Herald added subscribers: jobnoorman, luke, VincentWu, vkmr, frasercrmck, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, arichardson.
Herald added a project: All.
paulkirth requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead, eopXD, MaskRay.
Herald added a project: LLVM.
TLS Descriptors (TLSDESC) are an alternative implementation of the
Global Dynamic model that allows the dynamic linker to achieve
performance close to that of Initial Exec when the library was not
loaded dynamically with `dlopen`. For each `TLSDESC` relocation inside
the GOT, the dynamic linker fills in the TLS descriptor.
This patch adds basic support in the RISC-V backend by adding new
relocation types and some new pseudo instructions. Optimization for the
local dynamic case will be handled in future patches.
The implementation is currently only enabled by passing the
`riscv-enable-tlsdesc` flag, since support in libc is not generally
available yet. Subsequent patches can enable TLSDESC by default for
RISCV.
This work is based on the RISC-V psABI proposal:
https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/373
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D151458
Files:
llvm/include/llvm/BinaryFormat/ELFRelocs/RISCV.def
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp
llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h
llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp
llvm/lib/Target/RISCV/MCTargetDesc/RISCVFixupKinds.h
llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp
llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp
llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.h
llvm/lib/Target/RISCV/RISCVExpandPseudoInsts.cpp
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/lib/Target/RISCV/RISCVISelLowering.h
llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
llvm/lib/Target/RISCV/RISCVInstrInfo.td
llvm/lib/Target/RISCV/RISCVMCInstLower.cpp
llvm/lib/Target/RISCV/RISCVMachineFunctionInfo.h
llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
llvm/test/CodeGen/RISCV/tls-models.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151458.525639.patch
Type: text/x-patch
Size: 36537 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230525/011c2592/attachment.bin>
More information about the llvm-commits
mailing list