]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Avoid useless reading of profile data in LTO
authorJan Hubicka <hubicka@ucw.cz>
Fri, 6 Jun 2025 08:56:51 +0000 (10:56 +0200)
committerJan Hubicka <hubicka@ucw.cz>
Fri, 6 Jun 2025 08:57:27 +0000 (10:57 +0200)
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

gcc/coverage.cc

index 7181e7573594e973c92409de2e49847f27333168..c0ae76a40ef1271265ee9d320a1b889205293108 100644 (file)
@@ -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