public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Kewen Lin <linkw@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-703] rs6000: Move rs6000_vect_nonmem into target cost_data
Date: Tue, 11 May 2021 06:06:07 +0000 (GMT)	[thread overview]
Message-ID: <20210511060607.510F43854801@sourceware.org> (raw)

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

commit r12-703-gb084bfd43a8b72d8db8702ff9cb316482662cb90
Author: Kewen Lin <linkw@linux.ibm.com>
Date:   Mon May 10 21:34:36 2021 -0500

    rs6000: Move rs6000_vect_nonmem into target cost_data
    
    This patch is to move rs6000_vect_nonmem (target cost_data
    related information) into target cost_data struct.
    As Richi pointed out, we can gather data from add_stmt_cost
    invocations.  This is one pre-step to centralize target
    cost_data related stuffs.
    
    gcc/ChangeLog:
    
            * config/rs6000/rs6000.c (rs6000_vect_nonmem): Renamed to
            vect_nonmem and moved into...
            (struct rs6000_cost_data): ...here.
            (rs6000_init_cost): Use vect_nonmem of cost_data instead.
            (rs6000_add_stmt_cost): Likewise.
            (rs6000_finish_cost): Likewise.

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

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index c852fb87848..96d0166d833 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -5235,6 +5235,9 @@ typedef struct _rs6000_cost_data
 {
   struct loop *loop_info;
   unsigned cost[3];
+  /* For each vectorized loop, this var holds TRUE iff a non-memory vector
+     instruction is needed by the vectorization.  */
+  bool vect_nonmem;
 } rs6000_cost_data;
 
 /* Test for likely overcommitment of vector hardware resources.  If a
@@ -5292,10 +5295,6 @@ rs6000_density_test (rs6000_cost_data *data)
 
 /* Implement targetm.vectorize.init_cost.  */
 
-/* For each vectorized loop, this var holds TRUE iff a non-memory vector
-   instruction is needed by the vectorization.  */
-static bool rs6000_vect_nonmem;
-
 static void *
 rs6000_init_cost (struct loop *loop_info)
 {
@@ -5304,7 +5303,7 @@ rs6000_init_cost (struct loop *loop_info)
   data->cost[vect_prologue] = 0;
   data->cost[vect_body]     = 0;
   data->cost[vect_epilogue] = 0;
-  rs6000_vect_nonmem = false;
+  data->vect_nonmem = false;
   return data;
 }
 
@@ -5364,7 +5363,7 @@ rs6000_add_stmt_cost (class vec_info *vinfo, void *data, int count,
 	   || kind == vec_promote_demote || kind == vec_construct
 	   || kind == scalar_to_vec)
 	  || (where == vect_body && kind == vector_stmt))
-	rs6000_vect_nonmem = true;
+	cost_data->vect_nonmem = true;
     }
 
   return retval;
@@ -5419,7 +5418,7 @@ rs6000_finish_cost (void *data, unsigned *prologue_cost,
   if (cost_data->loop_info)
     {
       loop_vec_info vec_info = loop_vec_info_for_loop (cost_data->loop_info);
-      if (!rs6000_vect_nonmem
+      if (!cost_data->vect_nonmem
 	  && LOOP_VINFO_VECT_FACTOR (vec_info) == 2
 	  && LOOP_REQUIRES_VERSIONING (vec_info))
 	cost_data->cost[vect_body] += 10000;


                 reply	other threads:[~2021-05-11  6:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210511060607.510F43854801@sourceware.org \
    --to=linkw@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).