public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "juzhe.zhong@rivai.ai" <juzhe.zhong@rivai.ai>
To: "Robin Dapp" <rdapp.gcc@gmail.com>,
	 gcc-patches <gcc-patches@gcc.gnu.org>
Cc: "Robin Dapp" <rdapp.gcc@gmail.com>,
	 kito.cheng <kito.cheng@gmail.com>,
	 Kito.cheng <kito.cheng@sifive.com>,
	 jeffreyalaw <jeffreyalaw@gmail.com>
Subject: Re: Re: [PATCH] RISC-V: Fix vmerge optimization bug in vec_perm vectorization
Date: Fri, 15 Dec 2023 20:28:15 +0800	[thread overview]
Message-ID: <E2C102EB5A3B27E9+2023121520281500149272@rivai.ai> (raw)
In-Reply-To: <50e3e3d0-3af6-4e7b-a8cf-a16a7cbef077@gmail.com>

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

Do you mean like this ?

  /* We need to use precomputed mask for such situation and such mask
     can only be computed in compile-time known size modes.  */
  bool indices_fit_selector_p
    = maybe_ge (vec_len, 2 << GET_MODE_BITSIZE (GET_MODE_INNER (vmode)));
  if (GET_MODE_BITSIZE (GET_MODE_INNER (vmode)) == 8、
      && indices_fit_selector_p
      && !vec_len.is_constant ())
    return false;



juzhe.zhong@rivai.ai
 
From: Robin Dapp
Date: 2023-12-15 20:25
To: juzhe.zhong@rivai.ai; gcc-patches
CC: rdapp.gcc; kito.cheng; Kito.cheng; jeffreyalaw
Subject: Re: [PATCH] RISC-V: Fix vmerge optimization bug in vec_perm vectorization
On 12/15/23 13:16, juzhe.zhong@rivai.ai wrote:
> 
>>> bool indices_fit_selector = maybe_ge (vec_len, 2 << GET_MODE_BITSIZE (GET_MODE_INNER (vmode)));
> No, I think it will make us miss some optimization.
> 
> For example, for poly value [16,16]  maybe_ge ([16,16], 65536) which makes us missed merge optimization but
> we definitely can do merge optimization.
 
I didn't mean to skip the && !vec_len.is_constant (), that should
stay.  Just the first part of condition that can be re-used in the
if as well (inverted).
 
Regards
Robin
 

  reply	other threads:[~2023-12-15 12:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-15  2:57 Juzhe-Zhong
2023-12-15 11:14 ` Robin Dapp
2023-12-15 12:16   ` juzhe.zhong
2023-12-15 12:25     ` Robin Dapp
2023-12-15 12:28       ` juzhe.zhong [this message]
2023-12-15 12:32       ` juzhe.zhong
2023-12-15 12:44         ` Robin Dapp
2023-12-15 12:52           ` juzhe.zhong
2023-12-15 12:54             ` Robin Dapp

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