If the sign of exit condition and split condition does not match

then do not split loop index.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58995 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel
2008-11-10 19:48:34 +00:00
parent f509224510
commit d4e7f44319
2 changed files with 75 additions and 1 deletions

View File

@@ -1437,7 +1437,12 @@ bool LoopIndexSplit::splitLoop(SplitInfo &SD) {
if (ICMP->getPredicate() == ICmpInst::ICMP_EQ)
return false;
}
// If the predicate sign does not match then skip.
ICmpInst *CI = dyn_cast<ICmpInst>(SD.SplitCondition);
if (CI && (ExitCondition->isSignedPredicate() != CI->isSignedPredicate()))
return false;
BasicBlock *SplitCondBlock = SD.SplitCondition->getParent();
// Unable to handle triangle loops at the moment.