From: Kito Cheng <kito.cheng@gmail.com>
To: juzhe.zhong@rivai.ai
Cc: gcc-patches@gcc.gnu.org, palmer@dabbelt.com
Subject: Re: [PATCH] RISC-V: Avoid redundant flow in forward fusion
Date: Fri, 27 Jan 2023 03:14:21 +0800 [thread overview]
Message-ID: <CA+yXCZCZkxcV=MAeDe1KVv94=Dpy93Zjfg-b=6vM3okmpeQ+8A@mail.gmail.com> (raw)
In-Reply-To: <20230109224007.146325-1-juzhe.zhong@rivai.ai>
[-- Attachment #1: Type: text/plain, Size: 1438 bytes --]
committed, thanks.
On Tue, Jan 10, 2023 at 6:40 AM <juzhe.zhong@rivai.ai> wrote:
> From: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
>
> gcc/ChangeLog:
>
> * config/riscv/riscv-vsetvl.cc
> (pass_vsetvl::forward_demand_fusion): Add pre-check for redundant flow.
>
> ---
> 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 7800c2ee509..18c6f437db6 100644
> --- a/gcc/config/riscv/riscv-vsetvl.cc
> +++ b/gcc/config/riscv/riscv-vsetvl.cc
> @@ -2140,6 +2140,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. */
> @@ -2153,6 +2156,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 ())
> --
> 2.36.1
>
>
prev parent reply other threads:[~2023-01-26 19:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-09 22:40 juzhe.zhong
2023-01-26 19:14 ` Kito Cheng [this message]
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='CA+yXCZCZkxcV=MAeDe1KVv94=Dpy93Zjfg-b=6vM3okmpeQ+8A@mail.gmail.com' \
--to=kito.cheng@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=juzhe.zhong@rivai.ai \
--cc=palmer@dabbelt.com \
/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).