[LLVMdev] [Patch, RFC] Re: Adding support for explicitly specified TLS models (PR9788)

Hans Wennborg hans at chromium.org
Tue Jun 5 02:37:04 PDT 2012


On Mon, Jun 4, 2012 at 11:10 PM, Rafael EspĂ­ndola
<rafael.espindola at gmail.com> wrote:
> On 4 June 2012 10:49, Hans Wennborg <hans at chromium.org> wrote:
>> Reviving this thread with a patch!
>>
>> And some comments inline.
>>
>> Please take a look and let me know what you think.
>
> Just a high level comment, why do you need the 4 modes + default?
> Can't clang just produce globaldynamic (or the attribute value) and
> let llvm optimize it? Since in the end the linker is allowed to relax
> tls access too, llvm should be allowed to make the mode more specific
> even if the user added an attribute at the C/C++ level.

I thought it was a good idea to make the user's choice explicit in the
IR. If we combined the default and globaldynamic modes, LLVM wouldn't
be able to tell the difference.

It may or may not be important to be able to tell the difference, but
it would be unfortunate if we'd have to go and change the IR format
later because we limited ourselves here.

Also, my patch does make a difference between the default and
globaldynamic. If user specifies globaldynamic, LLVM will use that
model, even if some other model would be better (it even adds support
for doing globadynamic in non-PIC code). GCC does the same.

Thanks,
Hans




More information about the llvm-dev mailing list