diff options
author | Richard Biener <rguenther@suse.de> | 2020-08-26 15:12:17 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2020-08-26 16:02:32 +0200 |
commit | 2130efe6ac7beba72d289e3dd145daa10aeaed54 (patch) | |
tree | 9f9f63553ccafec89b413aea2df46de595dbf809 /gcc/tree-vectorizer.h | |
parent | 3eefb302d2bd8502cb3d8fe44e672b11092ccaf6 (diff) | |
download | gcc-2130efe6ac7beba72d289e3dd145daa10aeaed54.zip gcc-2130efe6ac7beba72d289e3dd145daa10aeaed54.tar.gz gcc-2130efe6ac7beba72d289e3dd145daa10aeaed54.tar.bz2 |
tree-optimization/96698 - fix ICE when vectorizing nested cycles
This fixes vectorized PHI latch edge updating and delay it until
all of the loop is code generated to deal with the case that the
latch def is a PHI in the same block.
2020-08-26 Richard Biener <rguenther@suse.de>
PR tree-optimization/96698
* tree-vectorizer.h (loop_vec_info::reduc_latch_defs): New.
(loop_vec_info::reduc_latch_slp_defs): Likewise.
* tree-vect-stmts.c (vect_transform_stmt): Only record
stmts to update PHI latches from, perform the update ...
* tree-vect-loop.c (vect_transform_loop): ... here after
vectorizing those PHIs.
(info_for_reduction): Properly handle non-reduction PHIs.
* gcc.dg/vect/pr96698.c: New testcase.
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r-- | gcc/tree-vectorizer.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 8551b68..f36e2ad 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -627,6 +627,11 @@ public: stmt in the chain. */ auto_vec<stmt_vec_info> reduction_chains; + /* The vectorized stmts defining the latch values of the reduction + they are involved with. */ + auto_vec<stmt_vec_info> reduc_latch_defs; + auto_vec<std::pair<slp_tree, slp_tree> > reduc_latch_slp_defs; + /* Cost vector for a single scalar iteration. */ auto_vec<stmt_info_for_cost> scalar_cost_vec; |