Vectorize internal functions
commit1bd41d0387a1c0497ad8e2f077b05a28c87f4a34
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 Nov 2015 18:55:55 +0000 (17 18:55 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 Nov 2015 18:55:55 +0000 (17 18:55 +0000)
tree9b4ddd183b2f4dd515f06826aaa396589cf86c98
parentb6c464fe9e1983f7f9d9f1ceb5e12f70b56c50b1
Vectorize internal functions

This patch tries to vectorize built-in and internal functions as
internal functions first, falling back on the current built-in
target hooks otherwise.

This means that we'll automatically pick up vector versions of optabs
without the target having to implement any special hooks.  E.g. we'll
use V4SF sqrt if the target defines a "sqrtv4sf2" optab.  As well as
being simpler, it means that the target-independent code has more
idea what the vectorized function does.

Tested on x86_64-linux-gnu, aarch64-linux-gnu, arm-linux-gnu and
powerpc64-linux-gnu.

gcc/
* internal-fn.h (direct_internal_fn_info): Add vectorizable flag.
* internal-fn.c (direct_internal_fn_array): Update accordingly.
* tree-vectorizer.h (vectorizable_function): Delete.
* tree-vect-stmts.c: Include internal-fn.h.
(vectorizable_internal_function): New function.
(vectorizable_function): Inline into...
(vectorizable_call): ...here.  Explicitly reject calls that read
from or write to memory.  Try using an internal function before
falling back on the old vectorizable_function behavior.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230492 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/internal-fn.c
gcc/internal-fn.h
gcc/tree-vect-stmts.c
gcc/tree-vectorizer.h