[PATCH] D43971: [AArch64] Implement native TLS for Windows

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 1 13:58:35 PST 2018


mstorsjo created this revision.
mstorsjo added reviewers: compnerd, efriedma, t.p.northover, peter.smith, aemerson, rnk.
Herald added subscribers: kristof.beyls, javed.absar, rengolin.

I've tried to add a separate pseudo instruction LOADgot32, to do the same as LOADgot, but only do a 32 bit load.

Likewise I tried adding a pseudo instruction ADDsecrel, which produces a sequence of

  add x0, x0, :secrel_hi12:tlsVar
  add x0, x0, :secrel_lo12:tlsVar

This works, but since the second add can be followed by a ldr/str (except for the cases when just getting the address of the tls var), the :secrel_lo12: part could ideally be folded into the load/store - this is not done as long as using the ADDsecrel pseudo instruction.

I'm quite unsure about the use and definition of the new pseudo instructions, I'm very open to suggestions on doing it better.


Repository:
  rL LLVM

https://reviews.llvm.org/D43971

Files:
  lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
  lib/Target/AArch64/AArch64ISelLowering.cpp
  lib/Target/AArch64/AArch64ISelLowering.h
  lib/Target/AArch64/AArch64InstrInfo.td
  lib/Target/AArch64/AArch64MCInstLower.cpp
  test/CodeGen/AArch64/win-tls.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43971.136600.patch
Type: text/x-patch
Size: 11721 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180301/3bda6288/attachment-0001.bin>


More information about the llvm-commits mailing list