[PATCH] D140239: [llvm-stress] Add a mutation fuzzing mode

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 19 07:11:01 PST 2022


nikic added a comment.

In D140239#4002223 <https://reviews.llvm.org/D140239#4002223>, @reames wrote:

> In D140239#4002162 <https://reviews.llvm.org/D140239#4002162>, @nikic wrote:
>
>> Is there much overlap between `llvm-stress generate` and `llvm-stress mutate`? Maybe that should just be a separate `llvm-mutate` tool? (Just throwing this out there, not advocating for anything in particular...)
>
> I'm open to either option here.
>
> My thinking went as follows:
>
> 1. They both related to generating test cases for fuzzing.  (i.e the "stress" part of the name)
> 2. The generate mode is simply a mutator starting with an empty function.  At the moment, the code is separate, but it might make sense to merge parts.  (Or not, no concrete plans here.)  From a usage perspective, a user might want to use both llvm-stress generate, and llvm-stress mutate (on an empty input) at some experimentally established frequency.  (As right now, the two modes generate different patterns at different frequencies.)
> 3. As we adjust control knobs (i.e size, types, enable-disable flags), we're more likely to have a consistent interface if the tools in the same source.

I think my main concern would be that `llvm-stress generate` is *not* just the same as `llvm-stress mutate` with an empty module -- it uses a different generation method with very different characteristics, so this might be a bit confusing.

Don't feel strong about this though, and the code looks fine to me. Might make sense to add a test with a fixed seed just as a basic sanity check?



================
Comment at: llvm/tools/llvm-stress/llvm-stress.cpp:812
+  Strategies.emplace_back(new InstDeleterIRStrategy());
+  Strategies.emplace_back(new InstModificationIRStrategy());
+
----------------
Any particular reason why this does not include all strategies?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140239/new/

https://reviews.llvm.org/D140239



More information about the llvm-commits mailing list