]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[PATCH] RISC-V: Remove redundant CALL_P check
authorBohan Lei <garthlei@linux.alibaba.com>
Thu, 23 Apr 2026 00:25:22 +0000 (18:25 -0600)
committerJeff Law <jeffrey.law@oss.qualcomm.com>
Thu, 23 Apr 2026 00:25:55 +0000 (18:25 -0600)
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

gcc/config/riscv/riscv.cc

index 8a39c791c26dde2f1a09e1b95925da8dd7cd2e6c..b9b31b6be2af48573d749720bd1b70c839338f11 100644 (file)
@@ -14026,15 +14026,10 @@ asm_insn_p (rtx_insn *insn)
 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))