tree-optimization/102128 - rework if-converted BB vect heuristic
authorRichard Biener <rguenther@suse.de>
Mon, 30 Aug 2021 10:56:26 +0000 (12:56 +0200)
committerRichard Biener <rguenther@suse.de>
Mon, 30 Aug 2021 12:03:56 +0000 (14:03 +0200)
commit89f33f44addbf9853bc3e6677db1fa941713cb6c
tree879065a3fa94ab9273351771794aecbd4dbf3fc3
parent1313111fdec0d0de4228b5e839ca728b3e4b106e
tree-optimization/102128 - rework if-converted BB vect heuristic

This reworks the previous attempt to avoid leaving around if-converted
scalar code in BB vectorized loop bodies to keep costing independent
subgraphs which should address the observed regression with 519.lbm_r.

For this to work we now first cost all subgraphs and only after
doing that proceed to emit vectorized code.

2021-08-30  Richard Biener  <rguenther@suse.de>

PR tree-optimization/102128
* tree-vect-slp.c (vect_bb_vectorization_profitable_p):
Move scanning for if-converted scalar code to the caller
and instead delay clearing the visited flag for profitable
subgraphs.
(vect_slp_region): Cost all subgraphs before scheduling.
For if-converted BB vectorization scan for scalar COND_EXPRs
and do not vectorize if any found and the cost model is
very-cheap.
gcc/tree-vect-slp.c