diff options
author | Chris Lattner <sabre@nondot.org> | 2007-08-04 20:07:06 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-08-04 20:07:06 +0000 |
commit | 2acd91cc1e57775d12c18b5260d987b701f1cebb (patch) | |
tree | 45c10bf84ccecd198a7f8d48135c5aeed46cdab7 /lib/Transforms/Utils | |
parent | 15fe30bcee9423d1c0af2d7711d549f336461f26 (diff) | |
download | external_llvm-2acd91cc1e57775d12c18b5260d987b701f1cebb.zip external_llvm-2acd91cc1e57775d12c18b5260d987b701f1cebb.tar.gz external_llvm-2acd91cc1e57775d12c18b5260d987b701f1cebb.tar.bz2 |
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
Diffstat (limited to 'lib/Transforms/Utils')
-rw-r--r-- | lib/Transforms/Utils/PromoteMemoryToRegister.cpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp index c0c7f65..695df8c 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<std::pair<BasicBlock*, unsigned>, 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); } } |