[Diffusion] rL257984: [Cygwin] Use -femulated-tls by default since r257718 introduced the new pass.

Chih-hung Hsieh via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 19 19:16:36 PST 2016


Glad to see that emutls is useful for Cygwin too.
The diff in rL257984 do not look like depending on rL257718.
It might work with my earlier implementation of emutls, before rL257718.
Anyway, I did not test on Cygwin, and don't care if rL257984 is in 3.8 or
not.
Thanks.


On Tue, Jan 19, 2016 at 4:01 PM, NAKAMURA Takumi <geek4civic at gmail.com>
wrote:

> Ah yes, I was confused. No need to pick up r257984. Sorry for the noise.
>
> On Wed, Jan 20, 2016 at 8:54 AM Hans Wennborg <hans at chromium.org> wrote:
>
>> On Tue, Jan 19, 2016 at 3:43 PM, NAKAMURA Takumi <geek4civic at gmail.com>
>> wrote:
>> > May I push it (llvm and clang) into release_38?
>> > It depends on r257718.
>>
>> r257718 was committed after the branch. Are you suggesting we merge that
>> too?
>>
>> This looks like a pretty significant change. Can't it wait until 3.9?
>>
>>
>> > 2016-01-16 12:48 GMT+09:00 NAKAMURA Takumi <geek4civic at gmail.com>:
>> >> chapuni committed rL257984: [Cygwin] Use -femulated-tls by default
>> since r257718 introduced the new pass..
>> >>
>> >> [Cygwin] Use -femulated-tls by default since r257718 introduced the
>> new pass.
>> >>
>> >> FIXME: Add more targets to use emutls into
>> clang/test/Driver/emulated-tls.cpp.
>> >> FIXME: Add cygwin tests into llvm/test/CodeGen/X86. Working in
>> progress.
>> >>
>> >>
>> >> Files:
>> >>   /cfe/trunk/docs/ReleaseNotes.rst
>> >>   /cfe/trunk/lib/Driver/Tools.cpp
>> >>   /cfe/trunk/test/Driver/emulated-tls.cpp
>> >>   /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
>> >>
>> >> PATCH
>> >>
>> >> Index: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
>> >> ===================================================================
>> >> --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp       (revision
>> 257983)
>> >> +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp       (revision
>> 257984)
>> >> @@ -12477,17 +12477,13 @@
>> >>
>> >>    GlobalAddressSDNode *GA = cast<GlobalAddressSDNode>(Op);
>> >>
>> >> -  // Cygwin uses emutls.
>> >> -  // FIXME: It may be EmulatedTLS-generic also for X86-Android.
>> >> -  if (Subtarget->isTargetWindowsCygwin())
>> >> +  if (DAG.getTarget().Options.EmulatedTLS)
>> >>      return LowerToTLSEmulatedModel(GA, DAG);
>> >>
>> >>    const GlobalValue *GV = GA->getGlobal();
>> >>    auto PtrVT = getPointerTy(DAG.getDataLayout());
>> >>
>> >>    if (Subtarget->isTargetELF()) {
>> >> -    if (DAG.getTarget().Options.EmulatedTLS)
>> >> -      return LowerToTLSEmulatedModel(GA, DAG);
>> >>      TLSModel::Model model = DAG.getTarget().getTLSModel(GV);
>> >>      switch (model) {
>> >>        case TLSModel::GeneralDynamic:
>> >> Index: cfe/trunk/test/Driver/emulated-tls.cpp
>> >> ===================================================================
>> >> --- cfe/trunk/test/Driver/emulated-tls.cpp      (revision 0)
>> >> +++ cfe/trunk/test/Driver/emulated-tls.cpp      (revision 257984)
>> >> @@ -0,0 +1,5 @@
>> >> +// Cygwin uses emutls. Clang should pass -femulated-tls to cc1 and
>> cc1 should pass EmulatedTLS to LLVM CodeGen.
>> >> +// FIXME: Add more targets here to use emutls.
>> >> +// RUN: %clang -### -std=c++11 -target i686-pc-cygwin %s 2>&1 |
>> FileCheck %s
>> >> +
>> >> +// CHECK: "-cc1" {{.*}}"-femulated-tls"
>> >> Index: cfe/trunk/docs/ReleaseNotes.rst
>> >> ===================================================================
>> >> --- cfe/trunk/docs/ReleaseNotes.rst     (revision 257983)
>> >> +++ cfe/trunk/docs/ReleaseNotes.rst     (revision 257984)
>> >> @@ -74,6 +74,8 @@
>> >>
>> >>  Clang's support for building native Windows programs ...
>> >>
>> >> +TLS is enabled for Cygwin defaults to -femulated-tls.
>> >> +
>> >>
>> >>  C Language Changes in Clang
>> >>  ---------------------------
>> >> Index: cfe/trunk/lib/Driver/Tools.cpp
>> >> ===================================================================
>> >> --- cfe/trunk/lib/Driver/Tools.cpp      (revision 257983)
>> >> +++ cfe/trunk/lib/Driver/Tools.cpp      (revision 257984)
>> >> @@ -4597,7 +4597,7 @@
>> >>    Args.AddLastArg(CmdArgs, options::OPT_fno_operator_names);
>> >>    // Emulated TLS is enabled by default on Android, and can be
>> enabled manually
>> >>    // with -femulated-tls.
>> >> -  bool EmulatedTLSDefault = Triple.isAndroid();
>> >> +  bool EmulatedTLSDefault = Triple.isAndroid() ||
>> Triple.isWindowsCygwinEnvironment();
>> >>    if (Args.hasFlag(options::OPT_femulated_tls,
>> options::OPT_fno_emulated_tls,
>> >>                     EmulatedTLSDefault))
>> >>      CmdArgs.push_back("-femulated-tls");
>> >>
>> >> Users:
>> >>   chapuni (Author)
>> >>
>> >> http://reviews.llvm.org/rL257984
>> >>
>> >>
>> >>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160119/2d22723b/attachment.html>


More information about the cfe-commits mailing list