Ready for trunk (or gcc-17 since it's stage4 for gcc-16 now)?
------------------------------------------------------------------
From:钟居哲 <juzhe.zhong@rivai.ai>
Send Time:Thu, Jan 8, 2026, 10:51
To:Bohan Lei<garthlei@linux.alibaba.com>
CC:"gcc-patches"<gcc-patches@gcc.gnu.org>; "pan2.li"<pan2.li@intel.com>; Bohan Lei<garthlei@linux.alibaba.com>
Subject:Re: [PATCH] RISC-V: Remove redundant CALL_P check
LGTM
From: "Bohan Lei"<garthlei@linux.alibaba.com>
Date: Thu, Jan 8, 2026, 10:49
Subject: [PATCH] RISC-V: Remove redundant CALL_P check
To: <gcc-patches@gcc.gnu.org>
Cc: <juzhe.zhong@rivai.ai>, <pan2.li@intel.com>, "Bohan Lei"<garthlei@linux.alibaba.com>
Since we are using `reg_set_p` to check VXRM definition, the `CALL_P`
check has become redundant. VXRM is marked as call-used in riscv.h, and
`reg_set_p` in `vxrm_unknown_p` should always return true when a call is
encountered.
gcc/ChangeLog:
* config/riscv/riscv.cc (vxrm_unknown_p): Remove `CALL_P` check
static bool
vxrm_unknown_p (rtx_insn *insn)
{
- /* Return true if there is a definition of VXRM. */
+ /* Return true if VXRM is set or clobbered. */
if (reg_set_p (gen_rtx_REG (SImode, VXRM_REGNUM), insn))
return true;
- /* A CALL function may contain an instruction that modifies the VXRM,
- return true in this situation. */
- if (CALL_P (insn))
- return true;
-
/* Return true for all assembly since users may hardcode a assembly
like this: asm volatile ("csrwi vxrm, 0"). */
if (asm_insn_p (insn))