[PATCH] D50411: [libFuzzer] Optimize handle unstable checks by reducing iterations

Max Moroz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 7 15:33:47 PDT 2018


Dor1s accepted this revision.
Dor1s added a comment.
This revision is now accepted and ready to land.

Nice! Do you have an estimate on the performance improvement? The code becomes slightly harder to read, but I guess it's worth it.



================
Comment at: lib/fuzzer/FuzzerLoop.cpp:469
   CBSetupAndRun();
-  TPC.UpdateUnstableCounters(Options.HandleUnstable);
-
-  // Second Rerun
-  CBSetupAndRun();
-  TPC.UpdateUnstableCounters(Options.HandleUnstable);
-
-  // Move minimum hit counts back to ModuleInline8bitCounters
-  if (Options.HandleUnstable == TracePC::MinUnstable ||
-      Options.HandleUnstable == TracePC::ZeroUnstable)
-    TPC.ApplyUnstableCounters();
+  if (TPC.UpdateUnstableCounters(Options.HandleUnstable)) {
+    // Second Rerun
----------------
Just to verify: if we haven't detected any instability, we don't need to apply the counters, right?


https://reviews.llvm.org/D50411





More information about the llvm-commits mailing list