Clean up PURE_SLP_STMT handling
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 24 May 2016 14:05:20 +0000 (14:05 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 24 May 2016 14:05:20 +0000 (14:05 +0000)
commitfce57248c89d5b990d1f82a2f8eba5a9741c9ad9
treefea3d6343aca03af342d9d4ea601fc7a7abb9a42
parentd1fb69400edb679142810fb86cc4c80254c60787
Clean up PURE_SLP_STMT handling

The vectorizable_* routines had many instances of:

        slp_node || PURE_SLP_STMT (stmt_info)

which gives the misleading impression that we can have
!slp_node && PURE_SLP_STMT (stmt_info).  In this context
it's really enough to test slp_node on its own.

There are three cases:

      loop vectorisation only:
        vectorizable_foo called only with !slp_node

      pure SLP:
        vectorizable_foo called only with slp_node

      hybrid SLP:
        (e.g. a vector that's used in SLP statements and also in a reduction)
        - vectorizable_foo called once with slp_node for the SLP uses.
        - vectorizable_foo called once with !slp_node for the non-SLP uses.

Hybrid SLP isn't possible for stores, so I added an explicit assert
for that.

I also made vectorizable_comparison static, to make it obvious that
no other callers outside tree-vect-stmts.c could use it with the
!slp && PURE_SLP_STMT combination.

Tested on aarch64-linux-gnu and x86_64-linux-gnu.

gcc/
* tree-vectorizer.h (vectorizable_comparison): Delete.
* tree-vect-loop.c (vectorizable_reduction): Remove redundant
PURE_SLP_STMT check.
* tree-vect-stmts.c (vectorizable_call): Likewise.
(vectorizable_simd_clone_call): Likewise.
(vectorizable_conversion): Likewise.
(vectorizable_assignment): Likewise.
(vectorizable_shift): Likewise.
(vectorizable_operation): Likewise.
(vectorizable_load): Likewise.
(vectorizable_condition): Likewise.
(vectorizable_store): Likewise.  Assert that we don't have
hybrid SLP.
(vectorizable_comparison): Make static.  Remove redundant
PURE_SLP_STMT check.
(vect_transform_stmt): Assert that we always have an slp_node
if PURE_SLP_STMT.

From-SVN: r236642
gcc/ChangeLog
gcc/tree-vect-loop.c
gcc/tree-vect-stmts.c
gcc/tree-vectorizer.h