> This patch introduces a new heuristics for reordering functions, to be used > in the absense of profile information. This approach uses C++ template > instantiation types to group functions together. Entry functions are sorted > in the beginning, and callees are sorted as part of partition_callchain (). > > Bootstrapped and tested on aarch64-none-linux-gnu. > Ok for mainline? > > Thanks, > Prachi > > Signed-off-by: Prachi Godbole <[email protected]> > > config/ChangeLog: > > * bootstrap-lto-locality-cpp-template.mk: New file. > > gcc/ChangeLog: > > * flag-types.h (enum lto_locality_heuristics): New enum. > * ipa-locality-cloning.cc (struct templ_info): New struct. > (struct locality_info): Add templ_info field. > (templ_hash_map): New hash_map. > (callee_templ_cmp): Ditto. New function > (static_profile_templ_cmp): Ditto. > (sort_templ_hashes_cmp): Ditto. > (order_templ_hashes): Ditto. > (locality_dc_template_p): Ditto. > (populate_templ_info): Ditto. > (create_locality_info): Call populate_templ_info. > (partition_callchain): Call callee_templ_cmp. > (locality_determine_static_order): Populate and sort templ_hash_map. > (locality_partition_and_clone): Handle lto_locality_heuristics. > (lc_execute): Initialize templ_hash_map. > * params.opt: New param. >
> +/* Return true if template component is found in teh demangled function name > in a typo. Please extend the tolevel comment of ipa-locality-cloning with explanation of how the template heuristics is implemented. OK, Thanks! Honza
