[PATCH] D39555: Introduce llvm-opt-fuzzer for fuzzing optimization passes

Igor Laevsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 9 10:51:42 PST 2017


igor-laevsky added inline comments.


================
Comment at: lib/FuzzMutate/FuzzerCLI.cpp:80-84
+  for (StringRef Opt : Opts) {
+    if (Opt.startswith("instcombine")) {
+      Args.push_back("-passes=instcombine");
+    } else if (Triple(Opt).getArch()) {
+      Args.push_back("-mtriple=" + Opt.str());
----------------
bogner wrote:
> Why not assume everything that isn't an arch is a pass name and pass them all as a comma separated list to -passes=?
Some passes contain dashes in their names, and this doesn't work well with the option parser. Also syntax of the new pass manager includes braces and I'm not sure how good they are going to work in the executable file name. 

So instead I decided to treat each option as an a alias for the predefined pipeline configuration. So for example someday we may have "safepoints" option which will expand into pipeline where PlaceSafepoints is followed by the RS4GC pass.


https://reviews.llvm.org/D39555





More information about the llvm-commits mailing list