[PATCH] D32124: [BPI] Move tail computation out of the loop. NFC

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 20 00:03:58 PDT 2017


chandlerc added a comment.

Thanks for the updated patch description! Another minor request here.



================
Comment at: include/llvm/Support/BranchProbability.h:115-121
+  BranchProbability &operator*=(uint32_t RHS) {
+    assert(N != UnknownN &&
+           "Unknown probability cannot participate in arithmetics.");
+    N = (uint64_t(N) * RHS > D) ? D : N * RHS;
+    return *this;
+  }
+
----------------
Add a unittest? I know that much of BranchProbability isn't well covered by unittests, but we should really have good coverage for basic primitives like this and you can start covering the mutation operators.


https://reviews.llvm.org/D32124





More information about the llvm-commits mailing list