[PATCH] D15489: Use getEdgeProbability() instead of getEdgeWeight() in BFI and remove getEdgeWeight() interfaces from MBPI.

Cong Hou via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 14 16:01:41 PST 2015


congh added inline comments.

================
Comment at: include/llvm/Analysis/BlockFrequencyInfoImpl.h:1178
@@ +1177,3 @@
+// A helper function that converts a branch probability into weight.
+inline uint32_t convertBranchProbabilityToWeight(const BranchProbability Prob) {
+  return Prob.getNumerator();
----------------
davidxl wrote:
> The name is too long. How about just getWeightFromBranchProb?
OK.

================
Comment at: test/Analysis/BlockFrequencyInfo/bad_input.ll:13
@@ -14,1 +12,3 @@
+; Check that we get 1 and a huge frequency instead of 0,3.
+; CHECK-NEXT: for.body: float = 2147483647.8,
 for.body:
----------------
davidxl wrote:
> The original code also calls into Src->getSuccProbability(Dst).getNumerator() eventually -- so the change looks like NFC -- I missed something obvious here ..
The original code doesn't call Src->getSuccProbability(Dst).getNumerator(). Note that here we are using BPI not MBPI, and MBPI does have an interface getEdgeWeight() that calls getNumerator() from BP. But for BPI we don't do similar things.


http://reviews.llvm.org/D15489





More information about the llvm-commits mailing list