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

Joerg Sonnenberger joerg at britannica.bec.de
Tue Jun 12 08:09:26 PDT 2012


On Tue, Jun 12, 2012 at 10:41:37AM -0400, Rafael EspĂ­ndola wrote:
> > 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.
> 
> Do you know what is the rationale for that? The static linker will
> optimize it anyway (but not do as good a job as the compiler could).

codegen can be more efficient. E.g. less or no calls to __tls_get_addr
needed.

Joerg



More information about the llvm-dev mailing list