https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127086
--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jeff Law <[email protected]>: https://gcc.gnu.org/g:78d2ef518863a02e9a0d0edcef6e6ecf58b06f85 commit r17-6504-g78d2ef518863a02e9a0d0edcef6e6ecf58b06f85 Author: Bohan Lei <[email protected]> Date: Fri Nov 20 15:49:03 2026 -0700 [PATCH v2] RISC-V: Hoist VXRM assignments despite calls We found in x264, after the LTO patches, some pixel_avg related functions get inlined into their callers and VXRM can no longer be hoisted to the function epilogue. This patch relaxes the hoist condition so that it can hoist VXRM writes even if the function has calls. We can ignore the function calls in singleton_vxrm_need, because even if we insert a redundant VXRM assignment at the start, later DCE can remove that. There should be no correctness issue either as the regular LCM algorithm always works. This version was suggested by Jeff. The test expectations were written by LLM. Regtested on rv64gcv and rv32gcv. Assisted-by: Codex PR target/127086 gcc/ChangeLog: * config/riscv/riscv.cc (singleton_vxrm_need): Allow calls to be ignored. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/pr127086.c: New test.
