[llvm-commits] [llvm] r40819 - /llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
Chris Lattner
sabre at nondot.org
Sat Aug 4 13:07:06 PDT 2007
Author: lattner
Date: Sat Aug 4 15:07:06 2007
New Revision: 40819
URL: http://llvm.org/viewvc/llvm-project?rev=40819&view=rev
Log:
use continue to avoid nesting, no functionality change.
Modified:
llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
Modified: llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp?rev=40819&r1=40818&r2=40819&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Sat Aug 4 15:07:06 2007
@@ -611,20 +611,21 @@
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);
}
}
More information about the llvm-commits
mailing list