]> git.ipfire.org Git - thirdparty/gcc.git/commit
RISC-V: Fix vsetvl merge rule.
authorRobin Dapp <rdapp@ventanamicro.com>
Mon, 14 Jul 2025 11:53:12 +0000 (13:53 +0200)
committerRobin Dapp <rdapp@ventanamicro.com>
Wed, 16 Jul 2025 07:30:06 +0000 (09:30 +0200)
commit9041f2bff8202d9b87d8c27f21e4ffa8d50b36a3
tree7ae4f33d11d84d6c424928603ce7f89eb01b6690
parent2ae2203da598b580c27d65722320f380e2af58a5
RISC-V: Fix vsetvl merge rule.

In PR120297 we fuse
  vsetvl e8,mf2,...
  vsetvl e64,m1,...
into
  vsetvl e64,m4,...

Individually, that's ok but we also change the new vsetvl's demand to
"SEW only" even though the first original one demanded SEW >= 8 and
ratio = 16.

As we forget the ratio after the merge we find that the vsetvl following
the merged one has ratio = 64 demand and we fuse into
  vsetvl e64,m1,..
which obviously doesn't have ratio = 16 any more.

Regtested on rv64gcv_zvl512b.

PR target/120297

gcc/ChangeLog:

* config/riscv/riscv-vsetvl.def: Do not forget ratio demand of
previous vsetvl.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/pr120297.c: New test.
gcc/config/riscv/riscv-vsetvl.def
gcc/testsuite/gcc.target/riscv/rvv/pr120297.c [new file with mode: 0644]