[llvm-commits] [llvm] r41829 - /llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp

Devang Patel dpatel at apple.com
Mon Sep 10 18:10:45 PDT 2007


Author: dpatel
Date: Mon Sep 10 20:10:45 2007
New Revision: 41829

URL: http://llvm.org/viewvc/llvm-project?rev=41829&view=rev
Log:
Avoid negative logic.

Modified:
    llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp?rev=41829&r1=41828&r2=41829&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp Mon Sep 10 20:10:45 2007
@@ -410,10 +410,10 @@
 
     // 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





More information about the llvm-commits mailing list