vect: inbranch SIMD clones
authorAndrew Stubbs <ams@codesourcery.com>
Thu, 28 Jul 2022 15:07:22 +0000 (16:07 +0100)
committerAndrew Stubbs <ams@codesourcery.com>
Wed, 22 Feb 2023 13:57:11 +0000 (13:57 +0000)
commit3da77f217c8b2089ecba3eb201e727c3fcdcd19d
tree2f3fb8460f25af2a5bf8a8bc9e8fe19f8b5b41f1
parentc878c6586dee353e685364910e02ad1a611d4634
vect: inbranch SIMD clones

There has been support for generating "inbranch" SIMD clones for a long time,
but nothing actually uses them (as far as I can see).

This patch add supports for a sub-set of possible cases (those using
mask_mode == VOIDmode).  The other cases fail to vectorize, just as before,
so there should be no regressions.

The sub-set of support should cover all cases needed by amdgcn, at present.

gcc/ChangeLog:

* internal-fn.cc (expand_MASK_CALL): New.
* internal-fn.def (MASK_CALL): New.
* internal-fn.h (expand_MASK_CALL): New prototype.
* omp-simd-clone.cc (simd_clone_adjust_argument_types): Set vector_type
for mask arguments also.
* tree-if-conv.cc: Include cgraph.h.
(if_convertible_stmt_p): Do if conversions for calls to SIMD calls.
(predicate_statements): Convert functions to IFN_MASK_CALL.
* tree-vect-loop.cc (vect_get_datarefs_in_loop): Recognise
IFN_MASK_CALL as a SIMD function call.
* tree-vect-stmts.cc (vectorizable_simd_clone_call): Handle
IFN_MASK_CALL as an inbranch SIMD function call.
Generate the mask vector arguments.

gcc/testsuite/ChangeLog:

* gcc.dg/vect/vect-simd-clone-16.c: New test.
* gcc.dg/vect/vect-simd-clone-16b.c: New test.
* gcc.dg/vect/vect-simd-clone-16c.c: New test.
* gcc.dg/vect/vect-simd-clone-16d.c: New test.
* gcc.dg/vect/vect-simd-clone-16e.c: New test.
* gcc.dg/vect/vect-simd-clone-16f.c: New test.
* gcc.dg/vect/vect-simd-clone-17.c: New test.
* gcc.dg/vect/vect-simd-clone-17b.c: New test.
* gcc.dg/vect/vect-simd-clone-17c.c: New test.
* gcc.dg/vect/vect-simd-clone-17d.c: New test.
* gcc.dg/vect/vect-simd-clone-17e.c: New test.
* gcc.dg/vect/vect-simd-clone-17f.c: New test.
* gcc.dg/vect/vect-simd-clone-18.c: New test.
* gcc.dg/vect/vect-simd-clone-18b.c: New test.
* gcc.dg/vect/vect-simd-clone-18c.c: New test.
* gcc.dg/vect/vect-simd-clone-18d.c: New test.
* gcc.dg/vect/vect-simd-clone-18e.c: New test.
* gcc.dg/vect/vect-simd-clone-18f.c: New test.
25 files changed:
gcc/internal-fn.cc
gcc/internal-fn.def
gcc/internal-fn.h
gcc/omp-simd-clone.cc
gcc/testsuite/gcc.dg/vect/vect-simd-clone-16.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-simd-clone-16b.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-simd-clone-16c.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-simd-clone-16d.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-simd-clone-16e.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-simd-clone-16f.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-simd-clone-17.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-simd-clone-17b.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-simd-clone-17c.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-simd-clone-17d.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-simd-clone-17e.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-simd-clone-17f.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-simd-clone-18.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-simd-clone-18b.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-simd-clone-18c.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-simd-clone-18d.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-simd-clone-18e.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-simd-clone-18f.c [new file with mode: 0644]
gcc/tree-if-conv.cc
gcc/tree-vect-loop.cc
gcc/tree-vect-stmts.cc