[PATCH] D138959: [FuzzMutate] New InsertPHINode strategy.

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 30 11:45:09 PST 2022


arsenm requested changes to this revision.
arsenm added inline comments.
This revision now requires changes to proceed.


================
Comment at: llvm/lib/FuzzMutate/IRMutator.cpp:310
+  SmallVector<Value *, 4> Srcs;
+  for (BasicBlock *Prev : predecessors(&BB)) {
+    SmallVector<Instruction *, 32> Insts;
----------------
s/Prev/Pred


================
Comment at: llvm/lib/FuzzMutate/IRMutator.cpp:314-315
+      Insts.push_back(&*I);
+    Value *Src =
+        IB.findOrCreateSource(*Prev, Insts, Srcs, fuzzerop::onlyType(Ty));
+    Srcs.push_back(Src);
----------------
If a predecessor block branches to the same block multiple times (e.g. it's the target of multiple switch cases), the same incoming value needs to appear for each instance. Can you add such a case to the test?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138959



More information about the llvm-commits mailing list