Remove unncessary duplication.
authorDevang Patel <dpatel@apple.com>
Fri, 10 Aug 2007 00:59:03 +0000 (00:59 +0000)
committerDevang Patel <dpatel@apple.com>
Fri, 10 Aug 2007 00:59:03 +0000 (00:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40979 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LoopIndexSplit.cpp

index 8234317444a110986fa05e9ed6a3b87d527c0557..e62fcb932b27cb196606f9191270290550aa4837 100644 (file)
@@ -379,19 +379,6 @@ bool LoopIndexSplit::processOneIterationLoop(SplitInfo &SD, LPPassManager &LPM)
   if (SD.SplitCondition->getParent() != Header)
     return false;
   
-  // If one of the Header block's successor is not an exit block then this
-  // loop is not a suitable candidate.
-  BasicBlock *ExitBlock = NULL;
-  for (succ_iterator SI = succ_begin(Header), E = succ_end(Header); SI != E; ++SI) {
-    if (L->isLoopExit(*SI)) {
-      ExitBlock = *SI;
-      break;
-    }
-  }
-
-  if (!ExitBlock)
-    return false;
-
   // If loop header includes loop variant instruction operands then
   // this loop may not be eliminated.
   if (!safeHeader(SD, Header)) 
@@ -399,7 +386,7 @@ bool LoopIndexSplit::processOneIterationLoop(SplitInfo &SD, LPPassManager &LPM)
 
   // If Exit block includes loop variant instructions then this
   // loop may not be eliminated.
-  if (!safeExitBlock(SD, ExitBlock)) 
+  if (!safeExitBlock(SD, ExitCondition->getParent())) 
     return false;
 
   // Update CFG.