]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Adjust riscv_can_inline_p
authorKito Cheng <kito.cheng@sifive.com>
Wed, 7 May 2025 10:30:34 +0000 (18:30 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Tue, 13 May 2025 03:57:37 +0000 (11:57 +0800)
We don't hold any extenison flags in `target_flags`, so no need to
gather the extenison flags in `target_flags`.

gcc/ChangeLog:

* common/config/riscv/riscv-common.cc (riscv_can_inline_p): Drop
extension flags check from `target_flags`.
* config/riscv/riscv-subset.h (riscv_x_target_flags_isa_mask):
Remove.
* config/riscv/riscv.cc (riscv_x_target_flags_isa_mask): Remove.

gcc/common/config/riscv/riscv-common.cc
gcc/config/riscv/riscv-subset.h
gcc/config/riscv/riscv.cc

index d84aa9d78dd32002d0ae7a0684b5c09e0792cd6e..ff34a315caf67736b763e349bf3a031f484e2bc2 100644 (file)
@@ -2036,23 +2036,6 @@ riscv_ext_is_subset (struct cl_target_option *opts,
   return true;
 }
 
-/* Return the mask of ISA extension in x_target_flags of gcc_options.  */
-
-int
-riscv_x_target_flags_isa_mask (void)
-{
-  int mask = 0;
-  const riscv_ext_flag_table_t *arch_ext_flag_tab;
-  for (arch_ext_flag_tab = &riscv_ext_flag_table[0];
-       arch_ext_flag_tab->ext;
-       ++arch_ext_flag_tab)
-    {
-      if (arch_ext_flag_tab->var_ref == &gcc_options::x_target_flags)
-       mask |= arch_ext_flag_tab->mask;
-    }
-  return mask;
-}
-
 /* Get the minimal feature bits in Linux hwprobe of the given ISA string.
 
    Used for generating Function Multi-Versioning (FMV) dispatcher for RISC-V.
index 7b3fdaeb3e40d556f8cabbadcc0ddef60abc6f90..c5d9fab4de9f42af496db66fb84c9bab5d9dd2b4 100644 (file)
@@ -129,6 +129,5 @@ extern bool riscv_minimal_hwprobe_feature_bits (const char *,
                                                location_t);
 extern bool
 riscv_ext_is_subset (struct cl_target_option *, struct cl_target_option *);
-extern int riscv_x_target_flags_isa_mask (void);
 
 #endif /* ! GCC_RISCV_SUBSET_H */
index 8b77a3539bc5a8b3439157f9a6bfff952cbcb331..d28aee4b4398c889f88da0f78bef8a4d4f476102 100644 (file)
@@ -7918,11 +7918,9 @@ riscv_can_inline_p (tree caller, tree callee)
   struct cl_target_option *callee_opts = TREE_TARGET_OPTION (callee_tree);
   struct cl_target_option *caller_opts = TREE_TARGET_OPTION (caller_tree);
 
-  int isa_flag_mask = riscv_x_target_flags_isa_mask ();
-
-  /* Callee and caller should have the same target options except for ISA.  */
-  int callee_target_flags = callee_opts->x_target_flags & ~isa_flag_mask;
-  int caller_target_flags = caller_opts->x_target_flags & ~isa_flag_mask;
+  /* Callee and caller should have the same target options.  */
+  int callee_target_flags = callee_opts->x_target_flags;
+  int caller_target_flags = caller_opts->x_target_flags;
 
   if (callee_target_flags != caller_target_flags)
     return false;