Add support for SLP vectorization of OpenMP SIMD clone calls
commit63eaccd114393f4692976bb78b30148e6d77a89e
authorRichard Biener <rguenther@suse.de>
Thu, 12 Oct 2023 12:25:07 +0000 (12 14:25 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 13 Oct 2023 12:29:39 +0000 (13 14:29 +0200)
treeacb79c0988dadfa3aae807946444e7268cc0e8a2
parent8544efd6d4aea46656c37b0e002503616f09edfc
Add support for SLP vectorization of OpenMP SIMD clone calls

This adds support for SLP vectorization of OpenMP SIMD clone calls.
There's a complication when vectorizing calls involving virtual
operands since this is now for the first time not only leafs (loads
or stores).  With SLP this runs into the issue that placement of
the vectorized stmts is not necessarily at one of the original
scalar stmts which leads to the magic updating virtual operands
in vect_finish_stmt_generation not working.  So we run into the
assert that updating virtual operands isn't necessary.  I've
papered over this similar to how we do for mismatched const/pure
attribution by setting vinfo->any_known_not_updated_vssa.

I've added two basic testcases with multi-lane SLP and verified
that with single-lane SLP enabled the rest of the existing testcases
pass.

* tree-vect-slp.cc (mask_call_maps): New.
(vect_get_operand_map): Handle IFN_MASK_CALL.
(vect_build_slp_tree_1): Likewise.
* tree-vect-stmts.cc (vectorizable_simd_clone_call): Handle
SLP.

* gcc.dg/vect/slp-simd-clone-1.c: New testcase.
* gcc.dg/vect/slp-simd-clone-2.c: Likewise.
gcc/testsuite/gcc.dg/vect/slp-simd-clone-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/slp-simd-clone-2.c [new file with mode: 0644]
gcc/tree-vect-slp.cc
gcc/tree-vect-stmts.cc