[04/46] Factor out the test for a valid reduction input
commit6340aaa8e8e08c2621d9fc39b3b3cc6c55967c93
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 31 Jul 2018 14:21:28 +0000 (31 14:21 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 31 Jul 2018 14:21:28 +0000 (31 14:21 +0000)
tree5551e43e4a609503e06b309ca98dc586c9cac420
parent2068679dba2e1de9640aa4382e473ff6e9895b22
[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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263119 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/tree-vect-loop.c