public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-5411] RISC-V: Avoid redundant flow in forward fusion
@ 2023-01-26 19:12 Kito Cheng
  0 siblings, 0 replies; only message in thread
From: Kito Cheng @ 2023-01-26 19:12 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:00fb7698f0b3ae14d6d472db0f8b64744c84678b

commit r13-5411-g00fb7698f0b3ae14d6d472db0f8b64744c84678b
Author: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
Date:   Tue Jan 10 06:40:07 2023 +0800

    RISC-V: Avoid redundant flow in forward fusion
    
    gcc/ChangeLog:
    
            * config/riscv/riscv-vsetvl.cc (pass_vsetvl::forward_demand_fusion):
            Add pre-check for redundant flow.

Diff:
---
 gcc/config/riscv/riscv-vsetvl.cc | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc
index f67459ca8ca..9140b1832bf 100644
--- a/gcc/config/riscv/riscv-vsetvl.cc
+++ b/gcc/config/riscv/riscv-vsetvl.cc
@@ -2141,6 +2141,9 @@ pass_vsetvl::forward_demand_fusion (void)
       if (!prop.valid_or_dirty_p ())
 	continue;
 
+      if (cfg_bb == ENTRY_BLOCK_PTR_FOR_FN (cfun))
+	continue;
+
       edge e;
       edge_iterator ei;
       /* Forward propagate to each successor.  */
@@ -2154,6 +2157,11 @@ pass_vsetvl::forward_demand_fusion (void)
 	  /* It's quite obvious, we don't need to propagate itself.  */
 	  if (e->dest->index == cfg_bb->index)
 	    continue;
+	  /* We don't propagate through critical edges.  */
+	  if (e->flags & EDGE_COMPLEX)
+	    continue;
+	  if (e->dest->index == EXIT_BLOCK_PTR_FOR_FN (cfun)->index)
+	    continue;
 
 	  /* If there is nothing to propagate, just skip it.  */
 	  if (!local_dem.valid_or_dirty_p ())

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

only message in thread, other threads:[~2023-01-26 19:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-26 19:12 [gcc r13-5411] RISC-V: Avoid redundant flow in forward fusion Kito Cheng

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