[PATCH] D140123: [TLS] Clamp the alignment of TLS global variables if required by the target

Wolfgang Pieb via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 15 10:49:42 PST 2022


wolfgangp created this revision.
wolfgangp added reviewers: probinson, arsenm, fhahn.
Herald added subscribers: pengfei, hiraditya.
Herald added a project: All.
wolfgangp requested review of this revision.
Herald added subscribers: pcwang-thead, wdng.
Herald added a project: LLVM.

Some platforms (e.g. Playstation) limit the alignment of TLS variables (and the sections they're in). It's possible for optimization passes such as the vectorizer to generate code that then requires the promotion of such variables to an alignment that exceeds the maximum. To address this we're suggesting to add a new component to the data layout string that contains the maximum alignment of TLS variables a target allows. This component uses the key 'T', as in ...-T256. In its absence the alignment of TLS variables remains unrestricted.

In this patch the Playstation platform is the only one that uses this component.

Apologies for the somewhat lengthy test case. It's the loop vectorizer pass we're mainly concerned with.


https://reviews.llvm.org/D140123

Files:
  clang/lib/Basic/Targets/OSTargets.h
  clang/test/CodeGen/ps-datalayout.c
  llvm/include/llvm/IR/DataLayout.h
  llvm/lib/IR/DataLayout.cpp
  llvm/lib/Target/X86/X86TargetMachine.cpp
  llvm/lib/Transforms/Utils/Local.cpp
  llvm/test/CodeGen/X86/tls-align.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140123.483229.patch
Type: text/x-patch
Size: 7208 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221215/05556cff/attachment.bin>


More information about the llvm-commits mailing list