diff options
author | Richard Biener <rguenther@suse.de> | 2019-07-04 13:55:15 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2019-07-04 13:55:15 +0000 |
commit | 5cee32399049534903f3ddb0bf55657b909492f4 (patch) | |
tree | 17ab89e8de21203b0ece5a305b55f5e21cee285b /gcc/tree-vect-loop-manip.c | |
parent | 5bb8f28194ee8271357051441db27decbd74d5c5 (diff) | |
download | gcc-5cee32399049534903f3ddb0bf55657b909492f4.zip gcc-5cee32399049534903f3ddb0bf55657b909492f4.tar.gz gcc-5cee32399049534903f3ddb0bf55657b909492f4.tar.bz2 |
re PR tree-optimization/90911 (456.hmmer regression with r272239)
2019-07-04 Richard Biener <rguenther@suse.de>
PR tree-optimization/90911
* tree-vectorizer.h (_loop_vec_info::scalar_loop_scaling): New field.
(LOOP_VINFO_SCALAR_LOOP_SCALING): new.
* tree-vect-loop.c (_loop_vec_info::_loop_vec_info): Initialize
scalar_loop_scaling.
(vect_transform_loop): Scale scalar loop profile if needed.
* tree-vect-loop-manip.c (vect_loop_versioning): When re-using
the loop copy from if-conversion adjust edge probabilities
and scale the vectorized loop body profile, queue the scalar
profile for updating after peeling.
From-SVN: r273082
Diffstat (limited to 'gcc/tree-vect-loop-manip.c')
-rw-r--r-- | gcc/tree-vect-loop-manip.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c index c5cabc8..bd8fffb 100644 --- a/gcc/tree-vect-loop-manip.c +++ b/gcc/tree-vect-loop-manip.c @@ -3114,8 +3114,17 @@ vect_loop_versioning (loop_vec_info loop_vinfo, GSI_SAME_STMT); } - /* ??? if-conversion uses profile_probability::always () but - prob below is profile_probability::likely (). */ + /* if-conversion uses profile_probability::always () for both paths, + reset the paths probabilities appropriately. */ + edge te, fe; + extract_true_false_edges_from_block (condition_bb, &te, &fe); + te->probability = prob; + fe->probability = prob.invert (); + /* We can scale loops counts immediately but have to postpone + scaling the scalar loop because we re-use it during peeling. */ + scale_loop_frequencies (loop_to_version, te->probability); + LOOP_VINFO_SCALAR_LOOP_SCALING (loop_vinfo) = fe->probability; + nloop = scalar_loop; if (dump_enabled_p ()) dump_printf_loc (MSG_NOTE, vect_location, |