diff options
author | Richard Biener <rguenther@suse.de> | 2019-04-10 11:25:10 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2019-04-10 11:25:10 +0000 |
commit | f95b75977014fbbc919bd7a478bbaab24438b001 (patch) | |
tree | f4b9adc4685a10454e6dc661870bd75437ddcf36 /gcc | |
parent | 4a3f7992d2d9049eb80b30f93fb142b24dfe1685 (diff) | |
download | gcc-f95b75977014fbbc919bd7a478bbaab24438b001.zip gcc-f95b75977014fbbc919bd7a478bbaab24438b001.tar.gz gcc-f95b75977014fbbc919bd7a478bbaab24438b001.tar.bz2 |
tree-vectorizer.h (_stmt_vec_info): Remove same_dr_stmt member.
2019-04-10 Richard Biener <rguenther@suse.de>
* tree-vectorizer.h (_stmt_vec_info): Remove same_dr_stmt
member.
(DR_GROUP_SAME_DR_STMT): Remove.
* tree-vect-stmts.c (vectorizable_load): Remove unreachable code.
* tree-vect-data-refs.c (vect_analyze_group_access_1): Likewise,
replace with assert.
(vect_analyze_data_ref_accesses): Fix INTEGER_CST comparison.
(vect_record_grouped_load_vectors): Remove unreachable code.
From-SVN: r270250
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/tree-vect-data-refs.c | 75 | ||||
-rw-r--r-- | gcc/tree-vect-stmts.c | 13 | ||||
-rw-r--r-- | gcc/tree-vectorizer.h | 5 |
4 files changed, 33 insertions, 71 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 709409e..7dd4305 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2019-04-10 Richard Biener <rguenther@suse.de> + + * tree-vectorizer.h (_stmt_vec_info): Remove same_dr_stmt + member. + (DR_GROUP_SAME_DR_STMT): Remove. + * tree-vect-stmts.c (vectorizable_load): Remove unreachable code. + * tree-vect-data-refs.c (vect_analyze_group_access_1): Likewise, + replace with assert. + (vect_analyze_data_ref_accesses): Fix INTEGER_CST comparison. + (vect_record_grouped_load_vectors): Remove unreachable code. + 2019-04-10 Richard Earnshaw <rearnsha@arm.com> PR target/90016 diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index 271cb58..85997cf 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -2523,40 +2523,15 @@ vect_analyze_group_access_1 (dr_vec_info *dr_info) struct data_reference *data_ref = dr; unsigned int count = 1; tree prev_init = DR_INIT (data_ref); - stmt_vec_info prev = stmt_info; HOST_WIDE_INT diff, gaps = 0; /* By construction, all group members have INTEGER_CST DR_INITs. */ while (next) { - /* Skip same data-refs. In case that two or more stmts share - data-ref (supported only for loads), we vectorize only the first - stmt, and the rest get their vectorized loads from the first - one. */ - if (!tree_int_cst_compare (DR_INIT (data_ref), - DR_INIT (STMT_VINFO_DATA_REF (next)))) - { - if (DR_IS_WRITE (data_ref)) - { - if (dump_enabled_p ()) - dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, - "Two store stmts share the same dr.\n"); - return false; - } - - if (dump_enabled_p ()) - dump_printf_loc (MSG_NOTE, vect_location, - "Two or more load stmts share the same dr.\n"); - - /* For load use the same data-ref load. */ - DR_GROUP_SAME_DR_STMT (next) = prev; - - prev = next; - next = DR_GROUP_NEXT_ELEMENT (next); - continue; - } + /* We never have the same DR multiple times. */ + gcc_assert (tree_int_cst_compare (DR_INIT (data_ref), + DR_INIT (STMT_VINFO_DATA_REF (next))) != 0); - prev = next; data_ref = STMT_VINFO_DATA_REF (next); /* All group members have the same STEP by construction. */ @@ -3072,8 +3047,8 @@ vect_analyze_data_ref_accesses (vec_info *vinfo) stmt_vec_info next, g = grp; while ((next = DR_GROUP_NEXT_ELEMENT (g))) { - if ((DR_INIT (STMT_VINFO_DR_INFO (next)->dr) - == DR_INIT (STMT_VINFO_DR_INFO (g)->dr)) + if (tree_int_cst_equal (DR_INIT (STMT_VINFO_DR_INFO (next)->dr), + DR_INIT (STMT_VINFO_DR_INFO (g)->dr)) && gimple_uid (STMT_VINFO_STMT (next)) < first_duplicate) first_duplicate = gimple_uid (STMT_VINFO_STMT (next)); g = next; @@ -6329,12 +6304,14 @@ vect_record_grouped_load_vectors (stmt_vec_info stmt_info, correspond to the gaps. */ if (next_stmt_info != first_stmt_info && gap_count < DR_GROUP_GAP (next_stmt_info)) - { - gap_count++; - continue; - } + { + gap_count++; + continue; + } - while (next_stmt_info) + /* ??? The following needs cleanup after the removal of + DR_GROUP_SAME_DR_STMT. */ + if (next_stmt_info) { stmt_vec_info new_stmt_info = vinfo->lookup_def (tmp_data_ref); /* We assume that if VEC_STMT is not NULL, this is a case of multiple @@ -6344,29 +6321,21 @@ vect_record_grouped_load_vectors (stmt_vec_info stmt_info, STMT_VINFO_VEC_STMT (next_stmt_info) = new_stmt_info; else { - if (!DR_GROUP_SAME_DR_STMT (next_stmt_info)) - { - stmt_vec_info prev_stmt_info - = STMT_VINFO_VEC_STMT (next_stmt_info); - stmt_vec_info rel_stmt_info - = STMT_VINFO_RELATED_STMT (prev_stmt_info); - while (rel_stmt_info) - { - prev_stmt_info = rel_stmt_info; - rel_stmt_info = STMT_VINFO_RELATED_STMT (rel_stmt_info); - } + stmt_vec_info prev_stmt_info + = STMT_VINFO_VEC_STMT (next_stmt_info); + stmt_vec_info rel_stmt_info + = STMT_VINFO_RELATED_STMT (prev_stmt_info); + while (rel_stmt_info) + { + prev_stmt_info = rel_stmt_info; + rel_stmt_info = STMT_VINFO_RELATED_STMT (rel_stmt_info); + } - STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt_info; - } + STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt_info; } next_stmt_info = DR_GROUP_NEXT_ELEMENT (next_stmt_info); gap_count = 1; - /* If NEXT_STMT_INFO accesses the same DR as the previous statement, - put the same TMP_DATA_REF as its vectorized statement; otherwise - get the next data-ref from RESULT_CHAIN. */ - if (!next_stmt_info || !DR_GROUP_SAME_DR_STMT (next_stmt_info)) - break; } } } diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 2388c93..41a7eb0 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -7704,19 +7704,6 @@ vectorizable_load (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, "group loads with negative dependence distance\n"); return false; } - - /* Similarly when the stmt is a load that is both part of a SLP - instance and a loop vectorized stmt via the same-dr mechanism - we have to give up. */ - if (DR_GROUP_SAME_DR_STMT (stmt_info) - && (STMT_SLP_TYPE (stmt_info) - != STMT_SLP_TYPE (DR_GROUP_SAME_DR_STMT (stmt_info)))) - { - if (dump_enabled_p ()) - dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, - "conflicting SLP types for CSEd load\n"); - return false; - } } else group_size = 1; diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index d67c544..6f59af6 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -872,9 +872,6 @@ struct _stmt_vec_info { stmt_vec_info first_element; /* Pointer to the next element in the group. */ stmt_vec_info next_element; - /* For data-refs, in case that two or more stmts share data-ref, this is the - pointer to the previously detected stmt with the same dr. */ - stmt_vec_info same_dr_stmt; /* The size of the group. */ unsigned int size; /* For stores, number of stores from this group seen. We vectorize the last @@ -1044,8 +1041,6 @@ STMT_VINFO_BB_VINFO (stmt_vec_info stmt_vinfo) (gcc_checking_assert ((S)->dr_aux.dr), (S)->store_count) #define DR_GROUP_GAP(S) \ (gcc_checking_assert ((S)->dr_aux.dr), (S)->gap) -#define DR_GROUP_SAME_DR_STMT(S) \ - (gcc_checking_assert ((S)->dr_aux.dr), (S)->same_dr_stmt) #define REDUC_GROUP_FIRST_ELEMENT(S) \ (gcc_checking_assert (!(S)->dr_aux.dr), (S)->first_element) |