diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2018-06-30 12:48:51 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2018-06-30 12:48:51 +0000 |
commit | 41949de9de0c8ebabb7adb2701e775ecd671aa72 (patch) | |
tree | 3894044c9c2a7faa377969c5901acdaa2d748efc /gcc/gimple-iterator.h | |
parent | 7b98e98a98c95029434200cdfc5ad87e204d79b4 (diff) | |
download | gcc-41949de9de0c8ebabb7adb2701e775ecd671aa72.zip gcc-41949de9de0c8ebabb7adb2701e775ecd671aa72.tar.gz gcc-41949de9de0c8ebabb7adb2701e775ecd671aa72.tar.bz2 |
[11/n] PR85694: Apply pattern matching to pattern definition statements
Although the first pattern match wins in the sense that no later
function can match the *old* gimple statement, it still seems worth
letting them match the *new* gimple statements, just like we would if
the original IR had included that sequence from the outset.
This is mostly true after the later patch for PR85694, where e.g. we
could recognise:
signed char a;
int ap = (int) a;
int res = ap * 3;
as the pattern:
short ap' = (short) a;
short res = ap' * 3; // S1: definition statement
int res = (int) res; // S2: pattern statement
and then apply the mult pattern to "ap' * 3". The patch needs to
come first (without its own test cases) so that the main over-widening
patch doesn't regress anything.
2018-06-30 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* gimple-iterator.c (gsi_for_stmt): Add a new overload that takes
the containing gimple_seq *.
* gimple-iterator.h (gsi_for_stmt): Declare it.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern)
(vect_recog_sad_pattern, vect_recog_widen_sum_pattern)
(vect_recog_widen_shift_pattern, vect_recog_rotate_pattern)
(vect_recog_vector_vector_shift_pattern, vect_recog_divmod_pattern)
(vect_recog_mask_conversion_pattern): Remove STMT_VINFO_IN_PATTERN_P
checks.
(vect_init_pattern_stmt, vect_set_pattern_stmt): New functions,
split out from...
(vect_mark_pattern_stmts): ...here. Handle cases in which the
statement being replaced is part of an existing pattern
definition sequence, inserting the new pattern statements before
the original one.
(vect_pattern_recog_1): Don't return a bool. If the statement
is already part of a pattern, instead apply pattern matching
to the pattern definition statements. Don't clear the
STMT_VINFO_RELATED_STMT if is_pattern_stmt_p.
(vect_pattern_recog): Don't break after the first match;
continue processing the pattern definition statements instead.
Don't bail out for STMT_VINFO_IN_PATTERN_P here.
From-SVN: r262275
Diffstat (limited to 'gcc/gimple-iterator.h')
-rw-r--r-- | gcc/gimple-iterator.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/gimple-iterator.h b/gcc/gimple-iterator.h index 69fbdc3..e23d4b2 100644 --- a/gcc/gimple-iterator.h +++ b/gcc/gimple-iterator.h @@ -79,6 +79,7 @@ extern void gsi_insert_after (gimple_stmt_iterator *, gimple *, enum gsi_iterator_update); extern bool gsi_remove (gimple_stmt_iterator *, bool); extern gimple_stmt_iterator gsi_for_stmt (gimple *); +extern gimple_stmt_iterator gsi_for_stmt (gimple *, gimple_seq *); extern gphi_iterator gsi_for_phi (gphi *); extern void gsi_move_after (gimple_stmt_iterator *, gimple_stmt_iterator *); extern void gsi_move_before (gimple_stmt_iterator *, gimple_stmt_iterator *); |