From 055dc102e97316d423bd068f8b228d27fb93c90a Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 23 Sep 2005 07:23:18 +0000 Subject: [PATCH] simplify some logic further git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23408 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/SimplifyCFG.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp index a952422fc2b..72f878337ee 100644 --- a/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/lib/Transforms/Utils/SimplifyCFG.cpp @@ -1041,7 +1041,6 @@ static bool FoldTwoEntryPHINode(PHINode *PN) { // that need to be moved to the dominating block. std::set AggressiveInsts; - bool CanPromote = true; BasicBlock::iterator AfterPHIIt = BB->begin(); while (isa(AfterPHIIt)) { PHINode *PN = cast(AfterPHIIt++); @@ -1054,14 +1053,10 @@ static bool FoldTwoEntryPHINode(PHINode *PN) { &AggressiveInsts) || !DominatesMergePoint(PN->getIncomingValue(1), BB, &AggressiveInsts)) { - CanPromote = false; + return false; } } - // Did we eliminate all PHI's? - if (!CanPromote && AfterPHIIt != BB->begin()) - return false; - // If we all PHI nodes are promotable, check to make sure that all // instructions in the predecessor blocks can be promoted as well. If // not, we won't be able to get rid of the control flow, so it's not