diff --git a/0381-CFGO-Add-more-opts-to-cfgo.patch b/0381-CFGO-Add-more-opts-to-cfgo.patch new file mode 100644 index 0000000000000000000000000000000000000000..0cc42a04be0366f441ef3dc4af3187d9f6e1e493 --- /dev/null +++ b/0381-CFGO-Add-more-opts-to-cfgo.patch @@ -0,0 +1,59 @@ +From 4526a64df61d963700b3490cf62e9a05629600d1 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 + +--- + gcc/opts.cc | 34 ++++++++++++++++++++++++++++------ + 1 file changed, 28 insertions(+), 6 deletions(-) + +diff --git a/gcc/opts.cc b/gcc/opts.cc +index b69c43724..7628823bf 100644 +--- a/gcc/opts.cc ++++ b/gcc/opts.cc +@@ -2126,14 +2126,36 @@ 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_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_cmlt_arith, 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_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_auto, 128); ++ 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, 942166); + 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 658cc868f37ad93f1904d3e48184dea122deac8a..1273c361eb1981346ac2fa561b979fa89611bb70 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 85 +%global gcc_release 86 %global _unpackaged_files_terminate_build 0 %global _performance_build 1 @@ -490,6 +490,7 @@ Patch377: 0377-oeAware-Fix-.GCC4OE_oeAware-section-dup-in-namespace.patch 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-CFGO-Add-more-opts-to-cfgo.patch # Part 1001-1999 %ifarch sw_64 @@ -1656,6 +1657,7 @@ not stable, so plugins must be rebuilt any time GCC is updated. %patch -P378 -p1 %patch -P379 -p1 %patch -P380 -p1 +%patch -P381 -p1 %ifarch sw_64 %patch -P1001 -p1 @@ -4283,6 +4285,10 @@ end %doc rpm.doc/changelogs/libcc1/ChangeLog* %changelog +* Mon May 26 2025 liyancheng <412998149@qq.com> - 12.3.1-86 +- Type: Sync +- DESC: Sync patches from openeuler/gcc. + * Wed May 21 2025 huzife <634763349@qq.com> - 12.3.1-85 - Type: Bugfix - DESC: Fix tune params error in hip09 and hip11.