]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[PATCH] Run feedback directed ipa-split for flag_auto_profile
authorKugan Vivekanandarajah <kvivekananda@nvidia.com>
Sun, 23 Nov 2025 06:14:53 +0000 (17:14 +1100)
committerKugan Vivekanandarajah <kvivekananda@nvidia.com>
Sun, 23 Nov 2025 06:14:53 +0000 (17:14 +1100)
IPA split is now running before auto-profile annotation. Changing it
after annotation as it is done for PGO.

gcc/ChangeLog:

2025-07-21  Kugan Vivekanandarajah  <kvivekananda@nvidia.com>

* ipa-split.cc (pass_split_functions::gate): Do not run when
flag_auto_profile.
(pass_feedback_split_functions::gate): Run when flag_auto_profile.

gcc/ipa-split.cc

index 48f6a725ae8cc0434bde2eec9017b5ae56baafd4..aa40bedb7547b31c5a3f19cce2ade50b7fafdc2f 100644 (file)
@@ -1950,7 +1950,9 @@ pass_split_functions::gate (function *)
   /* When doing profile feedback, we want to execute the pass after profiling
      is read.  So disable one in early optimization.  */
   return (flag_partial_inlining
-      && !profile_arc_flag && !flag_branch_probabilities);
+      && !profile_arc_flag
+      && !flag_branch_probabilities
+      && !flag_auto_profile);
 }
 
 } // anon namespace
@@ -2013,7 +2015,7 @@ pass_feedback_split_functions::gate (function *)
   /* We don't need to split when profiling at all, we are producing
      lousy code anyway.  */
   return (flag_partial_inlining
-         && flag_branch_probabilities);
+         && (flag_branch_probabilities || flag_auto_profile));
 }
 
 } // anon namespace