[PATCH] D16419: Use std::piecewise_constant_distribution instead of ad-hoc binary search.

Kostya Serebryany via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 21 17:08:05 PST 2016


kcc added a comment.

almost LGTM


================
Comment at: lib/Fuzzer/FuzzerLoop.cpp:511
@@ +510,3 @@
+  for (size_t i = 0; i < Corpus.size(); i++) {
+    Intervals[i+1] = i+1;
+    Weights[i] = i+1;
----------------
yep, iota would be nicer. 
Also, the current code does not initialize Intervals[0]

================
Comment at: lib/Fuzzer/test/FuzzerUnittest.cpp:410
@@ +409,3 @@
+  size_t N = 10;
+  size_t TriesPerUnit = 1E6;
+  for (size_t i = 0; i < N; i++) {
----------------
why cast from double from size_t. 
Better just write 1 << 20. 


http://reviews.llvm.org/D16419





More information about the llvm-commits mailing list