]> granicus.if.org Git - clang/commit
[Driver][CodeGen] Add -mprefer-vector-width driver option and attribute during CodeGen.
authorCraig Topper <craig.topper@intel.com>
Mon, 11 Dec 2017 21:09:19 +0000 (21:09 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 11 Dec 2017 21:09:19 +0000 (21:09 +0000)
commitce4e832999f969100f4780773f384da2561d573b
tree10b43543694ca970dfec61c8803afcccbc9d0d8f
parentc9d3180bac1e8616c883c794a4d9ec7f86e03c27
[Driver][CodeGen] Add -mprefer-vector-width driver option and attribute during CodeGen.

This adds a new command line option -mprefer-vector-width to specify a preferred vector width for the vectorizers. Valid values are 'none' and unsigned integers. The driver will check that it meets those constraints. Specific supported integers will be managed by the targets in the backend.

Clang will take the value and add it as a new function attribute during CodeGen.

This represents the alternate direction proposed by Sanjay in this RFC: http://lists.llvm.org/pipermail/llvm-dev/2017-November/118734.html

The syntax here matches gcc, though gcc treats it as an x86 specific command line argument. gcc only allows values of 128, 256, and 512. I'm not having clang check any values.

Differential Revision: https://reviews.llvm.org/D40230

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@320419 91177308-0d34-0410-b5e6-96231b3b80d8
docs/ClangCommandLineReference.rst
include/clang/Driver/Options.td
include/clang/Frontend/CodeGenOptions.h
lib/CodeGen/CGCall.cpp
lib/Driver/ToolChains/Clang.cpp
lib/Frontend/CompilerInvocation.cpp
test/CodeGen/attr-mprefer-vector-width.c [new file with mode: 0644]
test/Driver/mprefer-vector-width.c [new file with mode: 0644]