diff options
author | Richard Biener <rguenther@suse.de> | 2024-01-23 12:53:04 +0100 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2024-01-23 14:09:30 +0100 |
commit | d5d43dc399bb0f15084827c59a025189c630afdd (patch) | |
tree | e5cadca11fcc6105f3a63d0a260707326e86518f /gcc | |
parent | ac98aa7828b5eb94f12d06a275b95581a34392e4 (diff) | |
download | gcc-d5d43dc399bb0f15084827c59a025189c630afdd.zip gcc-d5d43dc399bb0f15084827c59a025189c630afdd.tar.gz gcc-d5d43dc399bb0f15084827c59a025189c630afdd.tar.bz2 |
tree-optimization/113552 - fix num_call accounting in simd clone vectorization
The following avoids using exact_log2 on the number of SIMD clone calls
to be emitted when vectorizing calls since that can easily be not
a power of two in which case it will return -1. For different simd
clones the number of calls will differ by a multiply with a power of two
only so using floor_log2 is good enough here.
PR tree-optimization/113552
* tree-vect-stmts.cc (vectorizable_simd_clone_call): Use
floor_log2 instead of exact_log2 on the number of calls.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/tree-vect-stmts.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index 09749ae..1dbe111 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -4071,7 +4071,7 @@ vectorizable_simd_clone_call (vec_info *vinfo, stmt_vec_info stmt_info, || (nargs != simd_nargs)) continue; if (num_calls != 1) - this_badness += exact_log2 (num_calls) * 4096; + this_badness += floor_log2 (num_calls) * 4096; if (n->simdclone->inbranch) this_badness += 8192; int target_badness = targetm.simd_clone.usable (n); |