diff options
author | Devang Patel <dpatel@apple.com> | 2007-09-19 00:28:47 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2007-09-19 00:28:47 +0000 |
commit | babbe27007b6b418706d4fe1de3092c8a88fd314 (patch) | |
tree | 3e38901659b07bd8906270aeb416bc11d7c959cf | |
parent | 968eee2aa7033a5850dc7830f22220236d53f212 (diff) | |
download | external_llvm-babbe27007b6b418706d4fe1de3092c8a88fd314.zip external_llvm-babbe27007b6b418706d4fe1de3092c8a88fd314.tar.gz external_llvm-babbe27007b6b418706d4fe1de3092c8a88fd314.tar.bz2 |
Relax loop ExitCondition predicate restriction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42122 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/LoopIndexSplit.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/Transforms/Scalar/LoopIndexSplit.cpp b/lib/Transforms/Scalar/LoopIndexSplit.cpp index cb5060a..d30f18d 100644 --- a/lib/Transforms/Scalar/LoopIndexSplit.cpp +++ b/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: |