public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/autopar_devel] rs6000: Refine RTL unroll hook for small loops
@ 2020-08-22 23:40 Giuliano Belinassi
  0 siblings, 0 replies; only message in thread
From: Giuliano Belinassi @ 2020-08-22 23:40 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:4d0ff0ab72f3adfd40b0248c599ae5a4cb8ba8a6

commit 4d0ff0ab72f3adfd40b0248c599ae5a4cb8ba8a6
Author: guojiufu <guojiufu@linux.ibm.com>
Date:   Wed Jul 15 16:07:47 2020 +0800

    rs6000: Refine RTL unroll hook for small loops
    
    For very small loops (< 6 insns), it would be fine to unroll 4
    times to run fast with less latency and better cache usage.  Like
    below loops:
     while (i) a[--i] = NULL;   while (p < e)  *d++ = *p++;
    
    With this patch enhances, we could see some performance improvement
    for some workloads(e.g. SPEC2017).
    
    2020-07-13  Jiufu Guo   <guojiufu@cn.ibm.com>
    
            * config/rs6000/rs6000.c (rs6000_loop_unroll_adjust): Refine hook.

Diff:
---
 gcc/config/rs6000/rs6000.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index dda51d5877a..c5c3300c59c 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -5212,13 +5212,14 @@ rs6000_loop_unroll_adjust (unsigned nunroll, struct loop *loop)
 {
    if (unroll_only_small_loops)
     {
-      /* TODO: This is hardcoded to 10 right now.  It can be refined, for
-	 example we may want to unroll very small loops more times (4 perhaps).
-	 We also should use a PARAM for this.  */
+      /* TODO: These are hardcoded values right now.  We probably should use
+	 a PARAM here.  */
+      if (loop->ninsns <= 6)
+	return MIN (4, nunroll);
       if (loop->ninsns <= 10)
 	return MIN (2, nunroll);
-      else
-	return 0;
+
+      return 0;
     }
 
   return nunroll;


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

only message in thread, other threads:[~2020-08-22 23:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-22 23:40 [gcc/devel/autopar_devel] rs6000: Refine RTL unroll hook for small loops Giuliano Belinassi

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).