[llvm-dev] JITted code and thread-local storage

Antoine Pitrou via llvm-dev llvm-dev at lists.llvm.org
Mon Aug 22 04:12:15 PDT 2016


Thanks for the answers, everyone.

In the end, we opted to not use the JIT for this.  We defer to some C
helpers, which exploit the C compiler and runtime linker's support for
thread-local variables.  This buys us portability without any hassle (at
the cost of an additional function call, though).

Regards

Antoine.



On Sun, 21 Aug 2016 11:17:47 -0700
Philip Reames via llvm-dev <llvm-dev at lists.llvm.org> wrote:

> We use GS based addressing in our code just fine.  We have a home grown 
> version of TLS, but I believe the principal mechanisms needed for the 
> Linux x86-64 version are similar.  The key thing you need is to use the 
> right address space (256 = GS, 257 = FS IRC) when describing the memory 
> locations.
> 
> Philip
> 
> On 08/17/2016 09:25 PM, Keno Fischer via llvm-dev wrote:
> > I had tried this in https://reviews.llvm.org/D8815, but we've since 
> > switched to a home grown TLS implementation, so I currently don't have 
> > a need for this.
> >
> > On Thu, Aug 18, 2016 at 12:17 AM, Alex Denisov via llvm-dev 
> > <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote:
> >
> >     /cc Lang Hames
> >
> >     > On 17 Aug 2016, at 19:27, Antoine Pitrou via llvm-dev
> >     <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote:
> >     >
> >     >
> >     > Hello,
> >     >
> >     > Am I right in thinking that MCJIT doesn't support thread-local
> >     > variables (at least not on Linux x86-64)?
> >     >
> >     > Is there any plan or pending PR to support it (either in MCJIT or in
> >     > ORC)?
> >     >
> >     > Thank you,
> >     >
> >     > Regards
> >     >
> >     > Antoine.
> >     >
> >     > _______________________________________________
> >     > LLVM Developers mailing list
> >     > llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>
> >     > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> >     <http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev>
> >
> >
> >     _______________________________________________
> >     LLVM Developers mailing list
> >     llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>
> >     http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> >     <http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev>
> >
> >
> >
> >
> > _______________________________________________
> > LLVM Developers mailing list
> > llvm-dev at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> 
> 
> 


More information about the llvm-dev mailing list