]> git.ipfire.org Git - thirdparty/gcc.git/commit
vect: Adjust vectorizable_load costing on VMAT_ELEMENTWISE and VMAT_STRIDED_SLP
authorKewen Lin <linkw@linux.ibm.com>
Thu, 13 Jul 2023 02:23:21 +0000 (21:23 -0500)
committerKewen Lin <linkw@linux.ibm.com>
Thu, 13 Jul 2023 04:12:15 +0000 (23:12 -0500)
commit090d83c25508c108756a534c765d2fa8c07eb261
tree1f28884c002404cca69e729acfe6e4cd75d9ac72
parentbbee29e82881c30c4f23e29db3e40de71cf49789
vect: Adjust vectorizable_load costing on VMAT_ELEMENTWISE and VMAT_STRIDED_SLP

This patch adjusts the cost handling on VMAT_ELEMENTWISE
and VMAT_STRIDED_SLP in function vectorizable_load.  We
don't call function vect_model_load_cost for them any more.

As PR82255 shows, we don't always need a vector construction
there, moving costing next to the transform can make us only
cost for vector construction when it's actually needed.
Besides, it can count the number of loads consistently for
some cases.

 PR tree-optimization/82255

gcc/ChangeLog:

* tree-vect-stmts.cc (vectorizable_load): Adjust the cost handling
on VMAT_ELEMENTWISE and VMAT_STRIDED_SLP without calling
vect_model_load_cost.
(vect_model_load_cost): Assert it won't get VMAT_ELEMENTWISE and
VMAT_STRIDED_SLP any more, and remove their related handlings.

gcc/testsuite/ChangeLog:

* gcc.dg/vect/costmodel/ppc/costmodel-pr82255.c: New test.

2023-06-13  Bill Schmidt  <wschmidt@linux.ibm.com>
    Kewen Lin  <linkw@linux.ibm.com>
gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-pr82255.c [new file with mode: 0644]
gcc/tree-vect-stmts.cc