DominatorTree *DT = nullptr;
if (RequireAndPreserveDomTree)
DT = &AM.getResult<DominatorTreeAnalysis>(F);
- if (F.hasFnAttribute(Attribute::OptForFuzzing)) {
- Options.setSimplifyCondBranch(false).setFoldTwoEntryPHINode(false);
- } else {
- Options.setSimplifyCondBranch(true).setFoldTwoEntryPHINode(true);
- }
if (!simplifyFunctionCFG(F, TTI, DT, Options))
return PreservedAnalyses::all();
PreservedAnalyses PA;
DominatorTree *DT = nullptr;
if (RequireAndPreserveDomTree)
DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
- if (F.hasFnAttribute(Attribute::OptForFuzzing)) {
- Options.setSimplifyCondBranch(false)
- .setFoldTwoEntryPHINode(false);
- } else {
- Options.setSimplifyCondBranch(true)
- .setFoldTwoEntryPHINode(true);
- }
auto &TTI = getAnalysis<TargetTransformInfoWrapperPass>().getTTI(F);
return simplifyFunctionCFG(F, TTI, DT, Options);
"Tautological conditional branch should have been eliminated already.");
BasicBlock *BB = BI->getParent();
- if (!Options.SimplifyCondBranch)
+ if (!Options.SimplifyCondBranch ||
+ BI->getFunction()->hasFnAttribute(Attribute::OptForFuzzing))
return false;
// Conditional branch
IRBuilder<> Builder(BB);
- if (Options.FoldTwoEntryPHINode) {
+ if (Options.FoldTwoEntryPHINode &&
+ !BB->getParent()->hasFnAttribute(Attribute::OptForFuzzing)) {
// If there is a trivial two-entry PHI node in this basic block, and we can
// eliminate it, do so now.
if (auto *PN = dyn_cast<PHINode>(BB->begin()))