[PATCH] D134481: [BranchProbabilityInfo] Fixed contradiction between isEdgeHot() docs using >= 80% and code using > 80%

Agam Kohli via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 22 14:28:39 PDT 2022


agamkohli9 created this revision.
Herald added a subscriber: hiraditya.
Herald added a project: All.
agamkohli9 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134481

Files:
  llvm/lib/Analysis/BranchProbabilityInfo.cpp


Index: llvm/lib/Analysis/BranchProbabilityInfo.cpp
===================================================================
--- llvm/lib/Analysis/BranchProbabilityInfo.cpp
+++ llvm/lib/Analysis/BranchProbabilityInfo.cpp
@@ -1089,7 +1089,7 @@
 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);
+  return getEdgeProbability(Src, Dst) >= BranchProbability(4, 5);
 }
 
 /// Get the raw edge probability for the edge. If can't find it, return a


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134481.462293.patch
Type: text/x-patch
Size: 622 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220922/b1e145e7/attachment.bin>


More information about the llvm-commits mailing list