Skip to content

Commit 45032f1

Browse files
garthleiJeff Law
authored andcommitted
[PATCH] RISC-V: Remove redundant CALL_P check
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
1 parent c7afa79 commit 45032f1

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

gcc/config/riscv/riscv.cc

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14026,15 +14026,10 @@ asm_insn_p (rtx_insn *insn)
1402614026
static bool
1402714027
vxrm_unknown_p (rtx_insn *insn)
1402814028
{
14029-
/* Return true if there is a definition of VXRM. */
14029+
/* Return true if VXRM is set or clobbered. */
1403014030
if (reg_set_p (gen_rtx_REG (SImode, VXRM_REGNUM), insn))
1403114031
return true;
1403214032

14033-
/* A CALL function may contain an instruction that modifies the VXRM,
14034-
return true in this situation. */
14035-
if (CALL_P (insn))
14036-
return true;
14037-
1403814033
/* Return true for all assembly since users may hardcode a assembly
1403914034
like this: asm volatile ("csrwi vxrm, 0"). */
1404014035
if (asm_insn_p (insn))

0 commit comments

Comments
 (0)