[PATCH] D89590: [NPM][SimplifyCFGPass] For OptForFuzzing attribute, disable SimplifyCondBranch and FoldTwoEntryPHINode in NPM

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 20 19:55:18 PDT 2020


aeubanks added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp:248-251
+  if (F.hasFnAttribute(Attribute::OptForFuzzing))
+    Options.setSimplifyCondBranch(false).setFoldTwoEntryPHINode(false);
+  else
+    Options.setSimplifyCondBranch(true).setFoldTwoEntryPHINode(true);
----------------
the changes in this file shouldn't be necessary any more


================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:2419
+  const Function *Fn = BB->getParent();
+  if (Fn && Fn->hasFnAttribute(Attribute::OptForFuzzing))
+    return false;
----------------
Fn should never be null, ditto below


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89590



More information about the llvm-commits mailing list