On 4/9/25 6:08 AM, Robin Dapp wrote:
Hi,

when lifting up a vsetvl into a block we currently don't consider the
block's transparency with respect to the vsetvl as in other parts of the
pass.  This patch does not perform the lift when transparency is not
guaranteed.

This condition is more restrictive than necessary as we can still
perform a vsetvl lift if the conflicting register is only every used
in vsetvls and no regular insns but given how late we are in the GCC 15
cycle it seems better to defer this.  Therefore
gcc.target/riscv/rvv/vsetvl/avl_single-68.c is XFAILed for now.

This issue was found in OpenCV where it manifests as a runtime error.
Zhijin Zeng debugged PR119547 and provided an initial patch.

V2 now uses the transparency property rather than the manual approach before, both because it is cleaner and also because it helps with the go ICE
in PR119533.

Regtested on rv64gcv_zvl512b.

Regards
Robin

Reported-By: 曾治金 <zhijin.z...@spacemit.com>

     PR target/119547

gcc/ChangeLog:

    * config/riscv/riscv-vsetvl.cc (pre_vsetvl::earliest_fuse_vsetvl_info):
     Do not perform lift if block is not transparent.

gcc/testsuite/ChangeLog:

     * gcc.target/riscv/rvv/vsetvl/avl_single-68.c: xfail.
     * g++.target/riscv/rvv/autovec/pr119547.C: New test.
     * g++.target/riscv/rvv/autovec/pr119547-2.C: New test.
     * gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-10.c: Adjust.
OK for the trunk.

jeff

Reply via email to