[Bugfix]: Use AI ability to guide optimization and set default value when tune_native is NULL.

This commit is contained in:
zhenyu--zhao_admin 2024-12-04 15:01:47 +08:00
parent 98b0c11037
commit b57472a4a1
3 changed files with 780 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,27 @@
From bc468838ffa1991e50cb4b82b45154d44302417b Mon Sep 17 00:00:00 2001
From: zhenyu--zhao_admin <zhaozhenyu17@huawei.com>
Date: Tue, 3 Dec 2024 22:39:36 +0800
Subject: [PATCH 5/5] Bugfix: set default value when tune_native is NULL.
---
gcc/gcc.cc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 0032735db..90f6dfe85 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -5800,6 +5800,10 @@ do_self_spec (const char *spec)
do_spec_1 (" ", 0, NULL);
const char* tune_native = eval_spec_function ("local_cpu_detect", "cpu", "");
+ if (tune_native == NULL)
+ {
+ tune_native = "native";
+ }
setenv ("GCC_AI4C_TUNE_INFO", tune_native, 1);
/* Mark %<S switches processed by do_self_spec to be ignored permanently.
--
2.33.0

View File

@ -2,7 +2,7 @@
%global gcc_major 12 %global gcc_major 12
# Note, gcc_release must be integer, if you want to add suffixes to # Note, gcc_release must be integer, if you want to add suffixes to
# %%{release}, append them after %%{gcc_release} on Release: line. # %%{release}, append them after %%{gcc_release} on Release: line.
%global gcc_release 52 %global gcc_release 53
%global _unpackaged_files_terminate_build 0 %global _unpackaged_files_terminate_build 0
%global _performance_build 1 %global _performance_build 1
@ -421,6 +421,8 @@ Patch312: 0312-Add-late-slp-vectorization-pass-with-additional-chec.patch
Patch313: 0313-Add-tracer-transformation-for-static-probabilities.patch Patch313: 0313-Add-tracer-transformation-for-static-probabilities.patch
Patch314: 0314-bugfix-Modify-the-hip09-tune-flags.patch Patch314: 0314-bugfix-Modify-the-hip09-tune-flags.patch
Patch315: 0315-Bugfix-Add-no-var-recored-check-for-ssa_name-in-stru.patch Patch315: 0315-Bugfix-Add-no-var-recored-check-for-ssa_name-in-stru.patch
Patch316: 0316-Use-ai-ability-to-guide-optimization.patch
Patch317: 0317-Bugfix-set-default-value-when-tune_native-is-NULL.patch
# Part 1001-1999 # Part 1001-1999
%ifarch sw_64 %ifarch sw_64
@ -1522,6 +1524,8 @@ not stable, so plugins must be rebuilt any time GCC is updated.
%patch -P313 -p1 %patch -P313 -p1
%patch -P314 -p1 %patch -P314 -p1
%patch -P315 -p1 %patch -P315 -p1
%patch -P316 -p1
%patch -p317 -p1
%ifarch sw_64 %ifarch sw_64
%patch -P1001 -p1 %patch -P1001 -p1
@ -3147,6 +3151,7 @@ end
%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/lto-wrapper %{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/lto-wrapper
%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/liblto_plugin.so* %{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/liblto_plugin.so*
%{_libdir}/bfd-plugins/liblto_plugin.so %{_libdir}/bfd-plugins/liblto_plugin.so
%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/onnx.fdata
%ifarch aarch64 %ifarch aarch64
%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/libbolt_plugin.so* %{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/libbolt_plugin.so*
%endif %endif
@ -4143,6 +4148,12 @@ end
%doc rpm.doc/changelogs/libcc1/ChangeLog* %doc rpm.doc/changelogs/libcc1/ChangeLog*
%changelog %changelog
* Wed Dec 04 2024 Zhenyu Zhao <zhaozhenyu17@huawei.com> - 12.3.1-53
- Type:Sync
- ID:NA
- SUG:NA
- DESC:Sync patches from openeuler/gcc.
* Wed Dec 04 2024 Zhenyu Zhao <zhaozhenyu17@huawei.com> - 12.3.1-52 * Wed Dec 04 2024 Zhenyu Zhao <zhaozhenyu17@huawei.com> - 12.3.1-52
- Type:Sync - Type:Sync
- ID:NA - ID:NA