diff options
author | Richard Biener <rguenther@suse.de> | 2024-03-05 10:55:56 +0100 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2024-03-05 11:46:27 +0100 |
commit | 7890836de20912bd92afaf5abbeaf9d8c5b86542 (patch) | |
tree | 34ef7eba1fbf17a144117412343248461150df66 /gcc/tree-vect-slp.cc | |
parent | aed445b0fd0c7ed16124c61e7eb732992426f103 (diff) | |
download | gcc-7890836de20912bd92afaf5abbeaf9d8c5b86542.zip gcc-7890836de20912bd92afaf5abbeaf9d8c5b86542.tar.gz gcc-7890836de20912bd92afaf5abbeaf9d8c5b86542.tar.bz2 |
tree-optimization/114231 - use patterns for BB SLP discovery root stmts
The following makes sure to use recognized patterns when vectorizing
roots during BB SLP discovery. We need to apply those late since
during root discovery we've not yet done pattern recognition.
All parts of the vectorizer assume patterns get used, for the testcase
we mix this up when doing live lane computation.
PR tree-optimization/114231
* tree-vect-slp.cc (vect_analyze_slp): Lookup patterns when
processing a BB SLP root.
* gcc.dg/vect/pr114231.c: New testcase.
Diffstat (limited to 'gcc/tree-vect-slp.cc')
-rw-r--r-- | gcc/tree-vect-slp.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc index 895f4f7..324400d 100644 --- a/gcc/tree-vect-slp.cc +++ b/gcc/tree-vect-slp.cc @@ -3649,6 +3649,10 @@ vect_analyze_slp (vec_info *vinfo, unsigned max_tree_size) for (unsigned i = 0; i < bb_vinfo->roots.length (); ++i) { vect_location = bb_vinfo->roots[i].roots[0]->stmt; + /* Apply patterns. */ + for (unsigned j = 0; j < bb_vinfo->roots[i].stmts.length (); ++j) + bb_vinfo->roots[i].stmts[j] + = vect_stmt_to_vectorize (bb_vinfo->roots[i].stmts[j]); if (vect_build_slp_instance (bb_vinfo, bb_vinfo->roots[i].kind, bb_vinfo->roots[i].stmts, bb_vinfo->roots[i].roots, |