[PATCH 4/7 v2] lto: Implement ltrans cache

2024-06-20 Thread Michal Jires
Outside of suggested changes, this version: - uses #define INCLUDE_* - is rebased onto current trunk - 'fprintf (mstream,' lines - --verbose 'recompiling++' count is moved into correct if branch ___ This patch implements Incremental LTO as ltrans cache. The cache is active when directory $GCC_LT

[PATCH 3/7 v2] Lockfile.

2024-06-20 Thread Michal Jires
This version differs by using INCLUDE_STRING instead of . (+whitespace and year) ___ This patch implements lockfile used for incremental LTO. Bootstrapped/regtested on x86_64-pc-linux-gnu gcc/ChangeLog: * Makefile.in: Add lockfile.o. * lockfile.cc: New file. * lockfile.

Re: [PATCH 3/7] Lockfile.

2024-01-09 Thread Michal Jires
Hi, > You do not implement GCOV_LINKED_WITH_LOCKING patch, does locking work > with mingw? Or we only build gcc with cygwin emulation layer these days? I tried to test _locking implementation with both mingw and msys2, in both cases fcntl was present and _locking was not. Admittedly I was unable t

[PATCH 2/7 v2] lto: Remove random_seed from section name.

2024-01-09 Thread Michal Jires
This patch removes suffixes from section names during LTO linking. These suffixes were originally added for ld -r to work (PR lto/44992). They were added to all LTO object files, but are only useful before WPA. After that they waste space, and if kept random, make LTO caching impossible. Bootstra

[PATCH 7/7] lto: partition specific lto_clone_numbers

2023-11-17 Thread Michal Jires
Replaces "lto_priv.$clone_number" by "lto_priv.$partition_hash.$partition_specific_clone_number". To reduce divergence for incremental LTO. Bootstrapped/regtested on x86_64-pc-linux-gnu gcc/lto/ChangeLog: * lto-partition.cc (set_clone_partition_name_checksum): New. (CHECKSUM_STRI

[PATCH 6/7] lto: squash order of symbols in partitions

2023-11-17 Thread Michal Jires
This patch squashes order of symbols in individual partitions, so that their relative order is conserved, but is not influenced by symbols in other partitions. Order of cloned symbols is set to 0. This should be fine because order specifies order of symbols in input files, which cloned symbols are

[PATCH 5/7] lto: Implement cache partitioning

2023-11-17 Thread Michal Jires
This patch implements new cache partitioning. It tries to keep symbols from single source file together to minimize propagation of divergence. It starts with symbols already grouped by source files. If reasonably possible it only either combines several files into one final partition, or, if a fil

[PATCH 3/7] Lockfile.

2023-11-17 Thread Michal Jires
This patch implements lockfile used for incremental LTO. Bootstrapped/regtested on x86_64-pc-linux-gnu gcc/ChangeLog: * Makefile.in: Add lockfile.o. * lockfile.cc: New file. * lockfile.h: New file. --- gcc/Makefile.in | 5 +- gcc/lockfile.cc | 136 +

[PATCH 4/7] lto: Implement ltrans cache

2023-11-17 Thread Michal Jires
This patch implements Incremental LTO as ltrans cache. The cache is active when directory $GCC_LTRANS_CACHE is specified and exists. Stored are pairs of ltrans input/output files and input file hash. File locking is used to allow multiple GCC instances to use to same cache. Bootstrapped/regtested

[PATCH 2/7] lto: Remove random_seed from section name.

2023-11-17 Thread Michal Jires
Bootstrapped/regtested on x86_64-pc-linux-gnu gcc/ChangeLog: * lto-streamer.cc (lto_get_section_name): Remove random_seed in WPA. --- gcc/lto-streamer.cc | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/lto-streamer.cc b/gcc/lto-streamer.cc index 4968fd13413

[PATCH 1/7] lto: Skip flag OPT_fltrans_output_list_.

2023-11-17 Thread Michal Jires
Bootstrapped/regtested on x86_64-pc-linux-gnu gcc/ChangeLog: * lto-opts.cc (lto_write_options): Skip OPT_fltrans_output_list_. --- gcc/lto-opts.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/lto-opts.cc b/gcc/lto-opts.cc index c9bee9d4197..0451e290c75 100644 --- a/gcc/lto-opt

[PATCH 0/7] lto: Incremental LTO.

2023-11-17 Thread Michal Jires
Hi, these patches implement Incremental LTO, specifically by caching results of ltrans phase. Secondarily these patches contain changes to reduce divergence of ltrans partitions so that they can be cached. The aim is to reduce compile times for quick edit-compile cycles while using LTO. Even with

[COMMITTED] Add myself to write after approval

2023-11-16 Thread Michal Jires
Jangala Haochen Jiang Qian Jianhua +Michal Jires Janis Johnson Teresa Johnson Kean Johnston