vect: Simplify epilogue reduction code
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 13 Jul 2021 09:17:35 +0000 (10:17 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Tue, 13 Jul 2021 09:17:35 +0000 (10:17 +0100)
commit3658ee4c73955ebf281842d2e637ca556fa8bbfd
tree5e7527585057e982f664e36cfdda783ae6e1a04a
parent0ae469e8c0ccb93a26bb1e60db6418d6bcced15e
vect: Simplify epilogue reduction code

vect_create_epilog_for_reduction only handles two cases: single-loop
reductions and double reductions.  “nested cycles” (i.e. reductions
in the inner loop when vectorising an outer loop) are handled elsewhere
and don't need a vector->scalar reduction.

The function had variables called nested_in_vect_loop and double_reduc
and asserted that nested_in_vect_loop implied double_reduc, but it
still had code to handle nested_in_vect_loop && !double_reduc.
This patch removes that and uses double_reduc everywhere.

gcc/
* tree-vect-loop.c (vect_create_epilog_for_reduction): Remove
nested_in_vect_loop and use double_reduc everywhere.  Remove dead
assignment to "loop".
gcc/tree-vect-loop.c