Pan Li 4e2a2d6ad2 RISC-V: Combine vec_duplicate + vwaddu.wv to vwaddu.wx on GR2VR cost
This patch would like to combine the vec_duplicate + vwaddu.wv to the
vwaddu.wx.  From example as below code.  The related pattern will depend
on the cost of vec_duplicate from GR2VR.  Then the late-combine will
take action if the cost of GR2VR is zero, and reject the combination
if the GR2VR cost is greater than zero.

Assume we have asm code like below, GR2VR cost is 0.

Before this patch:
  11       beq a3,zero,.L8
  12       vsetvli a5,zero,e32,m1,ta,ma
  13       vmv.v.x v2,a2
  ...
  16   .L3:
  17       vsetvli a5,a3,e32,m1,ta,ma
  ...
  22       vwaddu.wv v1,v2,v3
  ...
  25       bne a3,zero,.L3

After this patch:
  11       beq a3,zero,.L8
  ...
  14    .L3:
  15       vsetvli a5,a3,e32,m1,ta,ma
  ...
  20       vwaddu.wx v1,a2,v3
  ...
  23       bne a3,zero,.L3

Unfortunately, and similar as vwaddu.vv, only widening from uint32_t to
uint64_t has the necessary zero-extend during combine, we loss the extend
op after expand for any other types.

gcc/ChangeLog:

	* config/riscv/autovec-opt.md (*widen_waddu_wx_<mode>): Add new
	pattern to match vwaddu.wx.

Signed-off-by: Pan Li <pan2.li@intel.com>
2025-10-05 19:16:28 +08:00
2025-08-29 00:19:55 +00:00
2025-08-17 00:19:17 +00:00
2025-09-24 00:21:37 +00:00
2025-10-01 00:20:51 +00:00
2025-09-06 00:20:34 +00:00
2025-09-03 00:20:18 +00:00
2025-09-20 00:20:23 +00:00
2025-09-19 00:20:17 +00:00
2025-09-08 00:20:50 +00:00
2025-09-02 00:19:26 +00:00
2025-10-02 00:19:36 +00:00

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.
Description
No description provided
Readme 4.2 GiB
Languages
C++ 30.8%
C 30.2%
Ada 14.4%
D 6.1%
Go 5.7%
Other 12.3%