Add #pragma vectorize enable/disable to LLVM
authorRenato Golin <renato.golin@linaro.org>
Thu, 5 Dec 2013 21:20:02 +0000 (21:20 +0000)
committerRenato Golin <renato.golin@linaro.org>
Thu, 5 Dec 2013 21:20:02 +0000 (21:20 +0000)
commit07d9471bc59dea5069991b4cf9602f6b6404418b
treee85b76b1232ec4f3f593b7dd4ab16378bce4ecba
parent226e3eab9bb39e6b73122c26532cfa8242eb6d4e
Add #pragma vectorize enable/disable to LLVM

The intended behaviour is to force vectorization on the presence
of the flag (either turn on or off), and to continue the behaviour
as expected in its absence. Tests were added to make sure the all
cases are covered in opt. No tests were added in other tools with
the assumption that they should use the PassManagerBuilder in the
same way.

This patch also removes the outdated -late-vectorize flag, which was
on by default and not helping much.

The pragma metadata is being attached to the same place as other loop
metadata, but nothing forbids one from attaching it to a function
(to enable #pragma optimize) or basic blocks (to hint the basic-block
vectorizers), etc. The logic should be the same all around.

Patches to Clang to produce the metadata will be produced after the
initial implementation is agreed upon and committed. Patches to other
vectorizers (such as SLP and BB) will be added once we're happy with
the pass manager changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196537 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/IPO/PassManagerBuilder.h
include/llvm/Transforms/Vectorize.h
lib/Transforms/IPO/PassManagerBuilder.cpp
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/metadata-enable.ll [new file with mode: 0644]
tools/opt/opt.cpp