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.
        (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.

Attachment: 0003-PATCH-3-3-ipa-reorder-for-locality-Introduce-C-templ.patch
Description: Binary data

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to