[PATCH] D13745: Replace all uses of branch weights by branch probabilities on machine code level passes.

Cong Hou via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 15 10:57:29 PDT 2015


congh marked 5 inline comments as done.

================
Comment at: include/llvm/Analysis/BranchProbabilityInfo.h:118-121
@@ -114,1 +117,6 @@
 
+  static BranchProbability getBranchProbStackProtector(bool IsLikely) {
+    return IsLikely ? BranchProbability((1u << 20) - 1, 1u << 20)
+                    : BranchProbability(1, 1u << 20);
+  }
+
----------------
silvas wrote:
> Can you factor out 1u<<20 into a named constant?
OK. I created a static constant variable representing a likely probability.


http://reviews.llvm.org/D13745





More information about the llvm-commits mailing list