| Issue |
107949
|
| Summary |
Discrepancy in doc vs implementation for BranchProbabilityInfo::isEdgeHot()
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
naveen-u
|
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%`.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs