]> git.ipfire.org Git - thirdparty/gcc.git/commit
AutoFDO: Implement streaming of file names from GCOV profile
authorDhruv Chawla <dhruvc@nvidia.com>
Thu, 16 Oct 2025 05:08:23 +0000 (22:08 -0700)
committerDhruv Chawla <dhruvc@nvidia.com>
Tue, 23 Dec 2025 05:22:45 +0000 (10:52 +0530)
commitbbac517a969ee7d22d418898dc4bece719165d35
treeb746011f701a38bacfb40cc4be81f32e10909713
parent3a27acf825700ac0c5b1e3c617980ccf602a35df
AutoFDO: Implement streaming of file names from GCOV profile

This patch requires the changes from https://github.com/google/autofdo/pull/244
to work correctly.

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* auto-profile.cc (AUTO_PROFILE_VERSION): Bump to 3.
(class function_instance_descriptor): New class.
(get_normalized_path): New function.
(string_table::~string_table): Update to free filenames.
(string_table::vector_): Rename to ...
(string_table::symbol_names_): ... this.
(string_table::map_): Rename to ...
(string_table::symbol_name_map_): ... this.
(string_table::filenames_): New member.
(string_table::filename_map_): Likewise.
(string_table::symbol_to_filename_map_): Likewise.
(string_table::get_index): Update to lookup symbol_name_map_.
(string_table::get_name): Rename to ...
(string_table::get_symbol_name): ... this.
(string_table::add_name): Rename to ...
(string_table::add_symbol_name): ... this.
(string_table::get_filename): New function.
(string_table::get_filename_by_symbol): Likewise.
(string_table::get_filename_index): Likewise.
(string_table::add_filename): Likewise.
(string_table::read): Read file names from the GCOV profile.
(function_instance::offline): Call
get_function_instance_by_descriptor.
(string_table::get_cgraph_node): Call get_symbol_name and
symbol_name.
(function_instance::get_function_instance_by_decl): Likewise.
(function_instance::get_cgraph_node): Likewise.
(function_instance::merge): Likewise.
(match_with_target): Likewise.
(function_instance::match): Likewise.
(function_instance::dump): Likewise.
(function_instance::dump_inline_stack): Likewise.
(function_instance::find_icall_target_map): Likewise.
(autofdo_source_profile::offline_unrealized_inlines): Likewise.
(autofdo_source_profile::offline_external_functions): Likewise.
(function_instance::read_function_instance): Likewise.
(afdo_indirect_call):
Also call find_function_instance, add_function_instance and
remove_function_instance.
(autofdo_source_profile::read): Likewise.
(autofdo_source_profile::get_function_instance_by_decl): Call
find_function_instance.
(autofdo_source_profile::get_function_instance_by_name_index):
Rename to ...
(autofdo_source_profile::get_function_instance_by_descriptor):
... this.
(autofdo_source_profile::find_iter_for_function_instance): New
function.
(autofdo_source_profile::find_function_instance): Likewise.
(autofdo_source_profile::add_function_instance): Likewise.
(autofdo_source_profile::remove_function_instance): Likewise.
gcc/auto-profile.cc