summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitd0ce981372eb2518091f14a9f71150ad2c69bb29 (patch)
tree8fd08f2a539af9d0b6b6c67bc7c71c6c15aa51ee /llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp
parentddacbb39ab958d79026a63ddc8af7523b750b1c4 (diff)
downloadbcm5719-llvm-d0ce981372eb2518091f14a9f71150ad2c69bb29.tar.gz
bcm5719-llvm-d0ce981372eb2518091f14a9f71150ad2c69bb29.zip
If the sign of exit condition and split condition does not match
then do not split loop index. llvm-svn: 58995
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp b/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp
index 9a5920c8b97..8c54ce372ee 100644
--- a/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp
+++ b/llvm/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.
OpenPOWER on IntegriCloud