diff options
author | Andre Vieira <andre.simoesdiasvieira@arm.com> | 2019-10-17 12:35:33 +0000 |
---|---|---|
committer | Andre Vieira <avieira@gcc.gnu.org> | 2019-10-17 12:35:33 +0000 |
commit | f261d4808cc28a2dfd47fe06c97364c0869bb78f (patch) | |
tree | 322b1cca87cacc83adf073d47420d9177ab0432c /gcc | |
parent | 31b35fd503e1c6713839db24044812d237aba5f1 (diff) | |
download | gcc-f261d4808cc28a2dfd47fe06c97364c0869bb78f.zip gcc-f261d4808cc28a2dfd47fe06c97364c0869bb78f.tar.gz gcc-f261d4808cc28a2dfd47fe06c97364c0869bb78f.tar.bz2 |
[vect] Be consistent in versioning threshold use
gcc/ChangeLog:
2019-10-17 Andre Vieira <andre.simoesdiasvieira@arm.com>
* tree-vect-loop.c (vect_analyze_loop_2): Use same condition to decide
when to use versioning threshold.
From-SVN: r277105
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/tree-vect-loop.c | 9 |
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9b17a6d..9c0e754 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2019-10-17 Andre Vieira <andre.simoesdiasvieira@arm.com> + * tree-vect-loop.c (vect_analyze_loop_2): Use same condition to decide + when to use versioning threshold. + +2019-10-17 Andre Vieira <andre.simoesdiasvieira@arm.com> + * tree-vect-loop.c (determine_peel_for_niter): New function contained outlined code from ... (vect_analyze_loop_2): ... here. diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index df9f159..fa5c216 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -2154,6 +2154,7 @@ start_over: if (LOOP_REQUIRES_VERSIONING (loop_vinfo)) { poly_uint64 niters_th = 0; + unsigned int th = LOOP_VINFO_COST_MODEL_THRESHOLD (loop_vinfo); if (!vect_use_loop_mask_for_alignment_p (loop_vinfo)) { @@ -2174,6 +2175,14 @@ start_over: /* One additional iteration because of peeling for gap. */ if (LOOP_VINFO_PEELING_FOR_GAPS (loop_vinfo)) niters_th += 1; + + /* Use the same condition as vect_transform_loop to decide when to use + the cost to determine a versioning threshold. */ + if (th >= vect_vf_for_cost (loop_vinfo) + && !LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo) + && ordered_p (th, niters_th)) + niters_th = ordered_max (poly_uint64 (th), niters_th); + LOOP_VINFO_VERSIONING_THRESHOLD (loop_vinfo) = niters_th; } |