r189440 - Disable loop vectorizer unrolling when no unrolling requested

Chandler Carruth chandlerc at google.com
Tue Aug 27 21:53:31 PDT 2013


On Tue, Aug 27, 2013 at 9:40 PM, Hal Finkel <hfinkel at anl.gov> wrote:

> +    // In addition to the regular loop unrolling transformation, the loop
> +    // vectorizer can also unroll loops. If no unrolling has specifically
> been
> +    // requested, then also prevent the loop vectorizer from unrolling
> loops.
> +    if (Args.hasFlag(options::OPT_fno_unroll_loops,
> +        options::OPT_funroll_loops, false)) {
> +      CmdArgs.push_back("-backend-option");
> +      CmdArgs.push_back("-force-vector-unroll=1");
>

Please don't use -backend-option. Essentially ever.

These options force the setting of thread hostile and un-resettable LLVM
commandline flags that are only really suitable for debugging. When they
are used directly in the Clang driver, tools which invoke CC1 actions with
flagsets derived from the driver multiple times in a single process the
result of this flag will cause a crash on the second invocation.

I fixed most of the vectorizer flags to not do this, and wrote a commit
message explaining why. Especially when committing with post-commit review,
please make sure that you are following the commit lists.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130827/368525cb/attachment.html>


More information about the cfe-commits mailing list