[PATCH] D61226: [AArch64] Add an option to get the TLS pointer from software

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 30 18:44:30 PDT 2019


efriedma added a comment.

How did you come up with the name __aarch64_read_tp?  I guess it's okay.

> which puts the TLS pointer at a calculated offset from TPIDR_EL0

I don't really understand how this is different from normal ELF TLS; does the offset vary at runtime somehow?



================
Comment at: lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp:525
+            .addExternalSymbol("__aarch64_read_tp")
+            .addReg(DstReg, RegState::Dead)
+            .cloneMemRefs(MI);
----------------
Is this addReg necessary?  The definition of X0 is an implicit definition, so it should be copied by transferImpOps, unless I'm missing something.

RegState::Dead doesn't make any sense.


================
Comment at: test/CodeGen/AArch64/readtp.ll:11
+
+ at counter = thread_local local_unnamed_addr global i32 0, align 4
+
----------------
Would it make sense to modify one of the existing tests for this, like arm64-tls-dynamics.ll, instead of adding a separate test file?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61226/new/

https://reviews.llvm.org/D61226





More information about the llvm-commits mailing list