auto-profile.c (afdo_calculate_branch_prob): Break once has_sample is true.
authorAditya Kumar <hiraditya@msn.com>
Wed, 27 May 2015 15:06:25 +0000 (15:06 +0000)
committerJeff Law <law@gcc.gnu.org>
Wed, 27 May 2015 15:06:25 +0000 (09:06 -0600)
* auto-profile.c (afdo_calculate_branch_prob): Break once has_sample is
true.

From-SVN: r223762

gcc/ChangeLog
gcc/auto-profile.c

index 5b12b4a3d895479da71ebfff106c5ce0d412046e..c6bd18b50ee859c96b853af48b7cfd0e97c3ab8b 100644 (file)
@@ -1,5 +1,8 @@
 2015-05-22 Aditya Kumar <hiraditya@msn.com>
 
+       * auto-profile.c (afdo_calculate_branch_prob): Break once has_sample
+       is true.
+
        * statistics.c (statistics_fini_pass): Print pass name.
 
 2015-05-27  Richard Biener  <rguenther@suse.de>
index 55dd8d18483ce441d5d50f0ca744d0cb51963699..1936487242f5ee9df133a48be04f73070d1fa689 100644 (file)
@@ -1365,8 +1365,13 @@ afdo_calculate_branch_prob (bb_set *annotated_bb, edge_set *annotated_edge)
   bool has_sample = false;
 
   FOR_EACH_BB_FN (bb, cfun)
-  if (bb->count > 0)
-    has_sample = true;
+  {
+    if (bb->count > 0)
+      {
+       has_sample = true;
+       break;
+      }
+  }
 
   if (!has_sample)
     return;