[PATCH] Fix costmodel for SLP vectorization

Richard Guenther rguenther@suse.de
Wed Aug 6 13:44:00 GMT 2008


On Tue, 5 Aug 2008, Victor Kaplansky wrote:

> 
> 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?

Ok.

Thanks,
Richard.

> 
> -- 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.
> 



More information about the Gcc-patches mailing list