<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/107949>107949</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Discrepancy in doc vs implementation for BranchProbabilityInfo::isEdgeHot()
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
naveen-u
</td>
</tr>
</table>
<pre>
Hi,
The documentation for the [`BranchProbabilityInfo::isEdgeHot()`](https://llvm.org/docs/doxygen/classllvm_1_1BranchProbabilityInfo.html#aa2da8547348736e285afd8af9093a83d) function says:
> We define hot as having a relative probability >= 80%
However, the [implementation](https://llvm.org/docs/doxygen/BranchProbabilityInfo_8cpp_source.html#l01083) checks for strictly >80% and not >=80%.
```cpp
bool BranchProbabilityInfo::
isEdgeHot(const BasicBlock *Src, const BasicBlock *Dst) const {
// Hot probability is at least 4/5 = 80%
// FIXME: Compare against a static "hot" BranchProbability.
return getEdgeProbability(Src, Dst) > BranchProbability(4, 5);
}
```
The doc should be corrected to say `We define hot as having a relative probability > 80%`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVMGK4zgQ_ZrKpeggS7ZjH3xIOh16DgsLu7B7a8py2daOIhlJzmz-frGTnumeaZYZMBZIpdJ7r14VxWgGx9xAcYDiuKE5jT40ji7M7mHetL67Ns8G5COII4j97f_nyNh5PZ_ZJUrGO-x9wDQyLmlKcQjk9Ph78C21xpp0_eR6D2oPam_iUzfws08gK5A1lAKKI8hqTGmKS4g8gTxZezlvfRhAnjqv47r8ex3YgTxpSzEuAS_ZS_bhS9sxnS1IRSQ7qop8p_Jqp0qWVUF9V1Ffi1pRpTqQNfaz0yuFSNcVwI2nesK_GDvujWMcfUKKONLFuAEJA1tK5sI4fXsYQT2BOmIlQBZvxXr2X_jCAeTjq0LmPFn-qt2v8v-Q8kulp-kl-jlofqVvRSYqtXDUI-vPcS1STMHoZFe4K1Qk16Hz6Y5_3du-xb-UaP30NN12Wu8t_k-Nb1FvK629iwkPFI0-WK8_I8j9H0Evmnx0dIxphb0ewe5wS4h4EweffXqnvIlICS1TTJiDPBX4XSG-3jx9-vu3J1B7fPTniQIjDWSWRwjjUg2NIOW4QJY_Ety-Jguc5uBw4LQwfBMBsrqzujNYbPRDHpBVvsQUi__VnRzsjt_J_UHDYRz9bDtsGbUPgXXiDpNfrItQil837F2kUmw3XaO6WtW04SbbyaJWqqyLzdiUiro6K8o273ekOmpJqYrbvi1rWRZlvzGNFDIXdSaEFJkqtllHFYu2r2nHZZEJyAWfydjtq6s3JsaZm0zs6rzeWGrZxnUASen4C66nIOUyj0KzXHpo5yFCLqyJKX5Lk0yy3BxN1IEncvqKxq0yXSK-77HV-j8_lTZzsM37jhxMGud2q_353p735WEK_h_WCeRpxb306p3YpZH_BQAA___kMK5L">