This is an archive of the discontinued LLVM Phabricator instance.

[libFuzzer] Optimize handle unstable checks by reducing iterations
ClosedPublic

Authored by kevinwkt on Aug 7 2018, 3:22 PM.

Details

Summary

We only run the 3rd check if 2nd check finds unstable edges.
3rd UpdateUnstableCounters is now merged with ApplyUnstableCounters to only run 1 iteration.

Patch by Kyungtak Woo (@kevinwkt).

Diff Detail

Event Timeline

kevinwkt created this revision.Aug 7 2018, 3:22 PM
Dor1s accepted this revision.Aug 7 2018, 3:33 PM
Dor1s added a reviewer: morehouse.
Dor1s added subscribers: kcc, llvm-commits.

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

lib/fuzzer/FuzzerLoop.cpp
469–473

Just to verify: if we haven't detected any instability, we don't need to apply the counters, right?

This revision is now accepted and ready to land.Aug 7 2018, 3:33 PM
kevinwkt marked an inline comment as done.Aug 7 2018, 3:39 PM

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

Obviously this would depend on how big and unstable the target is.
Currently, for every new edge we find we run 3x even if it is deterministic.

We would be getting rid of the extra 3rd run for every new deterministic run we find.
Also, since we merged Update and Apply UnstableCounters, we get rid of an iteration for every input that goes through HandleUnstableChecks.

lib/fuzzer/FuzzerLoop.cpp
469–473

Yeah, if we don't detect instability, Inline8bitCounters would be equal to UnstableCounters.

morehouse accepted this revision.Aug 8 2018, 12:00 AM

Nice patch!

Dor1s updated this revision to Diff 159708.Aug 8 2018, 6:45 AM

Rebase and getting ready to land

Herald added subscribers: Restricted Project, delcypher. · View Herald TranscriptAug 8 2018, 6:45 AM
Dor1s edited the summary of this revision. (Show Details)Aug 8 2018, 6:46 AM
This revision was automatically updated to reflect the committed changes.