Projects
openEuler:24.03:SP1:Everything
gcc
_service:tar_scm:0096-Bugfix-Autofdo-use-PMU-sa...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:0096-Bugfix-Autofdo-use-PMU-sampling-set-num-eauals-den.patch of Package gcc
From 06e86b362f74ba0706fb5d8377f78d24b658c300 Mon Sep 17 00:00:00 2001 From: zhenyu--zhao_admin <zhaozhenyu17@huawei.com> Date: Sat, 18 May 2024 12:22:23 +0800 Subject: [PATCH] [Bugfix] Autofdo use PMU sampling set num eauals den --- gcc/final.cc | 2 +- gcc/tree-cfg.cc | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/final.cc b/gcc/final.cc index f66c9d155..e4bfceabc 100644 --- a/gcc/final.cc +++ b/gcc/final.cc @@ -4604,7 +4604,7 @@ dump_profile_to_elf_sections () /* Return if no feedback data. */ if (!flag_profile_use && !flag_auto_profile) { - error ("-fauto-bolt should use with -profile-use or -fauto-profile"); + error ("-fauto-bolt should use with -fprofile-use or -fauto-profile"); return; } diff --git a/gcc/tree-cfg.cc b/gcc/tree-cfg.cc index 05fc45147..48b52f785 100644 --- a/gcc/tree-cfg.cc +++ b/gcc/tree-cfg.cc @@ -9741,6 +9741,14 @@ execute_fixup_cfg (void) /* Same scaling is also done by ipa_merge_profiles. */ profile_count num = node->count; profile_count den = ENTRY_BLOCK_PTR_FOR_FN (cfun)->count; + /* When autofdo uses PMU as the sampling unit, the number of + node can not be obtained directly, sometimes it will be zero, + but the execution number for function should at least be 1. We + set num be den here to make sure the num will not decrease. */ + if (num == profile_count::zero ().afdo () && den.quality () == profile_quality::AFDO) + { + num = den; + } bool scale = num.initialized_p () && !(num == den); auto_bitmap dce_ssa_names; -- 2.33.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2