[llvm-commits] [llvm] r61623 - /llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp

Bill Wendling isanbard at gmail.com
Sat Jan 3 22:19:14 PST 2009


Author: void
Date: Sun Jan  4 00:19:11 2009
New Revision: 61623

URL: http://llvm.org/viewvc/llvm-project?rev=61623&view=rev
Log:
Revert this transform. It was causing some dramatic slowdowns in a few tests. See PR3266.

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

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

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Sun Jan  4 00:19:11 2009
@@ -4880,37 +4880,6 @@
       if (FCmpInst *FCI = dyn_cast<FCmpInst>(Op0))
         return new FCmpInst(FCI->getInversePredicate(),
                             FCI->getOperand(0), FCI->getOperand(1));
-
-      // xor (or (cmp x,m),(cmp y,n)),true --> and (!cmp x,m),(!cmp y,n)
-      //
-      // Proof:
-      //   Let A = (cmp x,m)
-      //   Let B = (cmp y,n)
-      //   Let C = (or A, B)
-      //   C true implies that either A, B, or both are true.
-      //
-      //   (xor C, true) is true only if C is false. We can then apply de
-      //   Morgan's law. QED.
-      BinaryOperator *Op0I = dyn_cast<BinaryOperator>(Op0);
-      if (Op0I) {
-        Value *A, *B;
-        if (match(Op0I, m_Or(m_Value(A), m_Value(B)))) {
-          ICmpInst *AOp = dyn_cast<ICmpInst>(A);
-          ICmpInst *BOp = dyn_cast<ICmpInst>(B);
-
-          if (AOp && BOp) {
-            ICmpInst *NewA = new ICmpInst(AOp->getInversePredicate(),
-                                          AOp->getOperand(0),
-                                          AOp->getOperand(1));
-            InsertNewInstBefore(NewA, I);
-            ICmpInst *NewB = new ICmpInst(BOp->getInversePredicate(),
-                                          BOp->getOperand(0),
-                                          BOp->getOperand(1));
-            InsertNewInstBefore(NewB, I);
-            return BinaryOperator::CreateAnd(NewA, NewB);
-          }
-        }
-      }
     }
 
     // fold (xor(zext(cmp)), 1) and (xor(sext(cmp)), -1) to ext(!cmp).





More information about the llvm-commits mailing list