Rewrite SLP induction vectorization
authorRichard Biener <rguenther@suse.de>
Mon, 2 Nov 2020 11:38:04 +0000 (12:38 +0100)
committerRichard Biener <rguenther@suse.de>
Mon, 2 Nov 2020 14:58:14 +0000 (15:58 +0100)
commite881774d0dda6d5127eb8f0642f6edc16dc0b1e7
tree246429551c79f231c1b41f6cf035e478fdc00452
parent86deadf8d3ac55b3cd07e15d4e83e3b6ccd9ee81
Rewrite SLP induction vectorization

This rewrites SLP induction vectorization to handle different
inductions in the different SLP lanes.  It also changes SLP
build to represent the initial value (but not the cycle) so
it can be enhanced to handle outer loop vectorization later.

Note this FAILs gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c
because it removes one CSE optimization that no longer works
with non-uniform initial value and step.  I'll see to recover
from this after outer loop vectorization of inductions works.

It might be a bit friendlier to variable-size vectors now
but then we're now building the step vector from scalars ...

2020-11-02  Richard Biener  <rguenther@suse.de>

* tree.h (build_real_from_wide): Declare.
* tree.c (build_real_from_wide): New function.
* tree-vect-slp.c (vect_build_slp_tree_2): Remove
restriction on induction vectorization, represent
the initial value.
* tree-vect-loop.c (vect_model_induction_cost): Inline ...
(vectorizable_induction): ... here.  Rewrite SLP
code generation.

* gcc.dg/vect/slp-49.c: New testcase.
gcc/testsuite/gcc.dg/vect/slp-49.c [new file with mode: 0644]
gcc/tree-vect-loop.c
gcc/tree-vect-slp.c
gcc/tree.c
gcc/tree.h