r194502 - clang-cl: parse the /GT option

Hans Wennborg hans at chromium.org
Tue Nov 12 13:01:58 PST 2013


On Tue, Nov 12, 2013 at 11:37 AM, Reid Kleckner <rnk at google.com> wrote:
> This seems like the usual command line cruft that doesn't actually matter in
> practice, but are LLVM optimizations really fiber safe?  Probably.  I don't
> see any reason why we'd treat loads from TLS differently from globals, which
> we shouldn't move.  The docs say:
> "Because a fiber may get swapped out and restarted later on a different
> thread, the address of the TLS array must not be cached or optimized as a
> common subexpression across a function call..."

LLVM will assume the address of a TLS variable is constant within a
function body, which I don't think this is "fiber safe" (if I
understand correctly that a fiber means a given function could be
stopped at a function call, and resumed later on another thread).

I'll leave the flag as unsupported.

 - Hans

> Looks like we currently ignore __declspec(thread) completely, so I guess
> we're safe, for now.
> t.cpp(1,11) :  warning: __declspec attribute 'thread' is not supported
> [-Wignored-attributes]
> __declspec(thread) int tl;
>
>
>
> On Tue, Nov 12, 2013 at 11:21 AM, Hans Wennborg <hans at hanshq.net> wrote:
>>
>> Author: hans
>> Date: Tue Nov 12 13:21:50 2013
>> New Revision: 194502
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=194502&view=rev
>> Log:
>> clang-cl: parse the /GT option
>>
>> Modified:
>>     cfe/trunk/include/clang/Driver/CLCompatOptions.td
>>     cfe/trunk/test/Driver/cl-options.c
>>
>> Modified: cfe/trunk/include/clang/Driver/CLCompatOptions.td
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CLCompatOptions.td?rev=194502&r1=194501&r2=194502&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/include/clang/Driver/CLCompatOptions.td (original)
>> +++ cfe/trunk/include/clang/Driver/CLCompatOptions.td Tue Nov 12 13:21:50
>> 2013
>> @@ -182,6 +182,7 @@ def _SLASH_GL_ : CLFlag<"GL-">;
>>  def _SLASH_Gm : CLFlag<"Gm">;
>>  def _SLASH_Gm_ : CLFlag<"Gm-">;
>>  def _SLASH_GS : CLFlag<"GS">;
>> +def _SLASH_GT : CLFlag<"GT">;
>>  def _SLASH_Gy : CLFlag<"Gy">;
>>  def _SLASH_Gy_ : CLFlag<"Gy-">;
>>  def _SLASH_GZ : CLFlag<"GZ">;
>>
>> Modified: cfe/trunk/test/Driver/cl-options.c
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cl-options.c?rev=194502&r1=194501&r2=194502&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/test/Driver/cl-options.c (original)
>> +++ cfe/trunk/test/Driver/cl-options.c Tue Nov 12 13:21:50 2013
>> @@ -122,7 +122,7 @@
>>  // (/Zs is for syntax-only)
>>  // RUN: %clang_cl /Zs /arch:sse2 /Yustdafx.h /FpDebug\main.pch -- %s 2>&1
>>  // RUN: %clang_cl /Zs /EHsc /Fdfoo /fp:precise /Gd /GL /GL- -- %s 2>&1
>> -// RUN: %clang_cl /Zs /Gm /Gm- /GS /Gy /Gy- /GZ -- %s 2>&1
>> +// RUN: %clang_cl /Zs /Gm /Gm- /GS /Gy /Gy- /GT /GZ -- %s 2>&1
>>  // RUN: %clang_cl /Zs /ofoo.obj /o foo.obj -- %s 2>&1
>>  // RUN: %clang_cl /Zs /wfoo /Zc:wchar_t- -- %s 2>&1
>>  // RUN: %clang_cl /Zs /ZI /Zi /MP -- %s 2>&1
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>



More information about the cfe-commits mailing list