[PATCH] D71688: [AArch64] Add -mtls-size option for ELF targets

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 7 06:09:38 PST 2020


peter.smith added a comment.

In D71688#1807788 <https://reviews.llvm.org/D71688#1807788>, @kawashima-fj wrote:

> In D71688#1807684 <https://reviews.llvm.org/D71688#1807684>, @peter.smith wrote:
>
> > Apologies for the delay in responding, just come back from vacation. I've checked the implementation against GCC and it looks like it will give the same behaviour. I've got one minor suggestion surrounding the clamping of TLSSize to its maximum value. It looks like it would only need to be done once, is there a convenient place, such as AArch64TargetMachine where it can be done once?
>
>
> No need to apologize. I know many people are in vacation last two or three weeks.
>
> I'm not sure whether I understand your suggestion correctly. Do you mean the following code in the `LowerELFTLSLocalExec` function should be in a function in `AArch64TargetMachine` or somewhere which is called only once because `LowerELFTLSLocalExec` is called for every thread local variable? If so, it makes sense. I'll find a convenient place.
>
>   if (TLSSize == 0) // default
>     TLSSize = 24;
>   if ((CModel == CodeModel::Small || CModel == CodeModel::Kernel) &&
>       TLSSize > 32)
>     // for the small (and kernel) code model, the maximum TLS size is 4GiB
>     TLSSize = 32;
>   else if (CModel == CodeModel::Tiny && TLSSize > 24)
>     // for the tiny code model, the maximum TLS size is 1MiB (< 16MiB)
>     TLSSize = 24;
>   


Ideally somewhere only called once, I mentioned AArch64TargetMachine as it came to mind as a potential example although there may be better places available. Apologies for the confusion.


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

https://reviews.llvm.org/D71688





More information about the llvm-commits mailing list