Drop time profile for multi-threaded training run.
authorMartin Liska <mliska@suse.cz>
Fri, 22 Jan 2021 13:00:30 +0000 (14:00 +0100)
committerMartin Liska <mliska@suse.cz>
Fri, 22 Jan 2021 13:20:53 +0000 (14:20 +0100)
gcc/ChangeLog:

PR gcov-profile/98739
* profile.c (compute_value_histograms): Drop time profile for
-fprofile-reproducible=multithreaded.

gcc/profile.c

index 1f1d60c818014b929fc3b71a019ed11d11788838..1fa4196fa164fa019c577d6dd43408b13d2bb532 100644 (file)
@@ -897,8 +897,16 @@ compute_value_histograms (histogram_values values, unsigned cfg_checksum,
              node->tp_first_run = 0;
            }
 
-          if (dump_file)
-            fprintf (dump_file, "Read tp_first_run: %d\n", node->tp_first_run);
+         /* Drop profile for -fprofile-reproducible=multithreaded.  */
+         bool drop
+           = (flag_profile_reproducible == PROFILE_REPRODUCIBILITY_MULTITHREADED);
+         if (drop)
+           node->tp_first_run = 0;
+
+         if (dump_file)
+           fprintf (dump_file, "Read tp_first_run: %d%s\n", node->tp_first_run,
+                    drop ? "; ignored because profile reproducibility is "
+                    "multi-threaded" : "");
         }
     }