diff options
author | Richard Biener <rguenther@suse.de> | 2024-09-02 11:16:12 +0200 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2024-09-03 08:36:18 +0200 |
commit | 340ca7437ceb05d61797dbf3b522a495176c5a5e (patch) | |
tree | 23069305573486f49dca29621ea67eee16a10c86 | |
parent | 62df24e50039ae04aa3b940e680cffd9041ef5bf (diff) | |
download | gcc-340ca7437ceb05d61797dbf3b522a495176c5a5e.zip gcc-340ca7437ceb05d61797dbf3b522a495176c5a5e.tar.gz gcc-340ca7437ceb05d61797dbf3b522a495176c5a5e.tar.bz2 |
Correctly handle store IFNs in vect_get_vector_types_for_stmt
Currently vect_get_vector_types_for_stmt only special-cases
IFN_MASK_STORE but there are now very many variants and simply
passing analysis without setting *VECTYPE will ICE duing SLP
discovery (noticed with IFN_SCATTER_STORE). The following
properly uses internal_store_fn_p. I also noticed we're
unnecessarily handing those again to determine the scalar type
but there should always be a data reference for them.
* tree-vect-stmts.cc (vect_get_vector_types_for_stmt):
Handle all internal_store_fn_p the same. Remove special-casing
for the scalar_type of IFN_MASK_STORE.
-rw-r--r-- | gcc/tree-vect-stmts.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index d2282c0..ace1c8e 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -14877,8 +14877,10 @@ vect_get_vector_types_for_stmt (vec_info *vinfo, stmt_vec_info stmt_info, if (gimple_get_lhs (stmt) == NULL_TREE /* Allow vector conditionals through here. */ && !is_a <gcond *> (stmt) - /* MASK_STORE has no lhs, but is ok. */ - && !gimple_call_internal_p (stmt, IFN_MASK_STORE)) + /* MASK_STORE and friends have no lhs, but are ok. */ + && !(is_gimple_call (stmt) + && gimple_call_internal_p (stmt) + && internal_store_fn_p (gimple_call_internal_fn (stmt)))) { if (is_a <gcall *> (stmt)) { @@ -14928,8 +14930,6 @@ vect_get_vector_types_for_stmt (vec_info *vinfo, stmt_vec_info stmt_info, if (data_reference *dr = STMT_VINFO_DATA_REF (stmt_info)) scalar_type = TREE_TYPE (DR_REF (dr)); - else if (gimple_call_internal_p (stmt, IFN_MASK_STORE)) - scalar_type = TREE_TYPE (gimple_call_arg (stmt, 3)); else scalar_type = TREE_TYPE (gimple_get_lhs (stmt)); |