[llvm-commits] [llvm] r51915 - /llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp
Owen Anderson
resistor at mac.com
Tue Jun 3 11:29:48 PDT 2008
Author: resistor
Date: Tue Jun 3 13:29:48 2008
New Revision: 51915
URL: http://llvm.org/viewvc/llvm-project?rev=51915&view=rev
Log:
LoopIndexSplit can sometimes result in cases where a block in its own domfrontier.
Don't crash when we encounter one of these.
Modified:
llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp
Modified: llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp?rev=51915&r1=51914&r2=51915&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp Tue Jun 3 13:29:48 2008
@@ -235,9 +235,12 @@
DominanceFrontier::iterator I = DF->find(DestBB);
if (I != DF->end()) {
DF->addBasicBlock(NewBB, I->second);
- // However NewBB's frontier does not include DestBB.
- DominanceFrontier::iterator NF = DF->find(NewBB);
- DF->removeFromFrontier(NF, DestBB);
+
+ if (I->second.count(DestBB)) {
+ // However NewBB's frontier does not include DestBB.
+ DominanceFrontier::iterator NF = DF->find(NewBB);
+ DF->removeFromFrontier(NF, DestBB);
+ }
}
else
DF->addBasicBlock(NewBB, DominanceFrontier::DomSetType());
More information about the llvm-commits
mailing list