Keno Fischer via llvm-dev
2016-Aug-18 04:25 UTC
[llvm-dev] JITted code and thread-local storage
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> wrote:> /cc Lang Hames > > > On 17 Aug 2016, at 19:27, Antoine Pitrou via llvm-dev < > 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 > > 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 > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160818/1956cf65/attachment.html>
Philip Reames via llvm-dev
2016-Aug-21 18:17 UTC
[llvm-dev] JITted code and thread-local storage
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-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160821/072fe99d/attachment.html>
Antoine Pitrou via llvm-dev
2016-Aug-22 11:12 UTC
[llvm-dev] JITted code and thread-local storage
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 > > >