]> git.ipfire.org Git - thirdparty/gcc.git/commit
lto: Remap node order for stability.
authorMichal Jires <mjires@suse.cz>
Thu, 24 Oct 2024 01:02:55 +0000 (03:02 +0200)
committerMichal Jires <mjires@suse.cz>
Wed, 18 Dec 2024 17:19:18 +0000 (18:19 +0100)
commitb47e7eabff260a69b0cf596ca807ebbe6d93a2c2
tree5232cee1cada6b601241686abd8970737a6c35b4
parent0895aef01c64c317b489811dbe4ac55f9c13aab3
lto: Remap node order for stability.

This patch adds remapping of node order for each lto partition.
Resulting order conserves relative order inside partition, but
is independent of outside symbols. So if lto partition contains
identical set of symbols, their remapped order will be stable
between compilations.

This stability is needed for Incremental LTO.

gcc/ChangeLog:

* ipa-devirt.cc (ipa_odr_summary_write):
Add unused argument.
* ipa-fnsummary.cc (ipa_fn_summary_write): Likewise.
* ipa-icf.cc (sem_item_optimizer::write_summary): Likewise.
* ipa-modref.cc (modref_write): Likewise.
* ipa-prop.cc (ipa_prop_write_jump_functions): Likewise.
(ipcp_write_transformation_summaries): Likewise.
* ipa-sra.cc (ipa_sra_write_summary): Likewise.
* lto-cgraph.cc (lto_symtab_encoder_delete): Delete remap.
(lto_output_node): Remap order.
(lto_output_varpool_node): Likewise.
(output_cgraph_opt_summary): Add unused argument.
* lto-streamer-out.cc (produce_symbol_asm): Renamed. Use remapped order.
(produce_asm): Rename. New wrapper.
(output_function): Propagate remapped order.
(output_constructor): Likewise.
(copy_function_or_variable): Likewise.
(cmp_int): New.
(create_order_remap): New.
(lto_output): Create remap. Remap order.
* lto-streamer.h (struct lto_symtab_encoder_d): Remap hash_map.
(produce_asm): Add order argument.
gcc/ipa-devirt.cc
gcc/ipa-fnsummary.cc
gcc/ipa-icf.cc
gcc/ipa-modref.cc
gcc/ipa-prop.cc
gcc/ipa-sra.cc
gcc/lto-cgraph.cc
gcc/lto-streamer-out.cc
gcc/lto-streamer.h