This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix costmodel for SLP vectorization


Hi,

Attached patch fixes a problem in SLP cost model found by Uros and
reported in comment #5 of PR35252.  The problem was that cost-model
calculated costs of load and simple operations twice - as vectorized
by SLP and non-SLP.  Another problem fixed in this patch is that cost
of store operation in SLP mode was counted as if it requires additional
permute operations as it should be done for strided accesses.
A testcase added as well.

Bootstrapped and regtested on x86 and powerpc.
OK for mainline?

-- Victor

ChangeLog:

      * tree-vect-transform.c (vect_model_simple_cost): Return
      immediately if stmt is pure SLP.
      (vect_model_store_cost): Ditto.
      (vect_model_load_cost): Ditto..
      (vectorizable_store): Remove PURE_SLP check before call
      to vect_model_store_cost.
      (vect_model_store_cost): When checking whether stmt describe
      strided access, add a check that it is not slp_node.

Testsuite:

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

(See attached file: slp-cost.diff)

Attachment: slp-cost.diff
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]