From 89722cf73d9f52a127c111f7818d82c89de588a9 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 27 Jul 2017 14:54:17 +0200 Subject: Fix indirect call optimization done by autoFDO. 2017-07-27 Martin Liska * auto-profile.c (autofdo_source_profile::update_inlined_ind_target): Fix wrong condition. From-SVN: r250622 --- gcc/auto-profile.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'gcc/auto-profile.c') diff --git a/gcc/auto-profile.c b/gcc/auto-profile.c index 552e333..9226e20 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; } -- cgit v1.1