[gcc r16-1249] Avoid useless reading of profile data in LTO
Jan Hubicka
hubicka@gcc.gnu.org
Fri Jun 6 08:57:34 GMT 2025
https://gcc.gnu.org/g:572dd0dd8db4bec69883c0b3e53013a7842e886e
commit r16-1249-g572dd0dd8db4bec69883c0b3e53013a7842e886e
Author: Jan Hubicka <hubicka@ucw.cz>
Date: Fri Jun 6 10:56:51 2025 +0200
Avoid useless reading of profile data in LTO
New auto-profile merging dumps made me notice that we read the afdo
data when we are in LTO. This is not necessary since profile is read
at compile time and streamed to LTO bytecode.
gcc/ChangeLog:
* coverage.cc (coverage_init): Return early when in LTO
Diff:
---
gcc/coverage.cc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gcc/coverage.cc b/gcc/coverage.cc
index 7181e7573594..c0ae76a40ef1 100644
--- a/gcc/coverage.cc
+++ b/gcc/coverage.cc
@@ -1253,6 +1253,9 @@ coverage_obj_finish (vec<constructor_elt, va_gc> *ctor,
void
coverage_init (const char *filename)
{
+ /* If we are in LTO, the profile will be read from object files. */
+ if (in_lto_p)
+ return;
const char *original_filename = filename;
int original_len = strlen (original_filename);
#if HAVE_DOS_BASED_FILE_SYSTEM
More information about the Gcc-cvs
mailing list