Index: llvm/tools/llvm-reduce/deltas/ReduceUsingSimplifyCFG.cpp =================================================================== --- llvm/tools/llvm-reduce/deltas/ReduceUsingSimplifyCFG.cpp +++ llvm/tools/llvm-reduce/deltas/ReduceUsingSimplifyCFG.cpp @@ -39,7 +39,22 @@ for (auto &F : M) { for (auto &BB : F) { auto *BR = dyn_cast(BB.getTerminator()); - if (!BR || !BR->isConditional() || O.shouldKeep()) + if (!BR || !BR->isConditional()) + continue; + + // Skip cases that already have the value we're going to set this to. + ConstantInt *Cond = dyn_cast(BR->getCondition()); + if (Cond) { + if (Direction) { + if (Cond->isOne()) + continue; + } else { + if (Cond->isZero()) + continue; + } + } + + if (O.shouldKeep()) continue; if (Direction)