public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] RISC-V: Remove redundant functions
@ 2023-09-11  9:19 Juzhe-Zhong
  2023-09-11  9:25 ` Kito Cheng
  0 siblings, 1 reply; 3+ messages in thread
From: Juzhe-Zhong @ 2023-09-11  9:19 UTC (permalink / raw)
  To: gcc-patches; +Cc: kito.cheng, kito.cheng, jeffreyalaw, rdapp.gcc, Juzhe-Zhong

I just finished V2 version of LMUL cost model.
Turns out we don't these redundant functions.

Remove them.

gcc/ChangeLog:

	* config/riscv/riscv-protos.h (get_all_predecessors): Remove.
	(get_all_successors): Ditto.
	* config/riscv/riscv-v.cc (get_all_predecessors): Ditto.
	(get_all_successors): Ditto.

---
 gcc/config/riscv/riscv-protos.h |  2 --
 gcc/config/riscv/riscv-v.cc     | 48 ---------------------------------
 2 files changed, 50 deletions(-)

diff --git a/gcc/config/riscv/riscv-protos.h b/gcc/config/riscv/riscv-protos.h
index 46d77ef927c..e91a55ec057 100644
--- a/gcc/config/riscv/riscv-protos.h
+++ b/gcc/config/riscv/riscv-protos.h
@@ -498,8 +498,6 @@ enum floating_point_rounding_mode get_frm_mode (rtx);
 opt_machine_mode vectorize_related_mode (machine_mode, scalar_mode,
 					 poly_uint64);
 unsigned int autovectorize_vector_modes (vec<machine_mode> *, bool);
-hash_set<basic_block> get_all_predecessors (basic_block);
-hash_set<basic_block> get_all_successors (basic_block);
 bool cmp_lmul_le_one (machine_mode);
 bool cmp_lmul_gt_one (machine_mode);
 }
diff --git a/gcc/config/riscv/riscv-v.cc b/gcc/config/riscv/riscv-v.cc
index 3cd1f61de0e..4d95bd773a2 100644
--- a/gcc/config/riscv/riscv-v.cc
+++ b/gcc/config/riscv/riscv-v.cc
@@ -3388,54 +3388,6 @@ expand_fold_extract_last (rtx *ops)
   emit_label (end_label);
 }
 
-hash_set<basic_block>
-get_all_predecessors (basic_block bb)
-{
-  hash_set<basic_block> blocks;
-  auto_vec<basic_block> work_list;
-  hash_set<basic_block> visited_list;
-  work_list.safe_push (bb);
-
-  while (!work_list.is_empty ())
-    {
-      basic_block new_bb = work_list.pop ();
-      visited_list.add (new_bb);
-      edge e;
-      edge_iterator ei;
-      FOR_EACH_EDGE (e, ei, new_bb->preds)
-	{
-	  if (!visited_list.contains (e->src))
-	    work_list.safe_push (e->src);
-	  blocks.add (e->src);
-	}
-    }
-  return blocks;
-}
-
-hash_set<basic_block>
-get_all_successors (basic_block bb)
-{
-  hash_set<basic_block> blocks;
-  auto_vec<basic_block> work_list;
-  hash_set<basic_block> visited_list;
-  work_list.safe_push (bb);
-
-  while (!work_list.is_empty ())
-    {
-      basic_block new_bb = work_list.pop ();
-      visited_list.add (new_bb);
-      edge e;
-      edge_iterator ei;
-      FOR_EACH_EDGE (e, ei, new_bb->succs)
-	{
-	  if (!visited_list.contains (e->dest))
-	    work_list.safe_push (e->dest);
-	  blocks.add (e->dest);
-	}
-    }
-  return blocks;
-}
-
 /* Return true if the LMUL of comparison less than or equal to one.  */
 bool
 cmp_lmul_le_one (machine_mode mode)
-- 
2.36.3


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] RISC-V: Remove redundant functions
  2023-09-11  9:19 [PATCH] RISC-V: Remove redundant functions Juzhe-Zhong
@ 2023-09-11  9:25 ` Kito Cheng
  2023-09-11 10:28   ` Li, Pan2
  0 siblings, 1 reply; 3+ messages in thread
From: Kito Cheng @ 2023-09-11  9:25 UTC (permalink / raw)
  To: Juzhe-Zhong; +Cc: gcc-patches, kito.cheng, jeffreyalaw, rdapp.gcc

LGTM

On Mon, Sep 11, 2023 at 5:20 PM Juzhe-Zhong <juzhe.zhong@rivai.ai> wrote:
>
> I just finished V2 version of LMUL cost model.
> Turns out we don't these redundant functions.
>
> Remove them.
>
> gcc/ChangeLog:
>
>         * config/riscv/riscv-protos.h (get_all_predecessors): Remove.
>         (get_all_successors): Ditto.
>         * config/riscv/riscv-v.cc (get_all_predecessors): Ditto.
>         (get_all_successors): Ditto.
>
> ---
>  gcc/config/riscv/riscv-protos.h |  2 --
>  gcc/config/riscv/riscv-v.cc     | 48 ---------------------------------
>  2 files changed, 50 deletions(-)
>
> diff --git a/gcc/config/riscv/riscv-protos.h b/gcc/config/riscv/riscv-protos.h
> index 46d77ef927c..e91a55ec057 100644
> --- a/gcc/config/riscv/riscv-protos.h
> +++ b/gcc/config/riscv/riscv-protos.h
> @@ -498,8 +498,6 @@ enum floating_point_rounding_mode get_frm_mode (rtx);
>  opt_machine_mode vectorize_related_mode (machine_mode, scalar_mode,
>                                          poly_uint64);
>  unsigned int autovectorize_vector_modes (vec<machine_mode> *, bool);
> -hash_set<basic_block> get_all_predecessors (basic_block);
> -hash_set<basic_block> get_all_successors (basic_block);
>  bool cmp_lmul_le_one (machine_mode);
>  bool cmp_lmul_gt_one (machine_mode);
>  }
> diff --git a/gcc/config/riscv/riscv-v.cc b/gcc/config/riscv/riscv-v.cc
> index 3cd1f61de0e..4d95bd773a2 100644
> --- a/gcc/config/riscv/riscv-v.cc
> +++ b/gcc/config/riscv/riscv-v.cc
> @@ -3388,54 +3388,6 @@ expand_fold_extract_last (rtx *ops)
>    emit_label (end_label);
>  }
>
> -hash_set<basic_block>
> -get_all_predecessors (basic_block bb)
> -{
> -  hash_set<basic_block> blocks;
> -  auto_vec<basic_block> work_list;
> -  hash_set<basic_block> visited_list;
> -  work_list.safe_push (bb);
> -
> -  while (!work_list.is_empty ())
> -    {
> -      basic_block new_bb = work_list.pop ();
> -      visited_list.add (new_bb);
> -      edge e;
> -      edge_iterator ei;
> -      FOR_EACH_EDGE (e, ei, new_bb->preds)
> -       {
> -         if (!visited_list.contains (e->src))
> -           work_list.safe_push (e->src);
> -         blocks.add (e->src);
> -       }
> -    }
> -  return blocks;
> -}
> -
> -hash_set<basic_block>
> -get_all_successors (basic_block bb)
> -{
> -  hash_set<basic_block> blocks;
> -  auto_vec<basic_block> work_list;
> -  hash_set<basic_block> visited_list;
> -  work_list.safe_push (bb);
> -
> -  while (!work_list.is_empty ())
> -    {
> -      basic_block new_bb = work_list.pop ();
> -      visited_list.add (new_bb);
> -      edge e;
> -      edge_iterator ei;
> -      FOR_EACH_EDGE (e, ei, new_bb->succs)
> -       {
> -         if (!visited_list.contains (e->dest))
> -           work_list.safe_push (e->dest);
> -         blocks.add (e->dest);
> -       }
> -    }
> -  return blocks;
> -}
> -
>  /* Return true if the LMUL of comparison less than or equal to one.  */
>  bool
>  cmp_lmul_le_one (machine_mode mode)
> --
> 2.36.3
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] RISC-V: Remove redundant functions
  2023-09-11  9:25 ` Kito Cheng
@ 2023-09-11 10:28   ` Li, Pan2
  0 siblings, 0 replies; 3+ messages in thread
From: Li, Pan2 @ 2023-09-11 10:28 UTC (permalink / raw)
  To: Kito Cheng, Juzhe-Zhong; +Cc: gcc-patches, kito.cheng

Committed, thanks Kito.

Pan

-----Original Message-----
From: Gcc-patches <gcc-patches-bounces+pan2.li=intel.com@gcc.gnu.org> On Behalf Of Kito Cheng via Gcc-patches
Sent: Monday, September 11, 2023 5:26 PM
To: Juzhe-Zhong <juzhe.zhong@rivai.ai>
Cc: gcc-patches@gcc.gnu.org; kito.cheng@gmail.com
Subject: Re: [PATCH] RISC-V: Remove redundant functions

LGTM

On Mon, Sep 11, 2023 at 5:20 PM Juzhe-Zhong <juzhe.zhong@rivai.ai> wrote:
>
> I just finished V2 version of LMUL cost model.
> Turns out we don't these redundant functions.
>
> Remove them.
>
> gcc/ChangeLog:
>
>         * config/riscv/riscv-protos.h (get_all_predecessors): Remove.
>         (get_all_successors): Ditto.
>         * config/riscv/riscv-v.cc (get_all_predecessors): Ditto.
>         (get_all_successors): Ditto.
>
> ---
>  gcc/config/riscv/riscv-protos.h |  2 --
>  gcc/config/riscv/riscv-v.cc     | 48 ---------------------------------
>  2 files changed, 50 deletions(-)
>
> diff --git a/gcc/config/riscv/riscv-protos.h b/gcc/config/riscv/riscv-protos.h
> index 46d77ef927c..e91a55ec057 100644
> --- a/gcc/config/riscv/riscv-protos.h
> +++ b/gcc/config/riscv/riscv-protos.h
> @@ -498,8 +498,6 @@ enum floating_point_rounding_mode get_frm_mode (rtx);
>  opt_machine_mode vectorize_related_mode (machine_mode, scalar_mode,
>                                          poly_uint64);
>  unsigned int autovectorize_vector_modes (vec<machine_mode> *, bool);
> -hash_set<basic_block> get_all_predecessors (basic_block);
> -hash_set<basic_block> get_all_successors (basic_block);
>  bool cmp_lmul_le_one (machine_mode);
>  bool cmp_lmul_gt_one (machine_mode);
>  }
> diff --git a/gcc/config/riscv/riscv-v.cc b/gcc/config/riscv/riscv-v.cc
> index 3cd1f61de0e..4d95bd773a2 100644
> --- a/gcc/config/riscv/riscv-v.cc
> +++ b/gcc/config/riscv/riscv-v.cc
> @@ -3388,54 +3388,6 @@ expand_fold_extract_last (rtx *ops)
>    emit_label (end_label);
>  }
>
> -hash_set<basic_block>
> -get_all_predecessors (basic_block bb)
> -{
> -  hash_set<basic_block> blocks;
> -  auto_vec<basic_block> work_list;
> -  hash_set<basic_block> visited_list;
> -  work_list.safe_push (bb);
> -
> -  while (!work_list.is_empty ())
> -    {
> -      basic_block new_bb = work_list.pop ();
> -      visited_list.add (new_bb);
> -      edge e;
> -      edge_iterator ei;
> -      FOR_EACH_EDGE (e, ei, new_bb->preds)
> -       {
> -         if (!visited_list.contains (e->src))
> -           work_list.safe_push (e->src);
> -         blocks.add (e->src);
> -       }
> -    }
> -  return blocks;
> -}
> -
> -hash_set<basic_block>
> -get_all_successors (basic_block bb)
> -{
> -  hash_set<basic_block> blocks;
> -  auto_vec<basic_block> work_list;
> -  hash_set<basic_block> visited_list;
> -  work_list.safe_push (bb);
> -
> -  while (!work_list.is_empty ())
> -    {
> -      basic_block new_bb = work_list.pop ();
> -      visited_list.add (new_bb);
> -      edge e;
> -      edge_iterator ei;
> -      FOR_EACH_EDGE (e, ei, new_bb->succs)
> -       {
> -         if (!visited_list.contains (e->dest))
> -           work_list.safe_push (e->dest);
> -         blocks.add (e->dest);
> -       }
> -    }
> -  return blocks;
> -}
> -
>  /* Return true if the LMUL of comparison less than or equal to one.  */
>  bool
>  cmp_lmul_le_one (machine_mode mode)
> --
> 2.36.3
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-09-11 10:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-11  9:19 [PATCH] RISC-V: Remove redundant functions Juzhe-Zhong
2023-09-11  9:25 ` Kito Cheng
2023-09-11 10:28   ` Li, Pan2

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