diff --git a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp --- a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp +++ b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp @@ -245,6 +245,10 @@ FunctionAnalysisManager &AM) { auto &TTI = AM.getResult(F); Options.AC = &AM.getResult(F); + if (F.hasFnAttribute(Attribute::OptForFuzzing)) + Options.setSimplifyCondBranch(false).setFoldTwoEntryPHINode(false); + else + Options.setSimplifyCondBranch(true).setFoldTwoEntryPHINode(true); if (!simplifyFunctionCFG(F, TTI, Options)) return PreservedAnalyses::all(); PreservedAnalyses PA;