[7/n] PR85694: Add a vect_pattern_detected helper
commit972163bf33c38b932f3099fc6319c6ce8f7eeff9
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 20 Jun 2018 08:11:46 +0000 (20 08:11 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 20 Jun 2018 08:11:46 +0000 (20 08:11 +0000)
tree5c9961ef7e3bed4f2e2291bd90d1a150667c5837
parentc32b0020332558b0fe43cba313b5e00902ba6ba6
[7/n] PR85694: Add a vect_pattern_detected helper

This message is a long write-up for a patch that simply adds a common
routine for printing the "vector_foo_pattern: detected:" messages.

The reason for doing this is that some routines check for target support
themselves and some leave it to vect_pattern_recog_1.  Those that leave
it to vect_pattern_recog_1 currently print these "detected:" messages if
the statements have the right form, even if the pattern is eventually
discarded.  IMO that's useful, and a lot of existing scan tests rely on it.

However, a later patch makes patterns do their own testing, and stops
them creating pattern statements until the tests have passed.  This means
(a) they need to print the "detected:" message earlier and (b) the pattern
statement won't be around to print.

The patch therefore makes all routines print the original statement
rather than the pattern one.  That information isn't obvious otherwise,
whereas vect_pattern_recog_1 already prints the pattern statement
in the case of a successful match.  This also avoids the previous
situation in which a routine could print "detected:" and then
silently bail out before saying what had been detected.

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

gcc/
* tree-vect-patterns.c (vect_pattern_detected): New function.
(vect_recog_dot_prod_patternm, vect_recog_sad_pattern)
(vect_recog_widen_mult_pattern, vect_recog_widen_sum_pattern)
(vect_recog_over_widening_pattern, vect_recog_widen_shift_pattern
(vect_recog_rotate_pattern, vect_recog_vector_vector_shift_pattern)
(vect_recog_mult_pattern, vect_recog_divmod_pattern)
(vect_recog_mixed_size_cond_pattern, vect_recog_bool_pattern)
(vect_recog_mask_conversion_pattern)
(vect_try_gather_scatter_pattern): Likewise.

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