public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Robin Dapp <rdapp.gcc@gmail.com>
To: Juzhe-Zhong <juzhe.zhong@rivai.ai>, gcc-patches@gcc.gnu.org
Cc: rdapp.gcc@gmail.com, kito.cheng@gmail.com, kito.cheng@sifive.com,
	jeffreyalaw@gmail.com
Subject: Re: [PATCH V2] RISC-V: Enable basic VLS auto-vectorization
Date: Mon, 31 Jul 2023 08:41:37 +0200	[thread overview]
Message-ID: <fa38cfb8-8e5b-a299-3556-84cdce7dde46@gmail.com> (raw)
In-Reply-To: <20230731021357.3815294-1-juzhe.zhong@rivai.ai>

> +;; -----------------------------------------------------------------
> +;; ---- Duplicate Operations
> +;; -----------------------------------------------------------------
> +
> +(define_insn_and_split "@vec_duplicate<mode>"
> +  [(set (match_operand:VLS 0 "register_operand")
> +        (vec_duplicate:VLS
> +          (match_operand:<VEL> 1 "reg_or_int_operand")))]
> +  "TARGET_VECTOR && can_create_pseudo_p ()"
> +  "#"
> +  "&& 1"
> +  [(const_int 0)]
> +  {
> +    riscv_vector::emit_vlmax_insn (code_for_pred_broadcast (<MODE>mode),
> +                                   riscv_vector::RVV_UNOP, operands);
> +    DONE;
> +  }
> +)

Ah, nice.  The same thing helps for vv -> vx (for non-VLS modes) because we
can keep the non-expanded version around longer which allows more fwprop
opportunities.

> +      /* Enable VECT_COMPARE_COSTS between VLA modes VLS modes for scalable
> +	 auto-vectorization.  */
> +      flag |= VECT_COMPARE_COSTS;

I think it's good to activate this here for now.  After a while when
costing is reliable we probably want to have it unconditionally even
for pure scalable/fixed-vlmax.

Regards
 Robin


      parent reply	other threads:[~2023-07-31  6:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-31  2:13 Juzhe-Zhong
2023-07-31  2:42 ` Kito Cheng
2023-07-31  2:49   ` Li, Pan2
2023-07-31  6:41 ` Robin Dapp [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=fa38cfb8-8e5b-a299-3556-84cdce7dde46@gmail.com \
    --to=rdapp.gcc@gmail.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 \
    /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).