From 6c81213b4c78ff8a31430bc8a571810df06f6e90 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 4 Aug 2007 20:07:06 +0000 Subject: use continue to avoid nesting, no functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40819 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/PromoteMemoryToRegister.cpp | 29 ++++++++++++------------ 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'lib/Transforms/Utils/PromoteMemoryToRegister.cpp') diff --git a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp index c0c7f65622..695df8c2be 100644 --- a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp +++ b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp @@ -611,20 +611,21 @@ void PromoteMem2Reg::MarkDominatingPHILive(BasicBlock *BB, unsigned AllocaNum, BasicBlock *DomBB = IDom->getBlock(); DenseMap, PHINode*>::iterator I = NewPhiNodes.find(std::make_pair(DomBB, AllocaNum)); - if (I != NewPhiNodes.end()) { - // Ok, we found an inserted PHI node which dominates this value. - PHINode *DominatingPHI = I->second; - - // Find out if we previously thought it was dead. If so, mark it as being - // live by removing it from the DeadPHINodes set. - if (DeadPHINodes.erase(DominatingPHI)) { - // Now that we have marked the PHI node alive, also mark any PHI nodes - // which it might use as being alive as well. - for (pred_iterator PI = pred_begin(DomBB), PE = pred_end(DomBB); - PI != PE; ++PI) - MarkDominatingPHILive(*PI, AllocaNum, DeadPHINodes); - } - } + if (I == NewPhiNodes.end()) continue; + + // Ok, we found an inserted PHI node which dominates this value. + PHINode *DominatingPHI = I->second; + + // Find out if we previously thought it was dead. If so, mark it as being + // live by removing it from the DeadPHINodes set. + if (!DeadPHINodes.erase(DominatingPHI)) + continue; + + // Now that we have marked the PHI node alive, also mark any PHI nodes + // which it might use as being alive as well. + for (pred_iterator PI = pred_begin(DomBB), PE = pred_end(DomBB); + PI != PE; ++PI) + MarkDominatingPHILive(*PI, AllocaNum, DeadPHINodes); } } -- cgit v1.2.3