diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2021-01-03 21:40:04 +0100 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2021-01-03 21:40:04 +0100 |
commit | afae4a55ccaa0de95ea11e5f634084db6ab2f444 (patch) | |
tree | d632cc867d10410ba9fb750523be790b86846ac4 /gcc/tree-vectorizer.c | |
parent | 9d9a82ec8478ff52c7a9d61f58cd2a7b6295b5f9 (diff) | |
parent | d2eb616a0f7bea78164912aa438c29fe1ef5774a (diff) | |
download | gcc-afae4a55ccaa0de95ea11e5f634084db6ab2f444.zip gcc-afae4a55ccaa0de95ea11e5f634084db6ab2f444.tar.gz gcc-afae4a55ccaa0de95ea11e5f634084db6ab2f444.tar.bz2 |
Merge branch 'master' into devel/coarray_native
Diffstat (limited to 'gcc/tree-vectorizer.c')
-rw-r--r-- | gcc/tree-vectorizer.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c index 778177a..3992849 100644 --- a/gcc/tree-vectorizer.c +++ b/gcc/tree-vectorizer.c @@ -525,6 +525,19 @@ vec_info::add_stmt (gimple *stmt) return res; } +/* Record that STMT belongs to the vectorizable region. Create a new + stmt_vec_info and mark VECINFO as being related and return the new + stmt_vec_info. */ + +stmt_vec_info +vec_info::add_pattern_stmt (gimple *stmt, stmt_vec_info stmt_info) +{ + stmt_vec_info res = new_stmt_vec_info (stmt); + set_vinfo_for_stmt (stmt, res, false); + STMT_VINFO_RELATED_STMT (res) = stmt_info; + return res; +} + /* If STMT has an associated stmt_vec_info, return that vec_info, otherwise return null. It is safe to call this function on any statement, even if it might not be part of the vectorizable region. */ @@ -684,7 +697,8 @@ vec_info::new_stmt_vec_info (gimple *stmt) STMT_VINFO_SLP_VECT_ONLY (res) = false; STMT_VINFO_VEC_STMTS (res) = vNULL; - if (gimple_code (stmt) == GIMPLE_PHI + if (is_a <loop_vec_info> (this) + && gimple_code (stmt) == GIMPLE_PHI && is_loop_header_bb_p (gimple_bb (stmt))) STMT_VINFO_DEF_TYPE (res) = vect_unknown_def_type; else @@ -701,12 +715,12 @@ vec_info::new_stmt_vec_info (gimple *stmt) /* Associate STMT with INFO. */ void -vec_info::set_vinfo_for_stmt (gimple *stmt, stmt_vec_info info) +vec_info::set_vinfo_for_stmt (gimple *stmt, stmt_vec_info info, bool check_ro) { unsigned int uid = gimple_uid (stmt); if (uid == 0) { - gcc_assert (!stmt_vec_info_ro); + gcc_assert (!check_ro || !stmt_vec_info_ro); gcc_checking_assert (info); uid = stmt_vec_infos.length () + 1; gimple_set_uid (stmt, uid); @@ -1170,6 +1184,8 @@ vectorize_loops (void) if (vect_loops_num <= 1) return 0; + vect_slp_init (); + if (cfun->has_simduid_loops) note_simd_array_uses (&simd_array_to_simduid_htab); @@ -1292,6 +1308,7 @@ vectorize_loops (void) shrink_simd_arrays (simd_array_to_simduid_htab, simduid_to_vf_htab); delete simduid_to_vf_htab; cfun->has_simduid_loops = false; + vect_slp_fini (); if (num_vectorized_loops > 0) { @@ -1427,8 +1444,12 @@ pass_slp_vectorize::execute (function *fun) } } + vect_slp_init (); + vect_slp_function (fun); + vect_slp_fini (); + if (!in_loop_pipeline) { scev_finalize (); |