From fdd6313e041b8eb43a354d798d2451bf517b07a8 Mon Sep 17 00:00:00 2001 From: liyancheng <412998149@qq.com> Date: Wed, 28 May 2025 11:48:57 +0800 Subject: [PATCH] [Sync] Sync patches from openEuler/gcc Including: - 0381-CFGO-Add-more-opts-to-cfgo.patch --- 0382-CFGO-Add-more-opts-to-cfgo.patch | 62 +++++++++++++++++++++++++++ gcc.spec | 8 +++- 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 0382-CFGO-Add-more-opts-to-cfgo.patch diff --git a/0382-CFGO-Add-more-opts-to-cfgo.patch b/0382-CFGO-Add-more-opts-to-cfgo.patch new file mode 100644 index 0000000..b94cc1c --- /dev/null +++ b/0382-CFGO-Add-more-opts-to-cfgo.patch @@ -0,0 +1,62 @@ +From 9f8d7de855feb149e2ea58b72167b22908afacdc Mon Sep 17 00:00:00 2001 +From: liyancheng <412998149@qq.com> +Date: Thu, 22 May 2025 11:15:39 +0800 +Subject: [PATCH] [CFGO] Add more opts to cfgo + +Add more opts for better performance +--- + gcc/opts.cc | 36 ++++++++++++++++++++++++++++++------ + 1 file changed, 30 insertions(+), 6 deletions(-) + +diff --git a/gcc/opts.cc b/gcc/opts.cc +index b69c43724..82efdc802 100644 +--- a/gcc/opts.cc ++++ b/gcc/opts.cc +@@ -2126,14 +2126,38 @@ enable_cfgo_optimizations (struct gcc_options *opts, + SET_OPTION_IF_UNSET (opts, opts_set, flag_selective_scheduling, value); + SET_OPTION_IF_UNSET (opts, opts_set, flag_rename_registers, value); + SET_OPTION_IF_UNSET (opts, opts_set, flag_profile_partial_training, value); ++ SET_OPTION_IF_UNSET (opts, opts_set, flag_ipa_alignment_propagation, value); ++ SET_OPTION_IF_UNSET (opts, opts_set, flag_ipa_localize_array, value); ++ SET_OPTION_IF_UNSET (opts, opts_set, flag_ipa_array_dse, value); ++ SET_OPTION_IF_UNSET (opts, opts_set, flag_gnu89_inline, value); ++ SET_OPTION_IF_UNSET (opts, opts_set, flag_convert_minmax, value); ++ SET_OPTION_IF_UNSET (opts, opts_set, flag_tree_slp_transpose_vectorize, ++ value); ++ SET_OPTION_IF_UNSET (opts, opts_set, flag_ipa_prefetch, value); ++ SET_OPTION_IF_UNSET (opts, opts_set, flag_ipa_ic, value); ++ ++ SET_OPTION_IF_UNSET (opts, opts_set, flag_find_with_sve, value); ++ SET_OPTION_IF_UNSET (opts, opts_set, flag_finite_loops, value); ++ SET_OPTION_IF_UNSET (opts, opts_set, flag_omit_frame_pointer, value); ++ SET_OPTION_IF_UNSET (opts, opts_set, flag_sized_deallocation, 0); ++ ++ SET_OPTION_IF_UNSET (opts, opts_set, flag_loop_elim, value); ++ SET_OPTION_IF_UNSET (opts, opts_set, flag_if_conversion_gimple, value); + +- SET_OPTION_IF_UNSET (opts, opts_set, param_max_inline_insns_auto, 185); +- SET_OPTION_IF_UNSET (opts, opts_set, param_inline_unit_growth, 66); ++ SET_OPTION_IF_UNSET (opts, opts_set, param_max_inline_insns_auto, 331); ++ SET_OPTION_IF_UNSET (opts, opts_set, param_inline_unit_growth, 60); + SET_OPTION_IF_UNSET (opts, opts_set, param_max_inline_recursive_depth_auto, +- 31); +- SET_OPTION_IF_UNSET (opts, opts_set, param_large_function_insns, 7286); +- SET_OPTION_IF_UNSET (opts, opts_set, param_large_function_growth, 89); +- SET_OPTION_IF_UNSET (opts, opts_set, param_large_unit_insns, 11783); ++ 7); ++ SET_OPTION_IF_UNSET (opts, opts_set, param_max_inline_insns_recursive, 3227); ++ SET_OPTION_IF_UNSET (opts, opts_set, param_max_inline_insns_recursive_auto, ++ 2571); ++ SET_OPTION_IF_UNSET (opts, opts_set, param_early_inlining_insns, 256); ++ SET_OPTION_IF_UNSET (opts, opts_set, param_early_inliner_max_iterations, 1); ++ SET_OPTION_IF_UNSET (opts, opts_set, param_max_inline_insns_single, 2742); ++ ++ SET_OPTION_IF_UNSET (opts, opts_set, param_large_function_insns, 9055); ++ SET_OPTION_IF_UNSET (opts, opts_set, param_large_function_growth, 701); ++ SET_OPTION_IF_UNSET (opts, opts_set, param_large_unit_insns, 94216); + SET_OPTION_IF_UNSET (opts, opts_set, param_ipa_cp_eval_threshold, 864); + SET_OPTION_IF_UNSET (opts, opts_set, param_ipa_cp_loop_hint_bonus, 440); + SET_OPTION_IF_UNSET (opts, opts_set, param_ipa_cp_max_recursive_depth, 29); +-- +2.34.1 + diff --git a/gcc.spec b/gcc.spec index 80857d5..ca4a3b2 100644 --- a/gcc.spec +++ b/gcc.spec @@ -2,7 +2,7 @@ %global gcc_major 12 # Note, gcc_release must be integer, if you want to add suffixes to # %%{release}, append them after %%{gcc_release} on Release: line. -%global gcc_release 86 +%global gcc_release 87 %global _unpackaged_files_terminate_build 0 %global _performance_build 1 @@ -491,6 +491,7 @@ Patch378: 0378-Add-alignment-propagation-localize-array-array-dse.patch Patch379: 0379-SVE-Add-container-restriction-for-std-find-with-sve.patch Patch380: 0380-Fix-tune-params-error-in-hip09-and-hip11.patch Patch381: 0381-dfc-Fix-error-in-function-wholeaccess.patch +Patch382: 0382-CFGO-Add-more-opts-to-cfgo.patch # Part 1001-1999 %ifarch sw_64 @@ -1658,6 +1659,7 @@ not stable, so plugins must be rebuilt any time GCC is updated. %patch -P379 -p1 %patch -P380 -p1 %patch -P381 -p1 +%patch -P382 -p1 %ifarch sw_64 %patch -P1001 -p1 @@ -4285,6 +4287,10 @@ end %doc rpm.doc/changelogs/libcc1/ChangeLog* %changelog +* Wed May 28 2025 liyancheng <412998149@qq.com> - 12.3.1-87 +- Type: Sync +- DESC: Sync patches from openeuler/gcc. + * Tue May 27 2025 huzife <634763349@qq.com> - 12.3.1-86 - Type: Sync - DESC: Sync patches from openeuler/gcc. -- Gitee