public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <richard.sandiford@arm.com>
To: Jeff Law via Gcc-patches <gcc-patches@gcc.gnu.org>
Cc: juzhe.zhong@rivai.ai,  Jeff Law <jeffreyalaw@gmail.com>,
	 kito.cheng@gmail.com,  kito.cheng@sifive.com,
	 palmer@dabbelt.com,  palmer@rivosinc.com,  rdapp.gcc@gmail.com,
	 pan2.li@intel.com
Subject: Re: [PATCH V2] RISC-V: Rework Phase 5 && Phase 6 of VSETVL PASS
Date: Mon, 12 Jun 2023 20:02:02 +0100	[thread overview]
Message-ID: <mpt5y7sjyhh.fsf@arm.com> (raw)
In-Reply-To: <e258c6c9-578b-6601-40e7-158384ccc432@gmail.com> (Jeff Law via Gcc-patches's message of "Fri, 9 Jun 2023 08:33:30 -0600")

Jeff Law via Gcc-patches <gcc-patches@gcc.gnu.org> writes:
> On 6/9/23 04:41, juzhe.zhong@rivai.ai wrote:
>> @@ -4342,135 +4510,81 @@ pass_vsetvl::cleanup_insns (void) const
>>       }
>>   }
>>   
>> +/* Return true if the SET result is not used by any instructions.  */
>> +static bool
>> +has_no_uses (basic_block cfg_bb, rtx_insn *rinsn, int regno)
>> +{
>> +  /* Handle the following case that can not be detected in RTL_SSA.  */
>> +  /* E.g.
>> +	  li a5, 100
>> +	  vsetvli a6, a5...
>> +	  ...
>> +	  vadd (use a6)
>> +
>> +	The use of "a6" is removed from "vadd" but the information is
>> +	not updated in RTL_SSA framework. We don't want to re-new
>> +	a new RTL_SSA which is expensive, instead, we use data-flow
>> +	analysis to check whether "a6" has no uses.  */
> I'm a bit surprised there wasn't a reasonable way to update the RTL SSA 
> framework for this case.  If we were to remove the entire vadd, then we 
> would have to update the uses of a6.  If we have that capability, then I 
> would expect we could refactor the updating code so that we had an API 
> to remove an operand from an instruction.
>
> In fact, if we have a constant propagator in the RTL SSA framework, 
> wouldn't it have to have this capability?

RTL-SSA isn't supposed to be feature-complete in its current state.
So yeah, if something is missing, it's better to add it to RTL-SSA
rather than work around it in consumers.

(Responding without fully understanding the context though, sorry.)

Thanks,
Richard

  parent reply	other threads:[~2023-06-12 19:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-09 10:41 juzhe.zhong
2023-06-09 10:45 ` Kito Cheng
2023-06-09 10:49   ` juzhe.zhong
2023-06-09 14:33 ` Jeff Law
2023-06-09 14:46   ` 钟居哲
2023-06-09 14:58   ` 钟居哲
2023-06-09 15:09     ` Jeff Law
2023-06-09 22:52       ` 钟居哲
2023-06-12 19:02   ` Richard Sandiford [this message]
2023-06-16 10:55 ` Andreas Schwab
2023-06-16 11:39   ` Li, Pan2

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=mpt5y7sjyhh.fsf@arm.com \
    --to=richard.sandiford@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    --cc=juzhe.zhong@rivai.ai \
    --cc=kito.cheng@gmail.com \
    --cc=kito.cheng@sifive.com \
    --cc=palmer@dabbelt.com \
    --cc=palmer@rivosinc.com \
    --cc=pan2.li@intel.com \
    --cc=rdapp.gcc@gmail.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).