diff options
author | Ira Rosen <ira.rosen@linaro.org> | 2011-06-30 06:37:41 +0000 |
---|---|---|
committer | Ira Rosen <irar@gcc.gnu.org> | 2011-06-30 06:37:41 +0000 |
commit | 83197f37339cecf1c89724341a85aae539751f84 (patch) | |
tree | 4f3bebd5f33136e8f6f42ff799dc8c7eb3704c7e /gcc/tree-vect-patterns.c | |
parent | 0dcd5f9db100c5c9d4209c04fdbe0f5bd75f2751 (diff) | |
download | gcc-83197f37339cecf1c89724341a85aae539751f84.zip gcc-83197f37339cecf1c89724341a85aae539751f84.tar.gz gcc-83197f37339cecf1c89724341a85aae539751f84.tar.bz2 |
tree-vect-loop.c (vect_determine_vectorization_factor): Handle both pattern and original statements if necessary.
* tree-vect-loop.c (vect_determine_vectorization_factor): Handle
both pattern and original statements if necessary.
(vect_transform_loop): Likewise.
* tree-vect-patterns.c (vect_pattern_recog): Update documentation.
* tree-vect-stmts.c (vect_mark_relevant): Add new argument.
Mark the pattern statement only if the original statement doesn't
have its own uses.
(process_use): Call vect_mark_relevant with additional parameter.
(vect_mark_stmts_to_be_vectorized): Likewise.
(vect_get_vec_def_for_operand): Use vectorized pattern statement.
(vect_analyze_stmt): Handle both pattern and original statements
if necessary.
(vect_transform_stmt): Don't store vectorized pattern statement
in the original statement.
(vect_is_simple_use_1): Use related pattern statement only if the
original statement is irrelevant.
* tree-vect-slp.c (vect_get_and_check_slp_defs): Likewise.
From-SVN: r175681
Diffstat (limited to 'gcc/tree-vect-patterns.c')
-rw-r--r-- | gcc/tree-vect-patterns.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c index 429dd87..758d4bc 100644 --- a/gcc/tree-vect-patterns.c +++ b/gcc/tree-vect-patterns.c @@ -1016,10 +1016,8 @@ vect_pattern_recog_1 ( If vectorization succeeds, vect_transform_stmt will skip over {S1,S2,S3} (because they are marked as irrelevant). It will vectorize S6, and record - a pointer to the new vector stmt VS6 both from S6 (as usual), and also - from S4. We do that so that when we get to vectorizing stmts that use the - def of S4 (like S5 that uses a_0), we'll know where to take the relevant - vector-def from. S4 will be skipped, and S5 will be vectorized as usual: + a pointer to the new vector stmt VS6 from S6 (as usual). + S4 will be skipped, and S5 will be vectorized as usual: in_pattern_p related_stmt vec_stmt S1: a_i = .... - - - @@ -1035,7 +1033,21 @@ vect_pattern_recog_1 ( elsewhere), and we'll end up with: VS6: va_new = .... - VS5: ... = ..vuse(va_new).. */ + VS5: ... = ..vuse(va_new).. + + In case of more than one pattern statements, e.g., widen-mult with + intermediate type: + + S1 a_t = ; + S2 a_T = (TYPE) a_t; + '--> S3: a_it = (interm_type) a_t; + S4 prod_T = a_T * CONST; + '--> S5: prod_T' = a_it w* CONST; + + there may be other users of a_T outside the pattern. In that case S2 will + be marked as relevant (as well as S3), and both S2 and S3 will be analyzed + and vectorized. The vector stmt VS2 will be recorded in S2, and VS3 will + be recorded in S3. */ void vect_pattern_recog (loop_vec_info loop_vinfo) |