Avoid negative logic.
authorDevang Patel <dpatel@apple.com>
Tue, 11 Sep 2007 01:10:45 +0000 (01:10 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 11 Sep 2007 01:10:45 +0000 (01:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41829 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LoopIndexSplit.cpp

index f182c9138ca446ae5d51dc7ac98024943b28d8f8..48626ac475ed633c5115e93166ce0bd1bd526298 100644 (file)
@@ -410,10 +410,10 @@ void LoopIndexSplit::findSplitCondition() {
 
     // If split condition predicate is GT or GE then first execute
     // false branch of split condition.
-    if (CI->getPredicate() != ICmpInst::ICMP_ULT
-        && CI->getPredicate() != ICmpInst::ICMP_SLT
-        && CI->getPredicate() != ICmpInst::ICMP_ULE
-        && CI->getPredicate() != ICmpInst::ICMP_SLE)
+    if (CI->getPredicate() == ICmpInst::ICMP_UGT
+        || CI->getPredicate() == ICmpInst::ICMP_SGT
+        || CI->getPredicate() == ICmpInst::ICMP_UGE
+        || CI->getPredicate() == ICmpInst::ICMP_SGE)
       SD.UseTrueBranchFirst = false;
 
     // If one operand is loop invariant and second operand is SCEVAddRecExpr