[LLVMdev] ideas for TLS implementation

Lauro Ramos Venancio lauro.venancio at gmail.com
Wed Apr 11 14:06:32 PDT 2007


> This proposal sounds really good to me. I only have a couple comments.
>
> We have a "section" keyword already developed in LLVM assembly. Perhaps
> instead of introducing a new keyword we just do: section "TLS" ? This
> should reduce the amount of work needed to get the feature done.

This is not possible because the programmer can define the TLS section
name. The code

__thread int a __attribute__ ((section ("teste"))) = 1;

is valid.

> The "general dynamic" mechanism seems to be the way to start this. Get
> that working on all targets (not just X86 and ARM :) .. then move on to
> target specific optimizations.

Not only the optimizations are target specific. The ELF TLS manual has
a section for  each target for each TLS model. So, I think we will
have an TLS implementation similar to "LowerCallTo" (every backend
must implement or assert).

Thanks,
Lauro



More information about the llvm-dev mailing list