[PATCH] D96184: [AIX][TLS] Generate TLS variables in assembly files

David Tenty via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 22 15:47:58 PST 2021


daltenty added inline comments.


================
Comment at: llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp:2184
+  // Uninitialized local TLS symbols go into a csect with matching name which
+  // will get mapped into the .tbss section. Uninitialized external symbols are
+  // generated into the .tdata section.
----------------
Remove the second sentence here. Where other things get mapped depends on data-sections and other factors that aren't relevant to this block.


================
Comment at: llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp:2186
+  // generated into the .tdata section.
+  if (Kind.isBSSLocal() || GO->hasCommonLinkage() ||
+      (Kind.isThreadBSS() && GlobalValue::isLocalLinkage(GO->getLinkage()))) {
----------------
I'm thinking this condition is important enough for us to provide a convince function. Something like `isEligibleForCommonCsect` and use it in the other three places where this exact condition should appear.


================
Comment at: llvm/lib/MC/MCObjectFileInfo.cpp:891
+      SectionKind::getThreadData(), /* MultiSymbolsAllowed*/ true);
+
   TOCBaseSection =
----------------
We should initialize and use the `TLSBSSSection` where appropriate.


================
Comment at: llvm/test/CodeGen/PowerPC/aix-tls-variables.ll:52
+; CHECK-NEXT: .lcomm  tls4,4,tls4[UL],2
+; CHECK-NEXT: .csect  tls5[TL],2
+; CHECK-NEXT: .weak   tls5[TL]
----------------
Should probably be UL, since this is uninitialized


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96184



More information about the llvm-commits mailing list