Fix reduc_index==1 handling for COND_REDUCTION (PR91909)
authorRichard Sandiford <richard.sandiford@arm.com>
Fri, 27 Sep 2019 08:21:37 +0000 (08:21 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Fri, 27 Sep 2019 08:21:37 +0000 (08:21 +0000)
commit18908a56e18f15f84a91a4529923dd0878b2294f
treeb2f92a73ab5a113db2ffc4d3ed440676e493d9bf
parent76bb5af63db66ccaee0f0ae59783eda972d0db83
Fix reduc_index==1 handling for COND_REDUCTION (PR91909)

The then/else order of the VEC_COND_EXPRs created by
vect_create_epilog_for_reduction meeds to line up with the
main VEC_COND_EXPR.

2019-09-27  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
PR tree-optimization/91909
* tree-vect-loop.c (vect_create_epilog_for_reduction): Take a
reduc_index parameter.  When handling COND_REDUCTION, make sure
that the reduction phi operand is in the correct arm of the
VEC_COND_EXPR.
(vectorizable_reduction): Pass reduc_index to the above.

From-SVN: r276175
gcc/ChangeLog
gcc/tree-vect-loop.c