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

Eli Friedman eli.friedman at gmail.com
Mon Aug 3 12:15:55 PDT 2009


Author: efriedma
Date: Mon Aug  3 14:15:42 2009
New Revision: 77986

URL: http://llvm.org/viewvc/llvm-project?rev=77986&view=rev
Log:
Make SimplifyDemandedUseBits generate vector constants where 
appropriate.  Patch per report on llvmdev.  No testcase because the 
original report didn't come with a testcase, and I can't come up with a case
that actually fails.


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=77986&r1=77985&r2=77986&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Mon Aug  3 14:15:42 2009
@@ -1014,7 +1014,7 @@
     if ((DemandedMask & (RHSKnownZero|RHSKnownOne)) == DemandedMask) { 
       // all known
       if ((RHSKnownOne & LHSKnownOne) == RHSKnownOne) {
-        Constant *AndC = ConstantInt::get(*Context, 
+        Constant *AndC = ConstantInt::get(VTy, 
                                           ~RHSKnownOne & DemandedMask);
         Instruction *And = 
           BinaryOperator::CreateAnd(I->getOperand(0), AndC, "tmp");
@@ -1407,7 +1407,7 @@
   // If the client is only demanding bits that we know, return the known
   // constant.
   if ((DemandedMask & (RHSKnownZero|RHSKnownOne)) == DemandedMask) {
-    Constant *C = ConstantInt::get(*Context, RHSKnownOne);
+    Constant *C = ConstantInt::get(VTy, RHSKnownOne);
     if (isa<PointerType>(V->getType()))
       C = ConstantExpr::getIntToPtr(C, V->getType());
     return C;





More information about the llvm-commits mailing list