[gcc(refs/vendors/riscv/heads/gcc-15-with-riscv-opts)] RISC-V: Adjust riscv_can_inline_p
Jeff Law
law@gcc.gnu.org
Sat Sep 13 16:04:49 GMT 2025
https://gcc.gnu.org/g:007dc7442d40a13f910fdc4bcb0ce31773525318
commit 007dc7442d40a13f910fdc4bcb0ce31773525318
Author: Kito Cheng <kito.cheng@sifive.com>
Date: Wed May 7 18:30:34 2025 +0800
RISC-V: Adjust riscv_can_inline_p
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.
(cherry picked from commit 590701c97748cd7f99f15fbd0d75076dd75bea3d)
Diff:
---
gcc/common/config/riscv/riscv-common.cc | 17 -----------------
gcc/config/riscv/riscv-subset.h | 1 -
gcc/config/riscv/riscv.cc | 8 +++-----
3 files changed, 3 insertions(+), 23 deletions(-)
diff --git a/gcc/common/config/riscv/riscv-common.cc b/gcc/common/config/riscv/riscv-common.cc
index d84aa9d78dd3..ff34a315caf6 100644
--- a/gcc/common/config/riscv/riscv-common.cc
+++ b/gcc/common/config/riscv/riscv-common.cc
@@ -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.
diff --git a/gcc/config/riscv/riscv-subset.h b/gcc/config/riscv/riscv-subset.h
index 7b3fdaeb3e40..c5d9fab4de9f 100644
--- a/gcc/config/riscv/riscv-subset.h
+++ b/gcc/config/riscv/riscv-subset.h
@@ -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 */
diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index 5472b683f323..55c0d053e75f 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -7919,11 +7919,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;
More information about the Gcc-cvs
mailing list