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

Devang Patel dpatel at apple.com
Tue Sep 18 17:28:48 PDT 2007


Author: dpatel
Date: Tue Sep 18 19:28:47 2007
New Revision: 42122

URL: http://llvm.org/viewvc/llvm-project?rev=42122&view=rev
Log:
Relax loop ExitCondition predicate restriction.

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=42122&r1=42121&r2=42122&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp Tue Sep 18 19:28:47 2007
@@ -356,11 +356,7 @@
     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 @@
   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:





More information about the llvm-commits mailing list