[04/46] Factor out the test for a valid reduction input
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 31 Jul 2018 14:21:28 +0000 (14:21 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 31 Jul 2018 14:21:28 +0000 (14:21 +0000)
commit83a400d0a57c998508c31389286d6fb427985139
tree5551e43e4a609503e06b309ca98dc586c9cac420
parent6e2dd807c2aaaba8906a36766b9f98dfbeddc27d
[04/46] Factor out the test for a valid reduction input

vect_is_slp_reduction and vect_is_simple_reduction had two instances
each of:

              && (is_gimple_assign (def_stmt)
                  || is_gimple_call (def_stmt)
                  || STMT_VINFO_DEF_TYPE (vinfo_for_stmt (def_stmt))
                           == vect_induction_def
                  || (gimple_code (def_stmt) == GIMPLE_PHI
                      && STMT_VINFO_DEF_TYPE (vinfo_for_stmt (def_stmt))
                                  == vect_internal_def
                      && !is_loop_header_bb_p (gimple_bb (def_stmt)))))

This patch splits it out in a subroutine.

2018-07-31  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* tree-vect-loop.c (vect_valid_reduction_input_p): New function,
split out from...
(vect_is_slp_reduction): ...here...
(vect_is_simple_reduction): ...and here.  Remove repetition of tests
that are already known to be false.

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