Fix PR90332 by extending half size vector mode
As PR90332 shows, the current scalar epilogue peeling for gaps
elimination requires expected vec_init optab with two half size
vector mode. On Power, we don't support vector mode like V8QI,
so can't support optab like vec_initv16qiv8qi. But we want to
leverage existing scalar mode like DI to init the desirable
vector mode. This patch is to extend the existing support for
Power, as evaluated on Power9 we can see expected 1.9% speed up
on SPEC2017 525.x264_r.
As Richi suggested, add one function vector_vector_composition_type
to refactor existing related codes and also make use of it further.
Bootstrapped/regtested on powerpc64le-linux-gnu (LE) P8 and P9,
as well as x86_64-redhat-linux.
gcc/ChangeLog
2020-03-27 Kewen Lin <linkw@gcc.gnu.org>
PR tree-optimization/90332
* tree-vect-stmts.c (vector_vector_composition_type): New function.
(get_group_load_store_type): Adjust to call vector_vector_composition_type,
extend it to construct with scalar types.
(vectorizable_load): Likewise.