diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp index 288ff0462bc..f0c97fd4a04 100644 --- a/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/lib/Transforms/Utils/SimplifyCFG.cpp @@ -1238,17 +1238,7 @@ static bool FoldTwoEntryPHINode(PHINode *PN, const TargetData *TD) { Value *TrueVal = PN->getIncomingValue(PN->getIncomingBlock(0) == IfFalse); Value *FalseVal = PN->getIncomingValue(PN->getIncomingBlock(0) == IfTrue); - Value *NV; - if (Value *V = SimplifySelectInst(IfCond, TrueVal, FalseVal, TD)) - NV = V; - else if (TrueVal->getType()->isIntegerTy(1) && isa(TrueVal) && - cast(TrueVal)->isOne()) { - if (Value *V = SimplifyOrInst(IfCond, FalseVal, TD)) - NV = V; - else - NV = BinaryOperator::CreateOr(IfCond, FalseVal, "", AfterPHIIt); - } else - NV = SelectInst::Create(IfCond, TrueVal, FalseVal, "", AfterPHIIt); + Value *NV = SelectInst::Create(IfCond, TrueVal, FalseVal, "", AfterPHIIt); PN->replaceAllUsesWith(NV); NV->takeName(PN); PN->eraseFromParent();