[PATCH] D139907: [FuzzMutate] RandomIRBuilder has more source and sink type now.

Peter Rong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 13 21:41:54 PST 2022


Peter added inline comments.


================
Comment at: llvm/lib/FuzzMutate/RandomIRBuilder.cpp:134
+      }
+      auto RS = makeSampler(Rand, make_filter_range(Args, MatchesPred));
+      if (!RS.isEmpty()) {
----------------
arsenm wrote:
> With the range do you really need to make the args vector? If so you can just initialize with Args(F->arg_begin(), F->arg_end())
What's annoying about built in ranges is that they are ranges of references, which a) can be used to initialize a pointer vector and b) causes a ton of type conversion and use of copy constructor issues.


================
Comment at: llvm/lib/FuzzMutate/RandomIRBuilder.cpp:176
+          return LoadGV;
+        } else {
+          LoadGV->eraseFromParent();
----------------
arsenm wrote:
> No else after return
Do you mean we don't need to remove the newly created Global Variable, even if we didn't use it? I am worried the random module will be filled with them pretty soon...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139907



More information about the llvm-commits mailing list