Commit 89722cf7 by Martin Liska Committed by Martin Liska

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.

From-SVN: r250622
parent b8163af7
2017-07-27 Martin Liska <mliska@suse.cz> 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 * auto-profile.c (afdo_annotate_cfg): Assign zero counts to
BBs and edges seen by autoFDO. BBs and edges seen by autoFDO.
......
...@@ -774,15 +774,15 @@ autofdo_source_profile::update_inlined_ind_target (gcall *stmt, ...@@ -774,15 +774,15 @@ autofdo_source_profile::update_inlined_ind_target (gcall *stmt,
hot any more. Will avoid promote the original target. hot any more. Will avoid promote the original target.
To check if original promoted target is still hot, we check the total 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 count of the unpromoted targets (stored in TOTAL). If a callsite count
than half of the callsite count (stored in INFO), the original promoted (stored in INFO) is smaller than half of the total count, the original
target is considered not hot any more. */ promoted target is considered not hot any more. */
if (total >= info->count / 2) if (info->count < total / 2)
{ {
if (dump_file) if (dump_file)
fprintf (dump_file, " not hot anymore %ld >= %ld", fprintf (dump_file, " not hot anymore %ld < %ld",
(long)total, (long)info->count,
(long)info->count /2); (long)total /2);
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment