value-prof.cc: Correct edge prob calculation.
The mod-subtract optimization with ncounts==1 produced incorrect edge probabilities due to incorrect conditional probability calculation. This patch fixes the calculation. Signed-off-by: Filip Kastl <filip.kastl@gmail.com> gcc/ChangeLog: * value-prof.cc (gimple_mod_subtract_transform): Correct edge prob calculation.
This commit is contained in:
parent
a4778dbd93
commit
1ee710027d
1 changed files with 5 additions and 1 deletions
|
@ -1186,7 +1186,11 @@ gimple_mod_subtract_transform (gimple_stmt_iterator *si)
|
|||
if (all > 0)
|
||||
{
|
||||
prob1 = profile_probability::probability_in_gcov_type (count1, all);
|
||||
prob2 = profile_probability::probability_in_gcov_type (count2, all);
|
||||
if (all == count1)
|
||||
prob2 = profile_probability::even ();
|
||||
else
|
||||
prob2 = profile_probability::probability_in_gcov_type (count2, all
|
||||
- count1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue