]> git.ipfire.org Git - thirdparty/gcc.git/commit
vect: Consider vec_perm costing for VMAT_CONTIGUOUS_REVERSE
authorKewen Lin <linkw@linux.ibm.com>
Thu, 12 Oct 2023 05:04:57 +0000 (00:04 -0500)
committerKewen Lin <linkw@linux.ibm.com>
Thu, 12 Oct 2023 05:04:57 +0000 (00:04 -0500)
commitf1a05dc180518d8dd66850833967a15d50c15db0
tree8e65508a6f1252ddc3405871e0eec43d6e6c54b4
parent0bdb9bb5607edd7df1ee74ddfcadb87324ca00c2
vect: Consider vec_perm costing for VMAT_CONTIGUOUS_REVERSE

For VMAT_CONTIGUOUS_REVERSE, the transform code in function
vectorizable_store generates a VEC_PERM_EXPR stmt before
storing, but it's never considered in costing.

This patch is to make it consider vec_perm in costing, it
adjusts the order of transform code a bit to make it easy
to early return for costing_p.

gcc/ChangeLog:

* tree-vect-stmts.cc (vectorizable_store): Consider generated
VEC_PERM_EXPR stmt for VMAT_CONTIGUOUS_REVERSE in costing as
vec_perm.

gcc/testsuite/ChangeLog:

* gcc.dg/vect/costmodel/ppc/costmodel-vect-store-2.c: New test.
gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-store-2.c [new file with mode: 0644]
gcc/tree-vect-stmts.cc