tree-optimization/122723 - masking of .COND_ADD reductions
The following fixes loop masking of .COND_ADD reductions when
we decide to reduce multiple lanes to one, thus go through
vect_transform_reduction. The first issue is in
vect_reduction_update_partial_vector_usage which does not handle
incoming .COND_ADD well and fails to compute 'cond_fn' in this
case, disabling masking. The second issue is that
vect_transform_reduction does not implement the masked but
not mask-by-cond case for any .COND_* operation. The following
should fix both.
The testcases verify runtime in vect.exp and vectorization support
in the i386 target section for the combinations of -O3, -Ofast
plus masked vs. non-masked epilogues.
PR tree-optimization/122723
* tree-vect-loop.cc (vect_reduction_update_partial_vector_usage):
Handle incoming .COND_* operation.
(vect_transform_reduction): Likewise. Handle .COND_*
operation when not using COND_EXPR masking in a masked loop.
* gcc.dg/vect/vect-reduc-cond-add-1.c: New generic functional
testcase.
* gcc.target/i386/vect-epilogues-6.c: New testcase.
* gcc.target/i386/vect-epilogues-7.c: Likewise.
* gcc.target/i386/vect-epilogues-8.c: Likewise.
* gcc.target/i386/vect-epilogues-9.c: Likewise.