summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-09-19 00:28:47 +0000
committerDevang Patel <dpatel@apple.com>2007-09-19 00:28:47 +0000
commit69a55a38ed51d042ea484fa5c1ef783e17785f54 (patch)
treeaad36a62057b3b21360032c5a06528e71bda1ad9 /llvm/lib/Transforms
parent455a53b7db42d4dd000a7e196a11b1a8bd329258 (diff)
downloadbcm5719-llvm-69a55a38ed51d042ea484fa5c1ef783e17785f54.tar.gz
bcm5719-llvm-69a55a38ed51d042ea484fa5c1ef783e17785f54.zip
Relax loop ExitCondition predicate restriction.
llvm-svn: 42122
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp b/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp
index cb5060a6765..d30f18d91b6 100644
--- a/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp
@@ -356,11 +356,7 @@ void LoopIndexSplit::findLoopConditionals() {
return;
// FIXME
- if (CI->getPredicate() == ICmpInst::ICMP_SGT
- || CI->getPredicate() == ICmpInst::ICMP_UGT
- || CI->getPredicate() == ICmpInst::ICMP_SGE
- || CI->getPredicate() == ICmpInst::ICMP_UGE
- || CI->getPredicate() == ICmpInst::ICMP_EQ
+ if (CI->getPredicate() == ICmpInst::ICMP_EQ
|| CI->getPredicate() == ICmpInst::ICMP_NE)
return;
@@ -1015,6 +1011,12 @@ void LoopIndexSplit::calculateLoopBounds(SplitInfo &SD) {
Value *AEV = SD.SplitValue;
Value *BSV = SD.SplitValue;
+ if (ExitCondition->getPredicate() == ICmpInst::ICMP_SGT
+ || ExitCondition->getPredicate() == ICmpInst::ICMP_UGT
+ || ExitCondition->getPredicate() == ICmpInst::ICMP_SGE
+ || ExitCondition->getPredicate() == ICmpInst::ICMP_UGE)
+ ExitCondition->swapOperands();
+
switch (ExitCondition->getPredicate()) {
case ICmpInst::ICMP_SGT:
case ICmpInst::ICMP_UGT:
OpenPOWER on IntegriCloud