public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: 钟居哲 <juzhe.zhong@rivai.ai>
To: "Jeff Law" <jeffreyalaw@gmail.com>,
	 gcc-patches <gcc-patches@gcc.gnu.org>
Cc: kito.cheng <kito.cheng@gmail.com>,  palmer <palmer@dabbelt.com>
Subject: Re: Re: [PATCH] RISC-V: Add attributes for VSETVL PASS
Date: Tue, 29 Nov 2022 06:52:17 +0800	[thread overview]
Message-ID: <7BF53C765A4D8817+202211290652169080217@rivai.ai> (raw)
In-Reply-To: <ed0bd050-73b4-b31a-434f-c9e5a04e2e66@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2836 bytes --]

>> I'm tempted to push this into the next stage1 given its arrival after
>> stage1 close, but if the wider RISC-V maintainers want to see it move
>> forward, I don't object strongly.

Ok, let's save these patches and merge them when GCC14 stage1 is open.
Would you mind telling me when will stage 1 be open?

>> I'm curious about the model you're using.  Is it going to be something
>> similar to mode switching?  That's the first mental model that comes to
>> mind.  Essentially we determine the VL needed for every chunk of code,
>> then we do an LCM like algorithm to find the optimal placement points
>> for VL sets to minimize the number of VL sets across all the paths
>> through the CFG.  Never in a million years would I have expected we'd be
>> considering reusing that code.

Yes, I implemented VSETVL PASS with LCM algorithm and RTL_SSA framework.
Actually, me && kito have spent a month on VSETVL PASS and we have 
made a progress. We have tested it with a lot of testcases, turns out our implementation
of VSETVL PASS in GCC has much better codegen than the VSETVL implemented
in LLVM side in many different situations because of LCM. I am working on cleaning up the codes
and hopefully you will see it soon in the next patch.

Thanks



juzhe.zhong@rivai.ai
 
From: Jeff Law
Date: 2022-11-29 00:44
To: juzhe.zhong; gcc-patches
CC: kito.cheng; palmer
Subject: Re: [PATCH] RISC-V: Add attributes for VSETVL PASS
 
On 11/28/22 07:14, juzhe.zhong@rivai.ai wrote:
> From: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
>
> gcc/ChangeLog:
>
>          * config/riscv/riscv-protos.h (enum vlmul_type): New enum.
>          (get_vlmul): New function.
>          (get_ratio): Ditto.
>          * config/riscv/riscv-v.cc (struct mode_vtype_group): New struct.
>          (ENTRY): Adapt for attributes.
>          (enum vlmul_type): New enum.
>          (get_vlmul): New function.
>          (get_ratio): New function.
>          * config/riscv/riscv-vector-switch.def (ENTRY): Adapt for attributes.
>          * config/riscv/riscv.cc (ENTRY): Ditto.
>          * config/riscv/vector.md (false,true): Add attributes.
 
I'm tempted to push this into the next stage1 given its arrival after 
stage1 close, but if the wider RISC-V maintainers want to see it move 
forward, I don't object strongly.
 
 
I'm curious about the model you're using.  Is it going to be something 
similar to mode switching?  That's the first mental model that comes to 
mind.  Essentially we determine the VL needed for every chunk of code, 
then we do an LCM like algorithm to find the optimal placement points 
for VL sets to minimize the number of VL sets across all the paths 
through the CFG.  Never in a million years would I have expected we'd be 
considering reusing that code.
 
 
Jeff
 
 
 

  parent reply	other threads:[~2022-11-28 22:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-28 14:14 juzhe.zhong
2022-11-28 16:44 ` Jeff Law
2022-11-28 18:02   ` Palmer Dabbelt
2022-11-28 23:10     ` 钟居哲
2022-11-28 23:14       ` Palmer Dabbelt
2022-11-28 22:52   ` 钟居哲 [this message]
2022-11-28 23:54     ` Jeff Law
2022-11-29  1:38       ` Kito Cheng
2022-11-29  1:46         ` juzhe.zhong
2022-11-29  2:56           ` Palmer Dabbelt
2022-11-29  3:07             ` juzhe.zhong
2022-11-29  3:11               ` Palmer Dabbelt
2022-11-29  4:49             ` Jeff Law
2022-11-29  5:21               ` Palmer Dabbelt
2022-11-29  8:54                 ` Kito Cheng
2022-12-01 16:05                   ` Kito Cheng

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=7BF53C765A4D8817+202211290652169080217@rivai.ai \
    --to=juzhe.zhong@rivai.ai \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    --cc=kito.cheng@gmail.com \
    --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).