[1/n] PR85694: Allow pattern definition statements to be reused
commitdaec18f5ee7d25613e53b2c8162292e341edbdd9
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 20 Jun 2018 08:05:41 +0000 (20 08:05 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 20 Jun 2018 08:05:41 +0000 (20 08:05 +0000)
treedc8ea1dce60c622c8d4d910d5ae5cfda49695038
parentd309493958e5cd302b1ec251fd0aa2dfd4e1bddf
[1/n] PR85694: Allow pattern definition statements to be reused

This patch is the first part of a series to fix to PR85694.
Later patches can make the pattern for a statement S2 reuse the
results of a PATTERN_DEF_SEQ statement attached to an earlier
statement S1.  Although vect_mark_stmts_to_be_vectorized handled
this fine, vect_analyze_stmt and vect_transform_loop both skipped the
PATTERN_DEF_SEQ for S1 if S1's main pattern wasn't live or relevant.

I couldn't wrap my head around the flow in vect_transform_loop,
so ended up moving the per-statement handling into a subroutine.
That makes the patch look bigger than it actually is.

2018-06-20  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* tree-vect-stmts.c (vect_analyze_stmt): Move the handling of pattern
definition statements before the early exit for statements that aren't
live or relevant.
* tree-vect-loop.c (vect_transform_loop_stmt): New function,
split out from...
(vect_transform_loop): ...here.  Process pattern definition
statements without first checking whether the main pattern
statement is live or relevant.

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