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 | 9318785df5ce5879aafd93fa418181f2ef6a0b22 (patch) | |
tree | 59c89e6868bb3383dbd56a76182c97b4be7e9d8c /llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp | |
parent | 6b04ecbaf96ab5901b9d081f31b0fbe49e677e7e (diff) | |
download | bcm5719-llvm-9318785df5ce5879aafd93fa418181f2ef6a0b22.tar.gz bcm5719-llvm-9318785df5ce5879aafd93fa418181f2ef6a0b22.zip |
use continue to avoid nesting, no functionality change.
llvm-svn: 40819
Diffstat (limited to 'llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp index c0c7f656227..695df8c2be9 100644 --- a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp +++ b/llvm/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); } } |