]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix indirect call optimization done by autoFDO.
authorMartin Liska <mliska@suse.cz>
Thu, 27 Jul 2017 12:54:17 +0000 (14:54 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Thu, 27 Jul 2017 12:54:17 +0000 (12:54 +0000)
2017-07-27  Martin Liska  <mliska@suse.cz>

* auto-profile.c (autofdo_source_profile::update_inlined_ind_target):
Fix wrong condition.

From-SVN: r250622

gcc/ChangeLog
gcc/auto-profile.c

index cf39fdaec7cd3f0d227923b77d75dd16771ea199..ba2889543e1e969eb646576d52811f7ff4e13030 100644 (file)
@@ -1,3 +1,8 @@
+2017-07-27  Martin Liska  <mliska@suse.cz>
+
+       * auto-profile.c (autofdo_source_profile::update_inlined_ind_target):
+       Fix wrong condition.
+
 2017-07-27  Martin Liska  <mliska@suse.cz>
 
        * auto-profile.c (afdo_annotate_cfg): Assign zero counts to
index 552e3331b1510aa037694dce764d6a8012a72c1d..9226e202d50374f0af49d6b583ca06cb52367338 100644 (file)
@@ -774,15 +774,15 @@ autofdo_source_profile::update_inlined_ind_target (gcall *stmt,
      hot any more. Will avoid promote the original target.
 
      To check if original promoted target is still hot, we check the total
-     count of the unpromoted targets (stored in old_info). If it is no less
-     than half of the callsite count (stored in INFO), the original promoted
-     target is considered not hot any more.  */
-  if (total >= info->count / 2)
+     count of the unpromoted targets (stored in TOTAL). If a callsite count
+     (stored in INFO) is smaller than half of the total count, the original
+     promoted target is considered not hot any more.  */
+  if (info->count < total / 2)
     {
       if (dump_file)
-       fprintf (dump_file, " not hot anymore %ld >= %ld",
-                (long)total,
-                (long)info->count /2);
+       fprintf (dump_file, " not hot anymore %ld < %ld",
+                (long)info->count,
+                (long)total /2);
       return false;
     }