diff options
author | Richard Biener <rguenther@suse.de> | 2023-08-22 14:28:00 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2023-08-22 14:28:00 +0200 |
commit | 2c27600fa79431576f47d55b9ed7b2f4790def67 (patch) | |
tree | 001f1b66cf7e0e6cea7b1f509fa1db13f0a03b15 /gcc | |
parent | 9e5b47b457088114698a64dc6477335cecbf8b19 (diff) | |
download | gcc-2c27600fa79431576f47d55b9ed7b2f4790def67.zip gcc-2c27600fa79431576f47d55b9ed7b2f4790def67.tar.gz gcc-2c27600fa79431576f47d55b9ed7b2f4790def67.tar.bz2 |
Simplify intereaved store vectorization processing
When doing interleaving we perform code generation when visiting the
last store of a chain. We keep track of this via DR_GROUP_STORE_COUNT,
the following localizes this to the caller of vectorizable_store,
also avoing redundant non-processing of the other stores.
* tree-vect-stmts.cc (vectorizable_store): Do not bump
DR_GROUP_STORE_COUNT here. Remove early out.
(vect_transform_stmt): Only call vectorizable_store on
the last element of an interleaving chain.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/tree-vect-stmts.cc | 40 |
1 files changed, 14 insertions, 26 deletions
diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index 33f62b7..43502dc 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -8429,24 +8429,11 @@ vectorizable_store (vec_info *vinfo, else if (STMT_VINFO_SIMD_LANE_ACCESS_P (stmt_info) >= 3) return vectorizable_scan_store (vinfo, stmt_info, gsi, vec_stmt, ncopies); - if (STMT_VINFO_GROUPED_ACCESS (stmt_info)) - DR_GROUP_STORE_COUNT (DR_GROUP_FIRST_ELEMENT (stmt_info))++; - if (grouped_store) { /* FORNOW */ gcc_assert (!loop || !nested_in_vect_loop_p (loop, stmt_info)); - /* We vectorize all the stmts of the interleaving group when we - reach the last stmt in the group. */ - if (DR_GROUP_STORE_COUNT (first_stmt_info) - < DR_GROUP_SIZE (first_stmt_info) - && !slp) - { - *vec_stmt = NULL; - return true; - } - if (slp) { grouped_store = false; @@ -12487,21 +12474,22 @@ vect_transform_stmt (vec_info *vinfo, break; case store_vec_info_type: - done = vectorizable_store (vinfo, stmt_info, - gsi, &vec_stmt, slp_node, NULL); - gcc_assert (done); - if (STMT_VINFO_GROUPED_ACCESS (stmt_info) && !slp_node) + if (STMT_VINFO_GROUPED_ACCESS (stmt_info) + && !slp_node + && (++DR_GROUP_STORE_COUNT (DR_GROUP_FIRST_ELEMENT (stmt_info)) + < DR_GROUP_SIZE (DR_GROUP_FIRST_ELEMENT (stmt_info)))) + /* In case of interleaving, the whole chain is vectorized when the + last store in the chain is reached. Store stmts before the last + one are skipped, and there vec_stmt_info shouldn't be freed + meanwhile. */ + ; + else { - /* In case of interleaving, the whole chain is vectorized when the - last store in the chain is reached. Store stmts before the last - one are skipped, and there vec_stmt_info shouldn't be freed - meanwhile. */ - stmt_vec_info group_info = DR_GROUP_FIRST_ELEMENT (stmt_info); - if (DR_GROUP_STORE_COUNT (group_info) == DR_GROUP_SIZE (group_info)) - is_store = true; + done = vectorizable_store (vinfo, stmt_info, + gsi, &vec_stmt, slp_node, NULL); + gcc_assert (done); + is_store = true; } - else - is_store = true; break; case condition_vec_info_type: |