aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/LoopIndexSplit.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2008-11-10 19:48:34 +0000
committerDevang Patel <dpatel@apple.com>2008-11-10 19:48:34 +0000
commitd4e7f44319824998bafe1bd1c50314e1310a9ca1 (patch)
tree25498a043153f3741229dd1e7b490b64d3011898 /lib/Transforms/Scalar/LoopIndexSplit.cpp
parentf5092245102297e91656e0e471778f0875a8bc66 (diff)
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
Diffstat (limited to 'lib/Transforms/Scalar/LoopIndexSplit.cpp')
-rw-r--r--lib/Transforms/Scalar/LoopIndexSplit.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/LoopIndexSplit.cpp b/lib/Transforms/Scalar/LoopIndexSplit.cpp
index 9a5920c8b9..8c54ce372e 100644
--- a/lib/Transforms/Scalar/LoopIndexSplit.cpp
+++ b/lib/Transforms/Scalar/LoopIndexSplit.cpp
@@ -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.