From: Devang Patel Date: Mon, 10 Sep 2007 23:57:58 +0000 (+0000) Subject: Check all terminators inside loop. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ba32a5f3ccddcae38e96f7f73fa35f0228f4070c;p=oota-llvm.git Check all terminators inside loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41821 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/LoopIndexSplit.cpp b/lib/Transforms/Scalar/LoopIndexSplit.cpp index 0f55a9100c3..03f1553e907 100644 --- a/lib/Transforms/Scalar/LoopIndexSplit.cpp +++ b/lib/Transforms/Scalar/LoopIndexSplit.cpp @@ -379,7 +379,6 @@ void LoopIndexSplit::findSplitCondition() { SplitInfo SD; // Check all basic block's terminators. - for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); I != E; ++I) { BasicBlock *BB = *I; @@ -395,10 +394,10 @@ void LoopIndexSplit::findSplitCondition() { ICmpInst *CI = dyn_cast(BR->getCondition()); if (!CI || CI == ExitCondition) - return; + continue; if (CI->getPredicate() == ICmpInst::ICMP_NE) - return; + continue; // If split condition predicate is GT or GE then first execute // false branch of split condition. @@ -508,7 +507,7 @@ bool LoopIndexSplit::processOneIterationLoop(SplitInfo &SD) { // SplitCondition : icmp eq i32 IndVar, SplitValue // into // c1 = icmp uge i32 SplitValue, StartValue - // c2 = icmp ult i32 vSplitValue, ExitValue + // c2 = icmp ult i32 SplitValue, ExitValue // and i32 c1, c2 bool SignedPredicate = ExitCondition->isSignedPredicate(); Instruction *C1 = new ICmpInst(SignedPredicate ?