[PATCH] D80611: [BrachProbablityInfo] Proportional distribution of reachable probabilities

Evgeniy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 26 23:22:46 PDT 2020


ebrevnov added inline comments.


================
Comment at: llvm/lib/Analysis/BranchProbabilityInfo.cpp:410
+        BP[i] = BranchProbability::getRaw(
+            (BP[i].getNumerator() *
+                 static_cast<uint64_t>(NewReachableSum.getNumerator()) +
----------------
It would help to understand the code if you split this series of calculations:

uint64_t Mul = static_cast<uint64_t>(...)
uint32_t Div = static_cast<uint_32_t>l(lvm::divideNearest(...));
BP[i] = BranchProbability::getRaw(Div);


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80611/new/

https://reviews.llvm.org/D80611





More information about the llvm-commits mailing list