[llvm-commits] [llvm] r53356 - in /llvm/branches/Apple/Gaz: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/2008-07-08-SubAnd.ll

Bill Wendling isanbard at gmail.com
Wed Jul 9 14:00:41 PDT 2008


Author: void
Date: Wed Jul  9 16:00:40 2008
New Revision: 53356

URL: http://llvm.org/viewvc/llvm-project?rev=53356&view=rev
Log:
Reverting r53271 from Gaz branch

Modified:
    llvm/branches/Apple/Gaz/lib/Transforms/Scalar/InstructionCombining.cpp
    llvm/branches/Apple/Gaz/test/Transforms/InstCombine/2008-07-08-SubAnd.ll

Modified: llvm/branches/Apple/Gaz/lib/Transforms/Scalar/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Gaz/lib/Transforms/Scalar/InstructionCombining.cpp?rev=53356&r1=53355&r2=53356&view=diff

==============================================================================
--- llvm/branches/Apple/Gaz/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/branches/Apple/Gaz/lib/Transforms/Scalar/InstructionCombining.cpp Wed Jul  9 16:00:40 2008
@@ -3461,17 +3461,6 @@
         // ((A ^ N) - B) & AndRHS -> (A - B) & AndRHS iff N&AndRHS == 0
         if (Value *V = FoldLogicalPlusAnd(Op0LHS, Op0RHS, AndRHS, true, I))
           return BinaryOperator::CreateAnd(V, AndRHS);
-
-        // (A - N) & AndRHS -> -N & AndRHS where A & AndRHS == 0
-        if (Op0I->hasOneUse() && MaskedValueIsZero(Op0LHS, AndRHSMask)) {
-          ConstantInt *A = dyn_cast<ConstantInt>(Op0LHS);
-          if (!A || !A->isZero()) {
-            Instruction *NewNeg = BinaryOperator::CreateNeg(Op0RHS);
-            InsertNewInstBefore(NewNeg, I);
-            return BinaryOperator::CreateAnd(NewNeg, AndRHS);
-          }
-        }
-
         break;
 
       case Instruction::Shl:
@@ -3819,7 +3808,7 @@
           }
     }
   }
-
+      
   return Changed ? &I : 0;
 }
 

Modified: llvm/branches/Apple/Gaz/test/Transforms/InstCombine/2008-07-08-SubAnd.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Gaz/test/Transforms/InstCombine/2008-07-08-SubAnd.ll?rev=53356&r1=53355&r2=53356&view=diff

==============================================================================
--- llvm/branches/Apple/Gaz/test/Transforms/InstCombine/2008-07-08-SubAnd.ll (original)
+++ llvm/branches/Apple/Gaz/test/Transforms/InstCombine/2008-07-08-SubAnd.ll Wed Jul  9 16:00:40 2008
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep -v {i32 8}
-; PR2330
-
-define i32 @a(i32 %a) nounwind  {
-entry:
-	%tmp2 = sub i32 8, %a		; <i32> [#uses=1]
-	%tmp3 = and i32 %tmp2, 7		; <i32> [#uses=1]
-	ret i32 %tmp3
-}





More information about the llvm-commits mailing list