[PATCH] D11442: Create a utility function normalizeEdgeWeights() in BranchProbabilityInfo that is used to normalize a list of weights so that the sum of them does not exceed UINT32_MAX.

David davidxl at google.com
Thu Jul 23 12:30:32 PDT 2015

davidxl added inline comments.

Comment at: include/llvm/Analysis/BranchProbabilityInfo.h:165
@@ +164,3 @@
+  // If the computed sum fits in 32-bits, we're done.
+  if (Sum <= UINT32_MAX)
+    return 1;
Why not doing normalization unconditionally to avoid precision loss introduced by incremental update (for small weights)?


More information about the llvm-commits mailing list