summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2017-07-27 12:54:17 +0000
committermarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2017-07-27 12:54:17 +0000
commite0bf8e23bb1927e72aa5e103aa6913fda278990d (patch)
tree8bfda1e41f3776ad2cca89ad13ac8cbf12e94589
parent0512477f8224d19ac2545794cc5279511351adb3 (diff)
downloadgcc-e0bf8e23bb1927e72aa5e103aa6913fda278990d.tar.gz
Fix indirect call optimization done by autoFDO.
2017-07-27 Martin Liska <mliska@suse.cz> * auto-profile.c (autofdo_source_profile::update_inlined_ind_target): Fix wrong condition. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250622 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/auto-profile.c14
2 files changed, 12 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index cf39fdaec7c..ba2889543e1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
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
BBs and edges seen by autoFDO.
diff --git a/gcc/auto-profile.c b/gcc/auto-profile.c
index 552e3331b15..9226e202d50 100644
--- a/gcc/auto-profile.c
+++ b/gcc/auto-profile.c
@@ -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;
}