[cfe-commits] r169885 - in /cfe/trunk: include/clang/Driver/Options.td lib/Driver/Tools.cpp test/Driver/clang_f_opts.c

Chad Rosier mcrosier at apple.com
Tue Dec 11 09:40:18 PST 2012


On Dec 11, 2012, at 9:37 AM, Benjamin Kramer <benny.kra at gmail.com> wrote:

> 
> On 11.12.2012, at 18:12, Chad Rosier <mcrosier at apple.com> wrote:
> 
>> Author: mcrosier
>> Date: Tue Dec 11 11:12:28 2012
>> New Revision: 169885
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=169885&view=rev
>> Log:
>> [driver] Add the -fvectorize flag to enable the loop vectorization passes.
>> rdar://12839978 
> 
> Should we add -ftree-vectorize as an alias for this flag? It's GCC's way to enable the vectorized.

Nadav and I discussed this and I think we agree it would be a good idea to maintain compatibility with GCC. I'll add it shortly.

 Thanks, Ben.

 Chad

> 
> - Ben
>> 
>> Modified:
>>   cfe/trunk/include/clang/Driver/Options.td
>>   cfe/trunk/lib/Driver/Tools.cpp
>>   cfe/trunk/test/Driver/clang_f_opts.c
>> 
>> Modified: cfe/trunk/include/clang/Driver/Options.td
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=169885&r1=169884&r2=169885&view=diff
>> ==============================================================================
>> --- cfe/trunk/include/clang/Driver/Options.td (original)
>> +++ cfe/trunk/include/clang/Driver/Options.td Tue Dec 11 11:12:28 2012
>> @@ -650,6 +650,9 @@
>> def ftemplate_backtrace_limit_EQ : Joined<["-"], "ftemplate-backtrace-limit=">,
>>                                   Group<f_Group>;
>> def ftest_coverage : Flag<["-"], "ftest-coverage">, Group<f_Group>;
>> +def fvectorize : Flag<["-"], "fvectorize">, Group<f_Group>,
>> +  HelpText<"Enable the loop vectorization passes">;
>> +def fno_vectorize : Flag<["-"], "fno-vectorize">, Group<f_Group>;
>> def Wlarge_by_value_copy_def : Flag<["-"], "Wlarge-by-value-copy">,
>>  HelpText<"Warn if a function definition returns or accepts an object larger "
>>           "in bytes than a given value">, Flags<[HelpHidden]>;
>> 
>> Modified: cfe/trunk/lib/Driver/Tools.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=169885&r1=169884&r2=169885&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/Driver/Tools.cpp (original)
>> +++ cfe/trunk/lib/Driver/Tools.cpp Tue Dec 11 11:12:28 2012
>> @@ -2928,6 +2928,13 @@
>>                   false))
>>    CmdArgs.push_back("-fasm-blocks");
>> 
>> +  // -fno-vectorize is default.
>> +  if (Args.hasFlag(options::OPT_fvectorize,
>> +                   options::OPT_fno_vectorize, false)) {
>> +    CmdArgs.push_back("-backend-option");
>> +    CmdArgs.push_back("-vectorize-loops");
>> +  }
>> +
>>  if (Arg *A = Args.getLastArg(options::OPT_fshow_overloads_EQ))
>>    A->render(Args, CmdArgs);
>> 
>> 
>> Modified: cfe/trunk/test/Driver/clang_f_opts.c
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/clang_f_opts.c?rev=169885&r1=169884&r2=169885&view=diff
>> ==============================================================================
>> --- cfe/trunk/test/Driver/clang_f_opts.c (original)
>> +++ cfe/trunk/test/Driver/clang_f_opts.c Tue Dec 11 11:12:28 2012
>> @@ -38,3 +38,12 @@
>> 
>> // RUN: %clang -fms-extensions -fenable-experimental-ms-inline-asm %s -### 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS3 %s
>> // CHECK-OPTIONS3: -fenable-experimental-ms-inline-asm
>> +
>> +// RUN: %clang -### -S -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
>> +// RUN: %clang -### -S -fno-vectorize -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
>> +// RUN: %clang -### -S -fno-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
>> +// RUN: %clang -### -S -fvectorize -fno-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
>> +// CHECK-VECTORIZE: "-backend-option"
>> +// CHECK-VECTORIZE: "-vectorize-loops"
>> +// CHECK-NO-VECTORIZE-NOT: "-backend-option"
>> +// CHECK-NO-VECTORIZE-NOT: "-vectorize-loops"
>> 
>> 
>> _______________________________________________
>> 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