diff options
author | Kito Cheng <kito.cheng@sifive.com> | 2025-05-07 18:30:34 +0800 |
---|---|---|
committer | Kito Cheng <kito.cheng@sifive.com> | 2025-05-13 11:57:37 +0800 |
commit | 590701c97748cd7f99f15fbd0d75076dd75bea3d (patch) | |
tree | 01a07962e5c56255c8080f4026cd74c629adeba9 /gcc | |
parent | 124cbbbed5b8f7454f93f9a87e57fd4f3f2f78d2 (diff) | |
download | gcc-590701c97748cd7f99f15fbd0d75076dd75bea3d.zip gcc-590701c97748cd7f99f15fbd0d75076dd75bea3d.tar.gz gcc-590701c97748cd7f99f15fbd0d75076dd75bea3d.tar.bz2 |
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/common/config/riscv/riscv-common.cc | 17 | ||||
-rw-r--r-- | gcc/config/riscv/riscv-subset.h | 1 | ||||
-rw-r--r-- | 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 d84aa9d..ff34a31 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 7b3fdae..c5d9fab 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 8b77a35..d28aee4 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -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; |