public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-8357] tree-optimization/113552 - fix num_call accounting in simd clone vectorization
@ 2024-01-23 13:10 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2024-01-23 13:10 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:d5d43dc399bb0f15084827c59a025189c630afdd

commit r14-8357-gd5d43dc399bb0f15084827c59a025189c630afdd
Author: Richard Biener <rguenther@suse.de>
Date:   Tue Jan 23 12:53:04 2024 +0100

    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.

Diff:
---
 gcc/tree-vect-stmts.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index 09749ae3817..1dbe1115da4 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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-23 13:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-23 13:10 [gcc r14-8357] tree-optimization/113552 - fix num_call accounting in simd clone vectorization Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).